CN109062321B - Signal generation method, equipment and storage medium - Google Patents

Signal generation method, equipment and storage medium Download PDF

Info

Publication number
CN109062321B
CN109062321B CN201810866620.1A CN201810866620A CN109062321B CN 109062321 B CN109062321 B CN 109062321B CN 201810866620 A CN201810866620 A CN 201810866620A CN 109062321 B CN109062321 B CN 109062321B
Authority
CN
China
Prior art keywords
signal
signals
frequency
superposed
combined
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810866620.1A
Other languages
Chinese (zh)
Other versions
CN109062321A (en
Inventor
张来风
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Optical Technology Co Ltd
Original Assignee
Goertek Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Inc filed Critical Goertek Inc
Priority to CN201810866620.1A priority Critical patent/CN109062321B/en
Publication of CN109062321A publication Critical patent/CN109062321A/en
Application granted granted Critical
Publication of CN109062321B publication Critical patent/CN109062321B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/02Digital function generators
    • G06F1/022Waveform generators, i.e. devices for generating periodical functions of time, e.g. direct digital synthesizers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application provides a signal generation method, equipment and a storage medium, wherein the method comprises the following steps: determining a signal with the same frequency as a required combined signal in at least two signals to be superposed as a basic signal; adjusting the frequencies of other signals to be superposed by taking the frequency of the basic signal as a reference so as to align the other signals to be superposed with the basic signal; and performing signal superposition according to the basic signal and the other signals to be superposed after the frequency adjustment to obtain the combined signal. In the embodiment of the application, before signal superposition, the frequency of a basic signal in at least two signals to be superposed is taken as a reference, and the frequencies of other signals to be superposed are adjusted so as to align the other signals to be superposed with the basic signal. This can effectively avoid the signal mutation of the combined signal obtained after the signal superposition at the signal period handover position.

Description

Signal generation method, equipment and storage medium
Technical Field
The present application relates to the field of signal processing technologies, and in particular, to a signal generation method, device, and storage medium.
Background
Micro-Electro-Mechanical systems (MEMS), also called Micro-Electro-Mechanical systems, microsystems, micromachines, etc., refer to high-tech devices with dimensions of a few millimeters or even smaller.
The drive signal of the MEMS is a combined signal generated by combining a sine wave signal and a sawtooth wave signal. In order to obtain a combined signal, the existing processing methods are generally: according to the time corresponding relation of the two signals to be superposed, signal segments with the length equal to the signal period of the combined signal are respectively selected from the two signals to be superposed to serve as basic segments, and the selected basic segments are superposed to obtain a complete combined signal.
However, in the combined signal obtained by the existing processing method, a signal sudden change often exists at the signal period handover position of the combined signal, and the MEMS is very sensitive to the signal change, and the signal sudden change can cause the MEMS to fail to operate normally.
Disclosure of Invention
Aspects of the present application provide a signal generation method, device and storage medium to solve a problem in the prior art that a combined signal generated after signal superposition often has a signal abrupt change at a signal cycle handover position.
The embodiment of the application provides a signal generation method, which comprises the following steps:
determining a signal with the same frequency as a required combined signal in at least two signals to be superposed as a basic signal;
adjusting the frequencies of other signals to be superposed by taking the frequency of the basic signal as a reference so as to align the other signals to be superposed with the basic signal;
and performing signal superposition according to the basic signal and the other signals to be superposed after the frequency adjustment to obtain the combined signal.
The embodiment of the application also provides an electronic device, which comprises a memory and a processor;
the memory is used for storing a computer program;
the processor executes a computer program within the memory for:
determining a signal with the same frequency as a required combined signal in at least two signals to be superposed as a basic signal;
adjusting the frequencies of other signals to be superposed by taking the frequency of the basic signal as a reference so as to align the other signals to be superposed with the basic signal;
and performing signal superposition according to the basic signal and the other signals to be superposed after the frequency adjustment to obtain the combined signal.
Embodiments of the present application also provide a computer-readable storage medium storing computer instructions that, when executed by one or more processors, cause the one or more processors to perform the following acts:
determining a signal with the same frequency as a required combined signal in at least two signals to be superposed as a basic signal;
adjusting the frequencies of other signals to be superposed by taking the frequency of the basic signal as a reference so as to align the other signals to be superposed with the basic signal;
and performing signal superposition according to the basic signal and the other signals to be superposed after the frequency adjustment to obtain the combined signal.
In the embodiment of the application, before signal superposition, the frequency of a basic signal in at least two signals to be superposed is taken as a reference, and the frequencies of other signals to be superposed are adjusted so as to align the other signals to be superposed with the basic signal. When the signals are superposed according to the basic signals and other signals to be superposed after the frequency adjustment, the initial signal point in any signal period of the basic signals is aligned with the initial signal point in a certain signal period of other signals to be superposed, and meanwhile, the ending signal point in any signal period of the basic signals is aligned with the ending signal point in a certain signal period of other signals to be superposed, so that the signal mutation of the combined signals obtained after the signals are superposed at the signal period handover position can be effectively avoided.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a signal generation method according to an embodiment of the present application;
FIG. 2a is an exemplary waveform of a base signal in an embodiment of the present application;
FIG. 2b is an exemplary waveform diagram of other signals to be superimposed in the embodiments of the present application;
fig. 3 is a waveform diagram of a combined signal obtained by the signal generation method provided in the present embodiment, of the basic signal in fig. 2a and the signal to be superimposed in fig. 2 b;
fig. 4 is a schematic structural diagram of an electronic device according to yet another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the prior art, signal abrupt changes often exist at the signal period handover positions of the combined signals. To solve the above problems in the prior art, embodiments of the present application provide a solution: before signal superposition, the frequency of a basic signal in at least two signals to be superposed is taken as a reference, and the frequencies of other signals to be superposed are adjusted so as to align the other signals to be superposed with the basic signal. When the signals are superposed according to the basic signals and other signals to be superposed after the frequency adjustment, the initial signal point in any signal period of the basic signals is aligned with the initial signal point in a certain signal period of other signals to be superposed, and meanwhile, the ending signal point in any signal period of the basic signals is aligned with the ending signal point in a certain signal period of other signals to be superposed, so that the signal mutation of the combined signals obtained after the signals are superposed at the signal period handover position can be effectively avoided.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a signal generation method according to an embodiment of the present application. As shown in fig. 1, the method includes:
100. determining a signal with the same frequency as a required combined signal in at least two signals to be superposed as a basic signal;
101. adjusting the frequencies of other signals to be superposed by taking the frequency of the basic signal as a reference so as to align the other signals to be superposed with the basic signal;
102. and performing signal superposition according to the basic signal and the other signals to be superposed after the frequency adjustment to obtain a combined signal.
The signal generation method provided by the embodiment can be applied to various scenes in which a combined signal needs to be generated, particularly scenes sensitive to signal change of a signal cycle handover position. For example, the present invention may be applied to a scenario in which a MEMS driving signal is generated, and of course, may also be applied to other scenarios, which is not limited by the present embodiment.
The basic signal is a signal to be superimposed selected according to the frequency of the desired combined signal. The frequency of the basic signal is the same as the frequency of the combined signal, and the basic signal is the signal with the smallest frequency among all the signals to be superimposed. In signal superposition, for convenience of description, the signal superposition process in this embodiment may be regarded as superimposing other signals to be superimposed on the base signal, but it should be understood that there is no order of primary or secondary, sequence, etc. between the signals to be superimposed in the signal superposition process.
It should be noted that, in this embodiment, the number of the signals to be superimposed may be two, three, four, or other numbers, and the number of the signals to be superimposed is not limited in this embodiment. For convenience of description, the following description will focus on the case where two signals to be superimposed are used for detailed description of the technical solution, but it should be understood that the signals to be superimposed may adopt the same or adaptively adjusted processing manner except for the basic signal.
According to the determined basic signal, aligning other signals to be superposed with the basic signal as a target, and adjusting the frequency of the other signals to be superposed. The other signals to be superimposed after the frequency adjustment will be aligned with the base signal. The alignment means that a start signal point in any signal period of the basic signal is aligned with a start signal point in a certain signal period of other signals to be superposed, and meanwhile, an end signal point in any signal period of the basic signal is aligned with an end signal point in a certain signal period of other signals to be superposed.
And performing signal superposition according to the aligned basic signal and the other signals to be superposed after the frequency adjustment to obtain the required combined signal. The resulting combined signal will no longer have abrupt signal transitions at the signal cycle hand-over location.
For example, for the first signal period of the base signal, the end signal point of a certain signal period of the other signals to be superimposed will be aligned with the end signal point in the first signal period of the base signal by the frequency adjustment, and thus the amplitude of the end signal point of the first signal period of the combined signal will be the sum of the amplitude of the end signal point in the first signal period of the base signal and the amplitude of the end signal point of a certain signal period of the other signals to be superimposed. For the second signal period of the base signal, the starting signal point of a certain signal period of the other signals to be superimposed will be aligned with the starting signal point in the first signal period of the base signal by the frequency adjustment, and thus the amplitude of the starting signal point of the second signal period of the combined signal will be the sum of the amplitude of the starting signal point in the second signal period of the base signal and the amplitude of the starting beam signal point of a certain signal period of the other signals to be superimposed. In this way, the signal segment at the intersection of the first signal period and the second signal period of the combined signal is relatively smooth and completely conforms to the signal variation trend of the intersection of the signal periods of the base signal and the signal variation trend of the intersection of the signal periods of the other signals to be superimposed.
In the above example, if the conventional signal superimposing method is adopted, according to the frequency of each signal to be superimposed, the basic signal may be superimposed on the 5 th signal point (located in the first half period), the 10 th signal point (located at the lowest point in the period), or the 12 th signal point (located in the second half period) in a certain signal period of other signals to be superimposed, and the like in the end signal point of the first signal period, and the superimposition of the start signal point in the signal period of other signals to be superimposed is restarted at the start signal point of the second signal period of the basic signal. Therefore, according to the existing signal superposition manner, the amplitude of the end signal point of the first signal period of the combined signal may be the sum of the amplitude of the end signal point in the first signal period of the basic signal and the amplitude of the signal point with the minimum amplitude of a certain signal period of other signals to be superposed; the amplitude of the start signal point of the second signal period of the combined signal is the sum of the amplitude of the start signal point in the second signal period of the base signal and the amplitude of the start signal points of the signal periods of the other signals to be superimposed. Obviously, the combined signal obtained by the existing signal superposition method will have amplitude jump at the signal cycle cross-over position, which results in that the signal cycle cross-over position of the combined signal will often have signal abrupt change.
Fig. 2a is an exemplary waveform diagram of a basic signal in the embodiment of the present application. Fig. 2b is an exemplary waveform diagram of other signals to be superimposed in the embodiment of the present application. Fig. 3 is a waveform diagram of a combined signal obtained by the signal generation method provided in the present embodiment, of the basic signal in fig. 2a and the signal to be superimposed in fig. 2 b. The combined signal shown in fig. 3 has no signal discontinuities at the signal cycle hand-over position.
In the embodiment of the application, before signal superposition, the frequency of the basic signal in at least two signals to be superposed is taken as a reference, and the frequencies of other signals to be superposed are adjusted to align the other signals to be superposed with the basic signal. When the signals are superposed according to the basic signals and other signals to be superposed after the frequency adjustment, the starting signal point of any signal period of the basic signals is aligned with the starting signal point of a certain signal period of other signals to be superposed, and meanwhile, the ending signal point of any signal period of the basic signals is aligned with the ending signal point of a certain signal period of other signals to be superposed, so that the signal mutation of the combined signals obtained after the signals are superposed at the signal period handover position can be effectively avoided.
In the above or below embodiments, in order to align the other signals to be superimposed with the base signal, the frequency ratio of the other signals to be superimposed to the base signal may be calculated; if the frequency ratio is a non-integer, determining an integer value based on the frequency ratio; and taking the frequency ratio equal to the integer value as a target, and taking the frequency of the basic signal as a reference, and adjusting the frequencies of other signals to be superposed.
In this embodiment, the number of signal cycles that need to be superimposed on one signal cycle of the base signal in the other signals to be superimposed when the signal is superimposed can be determined according to the frequency ratio of the other signals to be superimposed to the base signal. The frequency ratio will be an integer when the frequencies of the other signals to be superimposed are integer multiples of the frequency of the base signal, and will be a non-integer when the frequencies of the other signals to be superimposed are not integer multiples of the frequency of the base signal. For the case where the frequency ratio is an integer, the base signal and the other signals to be superimposed will be aligned, and the frequencies of the other signals to be superimposed may not need to be adjusted. For the case that the frequency ratio is a non-integer, the other signals to be superimposed are not aligned with the basic signal, and this embodiment may adjust the frequency of the other signals to be superimposed, that is, adjust the time length of the signal period of the other signals to be superimposed, so that the frequency ratio is an integer, and the other signals to be superimposed after the frequency adjustment will be aligned with the basic signal.
When the frequency ratio is a non-integer, the frequency of other signals to be superimposed can be increased or decreased according to the frequency ratio result. In an optional implementation manner, in a signal period of other signals to be superimposed, N signal points may be used to represent a signal segment in the signal period, where the N signal points are uniformly distributed, and may represent signal attributes such as signal time, amplitude value at each signal time, and the like in the signal segment in the signal period of the other signals to be superimposed. When the frequency ratio of the other signals to be superimposed to the base signal is P, the initial number M of signal points on a signal segment in one signal period of the base signal can be determined according to the product of P and N. And (4) carrying out complementation on the M and the N to obtain a remainder Q, and adjusting the frequency of other signals to be superposed according to the remainder Q.
The remainder Q after M and N are complemented will have two cases:
in the first case, the remainder Q of the remainder of M after being complemented by N is less than N/2. In this case, Q signal points may be deleted from M signal points in one signal period of the basic signal, and the remaining (M-Q) signal points are rearranged to be uniformly distributed according to the waveform trend of the basic signal while maintaining the frequency of the basic signal unchanged. Aligning the (P × N) signal points of the other signals to be superimposed with the (M-Q) signal points of the base signal, wherein the frequencies of the other signals to be superimposed are reduced.
In the second case, the remainder Q of the remainder of M after being complemented by N is greater than N/2. In this case, Q signal points may be added on the basis of M signal points in one signal period of the basic signal, and on the premise of maintaining the frequency of the basic signal unchanged, (M + Q) signal points are rearranged to be uniformly distributed according to the waveform trend of the basic signal. Aligning the (P × N) signal points of the other signals to be superimposed with the (M + Q) signal points of the base signal, wherein the frequencies of the other signals to be superimposed are increased.
Of course, other frequency adjustment manners may also be adopted in this embodiment, for example, the frequency scaling of other signals to be superimposed is determined according to the frequency ratio of the other signals to be superimposed and the base signal, and the like, which is not limited in this embodiment.
After the frequency of other signals to be superimposed is adjusted, signal superposition can be performed according to the basic signal and the other signals to be superimposed after the frequency adjustment, so as to obtain a combined signal. Wherein the signal superposition may be performed in various ways to obtain the combined signal, the signal superposition process will be described in detail in the form of various embodiments below.
In an optional embodiment, a signal segment in one signal period may be selected from the basic signal as a reference periodic signal, and signal segments in a plurality of signal periods may be selected from other signals to be superimposed after frequency adjustment as signal segments to be superimposed, where the time lengths of the plurality of signal periods are the same as the signal period of the basic signal; according to a signal alignment principle, signal superposition is carried out on a signal segment to be superposed and a reference periodic signal to obtain a combined signal segment of a signal period, and the combined signal segment is stored in a buffer area; the combined signal segments in the buffer are cyclically output as combined signal segments in subsequent signal periods of the combined signal to produce the combined signal, according to the frequency of the combined signal.
In this embodiment, the reference periodic signal may be a signal segment in any one complete period of the basic signal, for example, a signal segment in a first signal period of the basic signal, and certainly, a signal segment in another signal period of the basic signal, which is not limited in this embodiment. In order to improve the signal processing efficiency, in this embodiment, the reference periodic signal is preferably a signal segment within the first signal period of the base signal. Based on this, it is possible to perform signal superimposition in the signal superimposition manner provided in the present embodiment from the first cycle of the reference signal.
The signal segment to be superposed is a signal segment which needs to be superposed on the reference periodic signal in other signals to be superposed. In practical application, in order to save data processing amount, only data corresponding to a signal segment in any signal period of other signals to be superimposed may be acquired, and the signal segment may be used as a reference signal segment corresponding to the other signals to be superimposed. When signals are superposed, the reference signal segment can be called for many times and is superposed on the reference periodic signal in sequence, that is, the signal segment to be superposed can be a virtual signal segment instead of an actual signal segment collected from other signals to be superposed. This can effectively reduce the data acquisition amount and improve the signal processing speed.
In the embodiment, only the signal segments in one signal period of the basic signal and the other signals to be superposed are respectively acquired, and the generation of the combined signal can be realized by utilizing the signal segments in one signal period of the basic signal and the other signals to be superposed, so that the data processing amount is effectively reduced. And only the signal segment in one signal period in the basic signal and other signals to be superposed needs to be stored, so that the memory occupation is reduced. Especially for the scene of a microprocessor with very small memory capacity, the memory pressure can be effectively relieved.
The other signals to be superimposed after the frequency adjustment are aligned with the basic signal, so the reference periodic signal is also aligned with the signal segment to be superimposed, that is, the starting signal point of the reference periodic signal is aligned with the starting signal point of the signal segment to be superimposed, and the ending signal point of the reference periodic signal is aligned with the ending signal point of the signal segment to be superimposed. Because the frequency of the reference signal is the same as that of the combined signal, the time length of the reference periodic signal corresponds to the time length of one signal period of the combined signal, so that after the reference periodic signal and the signal segment to be superposed are subjected to signal superposition, the combined signal segment in one signal period in the combined signal can be obtained.
The obtained combined signal segment will be stored to the buffer for subsequent recall. Since the base signal, the other signals to be superimposed and the combined signal are all periodic signals, the combined signal segments within each signal period of the combined signal will be the same. Based on this, in this embodiment, the combined signal segment in the buffer can be cyclically output according to the frequency of the combined signal as the combined signal segment in the subsequent signal period of the combined signal, so that the combined signal can be generated.
The combined signal segment may include a number of signal points that characterize the combined signal segment, and each signal point includes signal attribute information such as a signal location and an amplitude at the signal location. In the buffer, the combined signal segments may be stored in the form of several signal points arranged in sequence. Accordingly, in this embodiment, the trigger frequency of the timer may be set according to the frequency of the combined signal and the number of signal points included in the combined signal segment in the buffer area; and outputting one signal point contained in the combined signal segment in the buffer area in sequence every time when the timer is triggered according to the mode of circularly outputting the combined signal segment in the buffer area so as to obtain the combined signal segment in the subsequent signal period of the combined signal.
The trigger frequency of the timer may be set as a product of the frequency of the combined signal and the number of signal points included in the combined signal segment in the buffer. When the timer is triggered, one signal point contained in the combined signal segment in the buffer area is output in sequence, if the current output is the last signal point contained in the combined signal segment, the next output is the first signal point contained in the combined signal segment, and the combined signal segment in the subsequent signal period of the combined signal can be obtained through the cycle output, so that the combined signal can be generated. When the reference periodic signal is the signal segment of the first signal period of the basic signal, the buffer stores the combined signal segment in the first signal period of the combined signal, so that the combined signal segment in the subsequent signal period of the combined signal can be obtained by cyclically outputting the combined signal segment in the buffer.
The cycle output may be implemented by means of a timer triggered interrupt, which triggers the processor to output one signal point contained in the combined signal segment in the buffer in order each time the timer is triggered. However, for the combined signal with a higher frequency, the trigger frequency of the timer will be higher, which results in the loop output process occupying the processor resources, so that the processor cannot perform other operations during the process, and the resource utilization rate of the processor is reduced. In this embodiment, when the combined signal segment in the subsequent signal period of the combined signal needs to be generated, a transmission instruction may be sent to the DMA (direct Memory access) controller to control the DMA controller to read and output a signal point from the combined signal segment in the buffer in sequence when the timer is triggered, so as to obtain the combined signal segment in the subsequent signal period of the combined signal.
The DMA controller can directly carry the data in the buffer area to the outside, so that the circular output process does not need a processor to participate in data carrying. When the cycle output is started, the DMA controller may perform data transfer according to the trigger frequency of the timer, that is, whenever the timer is triggered, the DMA controller reads and outputs one signal point from the combined signal segment in the buffer. Therefore, in the cycle output process, the processor does not depend on timer interruption any more, and does not need to participate in data transportation, so that the problem of low utilization rate of processor resources caused by long-time occupation of the processor is avoided, and especially for combined signals with high frequency, the resource occupation of the processor is effectively liberated.
In another alternative embodiment, when the frequency of the combined signal is lower than the preset frequency threshold, the combined signal may be generated by performing signal superposition according to the base signal and the other signals to be superposed after the frequency adjustment when the timer triggers the interruption based on the preset timer interruption frequency. In this embodiment, a preset frequency threshold may be set according to the processing capability of the processor, and when the processing capability of the processor can meet the frequency requirement of the combined signal, the signal superposition processing may be performed by using the processing method provided in this embodiment.
The combined signal may include a number of signal points that characterize the combined signal, and each signal point includes signal attribute information such as a signal location and an amplitude at the signal location. In this embodiment, the timer interrupt frequency may be set as the product of the frequency of the combined signal and the number of signal points in one signal period of the combined signal. When the timer triggers the interrupt, a signal point on the combined signal can be calculated and output in sequence according to the basic signal and other signals to be superposed after the frequency adjustment and the signal alignment principle so as to generate the combined signal.
Because the basic signal, the other signals to be superimposed and the combined signal are periodic signals, in this embodiment, a signal segment in one signal period can be selected from the basic signal as a reference periodic signal, and signal segments in a plurality of signal periods can be selected from the other signals to be superimposed after frequency adjustment as signal segments to be superimposed, wherein the time lengths of the signal periods are the same as that of the basic signal; based on the preset timer interrupt frequency, a plurality of signal points in one signal period of the combined signal are calculated and output in a circulating mode, and when the timer triggers interrupt, one signal point in one signal period of the combined signal is calculated and output in sequence according to a signal alignment principle according to a reference period signal and a signal segment to be superposed to obtain the combined signal.
In this embodiment, the reference periodic signal may be a signal segment in any one complete period of the basic signal, for example, a signal segment in a first signal period of the basic signal, and certainly, a signal segment in another signal period of the basic signal, which is not limited in this embodiment. In order to improve the signal processing efficiency, in this embodiment, the reference periodic signal is preferably a signal segment within the first signal period of the base signal. Based on this, it is possible to perform signal superimposition in the signal superimposition manner provided in the present embodiment from the first cycle of the reference signal.
The signal segment to be superposed is a signal segment which needs to be superposed on the reference periodic signal in other signals to be superposed. In practical application, in order to save data processing amount, only data corresponding to a signal segment in any signal period of other signals to be superimposed may be acquired, and the signal segment may be used as a reference signal segment corresponding to the other signals to be superimposed. When signals are superposed, the reference signal segment can be called for many times and is superposed on the reference periodic signal in sequence, that is, the signal segment to be superposed can be a virtual signal segment instead of an actual signal segment collected from other signals to be superposed. This can effectively reduce the data acquisition amount and improve the signal processing speed.
The other signals to be superimposed after the frequency adjustment are aligned with the basic signal, so the reference periodic signal is also aligned with the signal segment to be superimposed, that is, the starting signal point of the reference periodic signal is aligned with the starting signal point of the signal segment to be superimposed, and the ending signal point of the reference periodic signal is aligned with the ending signal point of the signal segment to be superimposed. Since the reference signal and the combined signal have the same frequency, the time length of the reference periodic signal will correspond to the time length of one signal period of the combined signal.
In this embodiment, a signal period of the combined signal includes a plurality of signal points, the signal points in the signal period of the combined signal correspond to the signal points in the reference periodic signal one to one, and the signal points in the reference periodic signal correspond to the signal points in the signal segments to be superimposed one to one, so that when the signal superposition is performed on the reference periodic signal and the signal segments to be superimposed, the plurality of signal points in the signal period of the combined signal can be obtained. In this embodiment, each time the timer triggers the interrupt, a signal point is sequentially calculated and output according to the signal alignment principle based on the reference periodic signal and the signal segment to be superimposed, if the current calculated and output is the last signal point in one signal period of the combined signal, the next time the timer triggers the interrupt, the first signal point in one signal period of the combined signal is calculated and output, and the combined signal can be obtained in such a manner that a plurality of signal points in one signal period of the combined signal are cyclically calculated and output.
In the embodiment, only the signal segments in one signal period of the basic signal and the other signals to be superposed are respectively acquired, and the generation of the combined signal can be realized by utilizing the signal segments in one signal period of the basic signal and the other signals to be superposed, so that the data processing amount is effectively reduced. And only the signal segment in one signal period in the basic signal and other signals to be superposed needs to be stored, so that the memory occupation is reduced. Especially for the scene of a microprocessor with very small memory capacity, the memory pressure can be effectively relieved.
Fig. 4 is a schematic structural diagram of an electronic device according to another embodiment of the present application. As shown in fig. 4, the electronic apparatus includes: a memory 40 and a processor 41;
the memory 40 stores computer programs and may be configured to store various other data to support operations on the server device. Examples of such data include instructions for any application or method operating on the server device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 40 is implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The processor 41 is coupled to the memory 40 for executing the computer program in the memory 40 for:
determining a signal with the same frequency as a required combined signal in at least two signals to be superposed as a basic signal;
adjusting the frequencies of other signals to be superposed by taking the frequency of the basic signal as a reference so as to align the other signals to be superposed with the basic signal;
and performing signal superposition according to the basic signal and the other signals to be superposed after the frequency adjustment to obtain a combined signal.
In the embodiment of the application, before signal superposition, the frequency of the basic signal in at least two signals to be superposed is taken as a reference, and the frequencies of other signals to be superposed are adjusted to align the other signals to be superposed with the basic signal. When the signals are superposed according to the basic signals and other signals to be superposed after the frequency adjustment, the starting signal point of any signal period of the basic signals is aligned with the starting signal point of a certain signal period of other signals to be superposed, and meanwhile, the ending signal point of any signal period of the basic signals is aligned with the ending signal point of a certain signal period of other signals to be superposed, so that the signal mutation of the combined signals obtained after the signals are superposed at the signal period handover position can be effectively avoided.
In an alternative embodiment, the processor 41 is configured to, when adjusting the frequencies of the other signals to be superimposed based on the frequency of the base signal to align the other signals to be superimposed with the base signal:
calculating the frequency ratio of other signals to be superposed and the basic signal;
if the frequency ratio is a non-integer, determining an integer value based on the frequency ratio;
and taking the frequency ratio equal to the integer value as a target, and taking the frequency of the basic signal as a reference, and adjusting the frequencies of other signals to be superposed.
In an alternative embodiment, the processor 41, when performing signal superposition according to the base signal and the other signals to be superposed after the frequency adjustment to obtain the combined signal, is configured to:
selecting a signal segment in one signal period from the basic signal as a reference periodic signal, and selecting signal segments in a plurality of signal periods from other signals to be superposed after frequency adjustment as signal segments to be superposed, wherein the time lengths of the signal periods of the basic signal are the same;
according to a signal alignment principle, signal superposition is carried out on a signal segment to be superposed and a reference periodic signal to obtain a combined signal segment of a signal period, and the combined signal segment is stored in a buffer area;
the combined signal segments in the buffer are cyclically output as combined signal segments in subsequent signal periods of the combined signal to produce the combined signal, according to the frequency of the combined signal.
In an alternative embodiment, as shown in fig. 4, the electronic device further includes: a timer 45;
the processor 41, when cyclically outputting the combined signal segment in the buffer as a combined signal segment in a subsequent signal period of the combined signal according to the frequency of the combined signal, is configured to:
setting the trigger frequency of the timer 45 according to the frequency of the combined signal and the number of signal points included in the combined signal segment in the buffer area;
outputting a signal point contained in the combined signal segment in the buffer in sequence to obtain a combined signal segment in a subsequent signal period of the combined signal whenever the timer 45 is triggered in a manner of circularly outputting the combined signal segment in the buffer;
the timer 45 is used to trigger the processor to output a signal point contained in the combined signal segment in the buffer in order according to the trigger frequency.
In an alternative embodiment, as shown in fig. 2, the electronic device further includes: a DMA controller 46;
the processor 41, when outputting the combined signal segments in the buffer in a cyclic manner, each time the timer 45 is triggered, sequentially outputs a signal point included in the combined signal segment in the buffer to obtain a combined signal segment in a subsequent signal period of the combined signal, is configured to:
when a combined signal segment in a subsequent signal cycle of the combined signal needs to be generated, a transmit instruction is sent to the DMA controller 46;
the DMA controller 46 is configured to read and output a signal point from the combined signal segment in the buffer in sequence each time the customizer 45 is triggered, in such a manner that the combined signal segment in the buffer is output in a loop, so as to obtain the combined signal segment in a subsequent signal period of the combined signal.
In an alternative embodiment, the processor 41, when performing signal superposition according to the base signal and the other signals to be superposed after the frequency adjustment to obtain the combined signal, is configured to:
when the frequency of the combined signal is lower than a preset frequency threshold, based on a preset timer interrupt frequency, performing signal superposition according to the basic signal and other signals to be superposed after frequency adjustment when the timer triggers interrupt to generate a combined signal; the timer interrupt frequency is related to the frequency of the combined signal and the number of signal points in one signal period of the combined signal.
In an alternative embodiment, the processor 41, when performing signal superposition according to the base signal and the other signals to be superposed after the frequency adjustment to generate the combined signal when the timer triggers the interrupt based on the preset timer interrupt frequency, is configured to:
selecting a signal segment in one signal period from the basic signal as a reference periodic signal, and selecting signal segments in a plurality of signal periods from other signals to be superposed after frequency adjustment as signal segments to be superposed, wherein the time lengths of the signal periods of the basic signal are the same;
based on the preset timer interrupt frequency, a plurality of signal points in one signal period of the combined signal are calculated and output in a circulating mode, and when the timer triggers interrupt, one signal point in one signal period of the combined signal is calculated and output in sequence according to a signal alignment principle according to a reference period signal and a signal segment to be superposed to obtain the combined signal.
Further, as shown in fig. 4, the control apparatus further includes: communication components 43, display 44, power components 45, and the like. Only some of the components are schematically shown in fig. 4, and it is not intended that the control device includes only the components shown in fig. 4.
Wherein the communication component 42 is configured to facilitate wired or wireless communication between the device in which the communication component is located and other devices. The device in which the communication component is located may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 42 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
The display 43 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP), among others. If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
The power supply unit 44 supplies power to various components of the device in which the power supply unit is located. The power components may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device in which the power component is located.
Accordingly, the present application further provides a computer-readable storage medium storing a computer program, where the computer program is capable of implementing the steps that can be executed by the electronic device in the foregoing method embodiments when executed.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A signal generation method, comprising:
determining a signal with the same frequency as a required combined signal in at least two signals to be superposed as a basic signal;
adjusting the frequencies of other signals to be superposed by taking the frequency of the basic signal as a reference so as to align the other signals to be superposed with the basic signal;
performing signal superposition according to the basic signal and other signals to be superposed after frequency adjustment to obtain the combined signal;
the adjusting the frequency of other signals to be superimposed by taking the frequency of the basic signal as a reference so as to align the other signals to be superimposed with the basic signal comprises:
calculating the frequency ratio of the other signals to be superposed and the basic signal;
if the frequency ratio is a non-integer, determining an integer value based on the frequency ratio;
and taking the frequency ratio equal to the integer value as a target, and taking the frequency of the basic signal as a reference, and adjusting the frequencies of other signals to be superposed.
2. The method according to claim 1, wherein the signal superposition according to the base signal and the other signals to be superposed after the frequency adjustment to obtain the combined signal comprises:
selecting a signal segment in a signal period from the basic signal as a reference periodic signal, and selecting signal segments in a plurality of signal periods from other signals to be superposed after the frequency adjustment as signal segments to be superposed, wherein the time lengths of the signal periods of the basic signal are the same;
according to a signal alignment principle, carrying out signal superposition on the signal segment to be superposed and the reference periodic signal to obtain a combined signal segment of a signal period, and storing the combined signal segment to a buffer area;
and according to the frequency of the combined signal, circularly outputting the combined signal segment in the buffer area as the combined signal segment in the subsequent signal period of the combined signal to generate the combined signal.
3. The method of claim 2, wherein said cyclically outputting the combined signal segment in the buffer as the combined signal segment in a subsequent signal period of the combined signal according to the frequency of the combined signal comprises:
setting the trigger frequency of a timer according to the frequency of the combined signal and the number of signal points contained in the combined signal segment in the cache region;
and outputting a signal point contained in the combined signal segment in the buffer area in sequence every time when a timer is triggered according to a mode of circularly outputting the combined signal segment in the buffer area so as to obtain the combined signal segment in a subsequent signal period of the combined signal.
4. The method of claim 3, wherein outputting a signal point included in the combined signal segment in the buffer in order to obtain the combined signal segment in a subsequent signal period of the combined signal each time a timer is triggered in a manner of cyclically outputting the combined signal segment in the buffer comprises:
when the combined signal segment in the subsequent signal period of the combined signal needs to be generated, a transmission instruction is sent to the DMA controller so as to control the DMA controller to read and output one signal point from the combined signal segment in the buffer area in sequence when the timer is triggered, so as to obtain the combined signal segment in the subsequent signal period of the combined signal.
5. The method according to claim 1, wherein the signal superposition according to the base signal and the other signals to be superposed after the frequency adjustment to obtain the combined signal comprises:
when the frequency of the combined signal is lower than a preset frequency threshold, based on a preset timer interrupt frequency, performing signal superposition according to the basic signal and other signals to be superposed after frequency adjustment when the timer triggers interrupt to generate the combined signal; wherein the timer interrupt frequency is related to the frequency of the combined signal and the number of signal points within one signal period of the combined signal.
6. The method according to claim 5, wherein the signal superposition according to the base signal and the other signals to be superposed after the frequency adjustment when the timer triggers the interrupt based on the preset timer interrupt frequency to generate the combined signal comprises:
selecting a signal segment in a signal period from the basic signal as a reference periodic signal, and selecting signal segments in a plurality of signal periods from other signals to be superposed after the frequency adjustment as signal segments to be superposed, wherein the time lengths of the signal periods of the basic signal are the same;
and based on a preset timer interrupt frequency, calculating and outputting a combined signal segment of one signal period of the combined signal in a circulating mode, and calculating and outputting a signal point contained in the combined signal segment in sequence according to a signal alignment principle according to the reference period signal and the signal segment to be superposed when the timer triggers interrupt to obtain the combined signal.
7. An electronic device comprising a memory and a processor;
the memory is used for storing a computer program;
the processor executes a computer program within the memory for:
determining a signal with the same frequency as a required combined signal in at least two signals to be superposed as a basic signal;
adjusting the frequencies of other signals to be superposed by taking the frequency of the basic signal as a reference so as to align the other signals to be superposed with the basic signal;
performing signal superposition according to the basic signal and other signals to be superposed after frequency adjustment to obtain the combined signal;
the processor is configured to, when the frequency of the base signal is used as a reference, adjust the frequency of the other signals to be superimposed to align the other signals to be superimposed with the base signal, to:
calculating the frequency ratio of other signals to be superposed to the basic signal;
if the frequency ratio is a non-integer, determining an integer value based on the frequency ratio;
and taking the frequency ratio equal to the integer value as a target, and taking the frequency of the basic signal as a reference to adjust the frequencies of other signals to be superposed.
8. The electronic device of claim 7, wherein the processor performs signal superposition according to the base signal and the other signals to be superposed after the frequency adjustment to obtain the combined signal, and comprises:
selecting a signal segment in a signal period from the basic signal as a reference periodic signal, and selecting signal segments in a plurality of signal periods from other signals to be superposed after the frequency adjustment as signal segments to be superposed, wherein the time lengths of the signal periods of the basic signal are the same;
according to a signal alignment principle, carrying out signal superposition on the signal segment to be superposed and the reference periodic signal to obtain a combined signal segment of a signal period, and storing the combined signal segment to a buffer area;
and according to the frequency of the combined signal, circularly outputting the combined signal segment in the buffer area as the combined signal segment in the subsequent signal period of the combined signal to generate the combined signal.
9. The electronic device of claim 8, further comprising a timer and a DMA controller;
the processor, when cyclically outputting the combined signal segment in the buffer as the combined signal segment in the subsequent signal period of the combined signal according to the frequency of the combined signal, is configured to:
according to the frequency of the combined signal and the number of signal points contained in the combined signal segment in the cache region, when the combined signal segment in the subsequent signal period of the combined signal needs to be generated, a reading instruction is sent to a DMA controller;
the timer is used for triggering the DMA controller to read a signal point from the combined signal segment in the cache region and output the signal point according to the triggering frequency;
and the DMA controller is used for reading and outputting a signal point from the combined signal segment in the buffer area in sequence every time when the timer is triggered according to a mode of circularly outputting the combined signal segment in the buffer area so as to obtain the combined signal segment in a subsequent signal period of the combined signal.
10. A computer-readable storage medium storing computer instructions, which when executed by one or more processors, cause the one or more processors to perform acts comprising:
determining a signal with the same frequency as a required combined signal in at least two signals to be superposed as a basic signal;
adjusting the frequencies of other signals to be superposed by taking the frequency of the basic signal as a reference so as to align the other signals to be superposed with the basic signal;
performing signal superposition according to the basic signal and other signals to be superposed after frequency adjustment to obtain the combined signal;
the one or more processors, when adjusting the frequencies of other signals to be superimposed with reference to the frequency of the base signal to align the other signals to be superimposed with the base signal, are configured to:
calculating the frequency ratio of other signals to be superposed to the basic signal;
if the frequency ratio is a non-integer, determining an integer value based on the frequency ratio;
and taking the frequency ratio equal to the integer value as a target, and taking the frequency of the basic signal as a reference to adjust the frequencies of other signals to be superposed.
CN201810866620.1A 2018-08-01 2018-08-01 Signal generation method, equipment and storage medium Active CN109062321B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810866620.1A CN109062321B (en) 2018-08-01 2018-08-01 Signal generation method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810866620.1A CN109062321B (en) 2018-08-01 2018-08-01 Signal generation method, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109062321A CN109062321A (en) 2018-12-21
CN109062321B true CN109062321B (en) 2020-10-09

Family

ID=64832580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810866620.1A Active CN109062321B (en) 2018-08-01 2018-08-01 Signal generation method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109062321B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8751552B2 (en) * 2003-06-17 2014-06-10 The Pulse Perfect Corporation, Inc. System and method of generating complex waveforms
CN101796575B (en) * 2007-09-06 2012-07-18 富士通株式会社 Sound signal generating method, sound signal generating device
CN101989890B (en) * 2009-07-31 2013-04-24 华为技术有限公司 Method and device for superimposing coding
US8575973B1 (en) * 2012-05-25 2013-11-05 Smsc Holdings S.A.R.L. Frequency synthesizer with zero deterministic jitter
CN103929173B (en) * 2014-04-11 2016-08-24 华为技术有限公司 Frequency divider and Wireless Telecom Equipment
CN106506872B (en) * 2016-11-02 2019-05-24 腾讯科技(深圳)有限公司 Talking state detection method and device

Also Published As

Publication number Publication date
CN109062321A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
JP6859509B2 (en) Blockchain data processing method and equipment
KR102125177B1 (en) Blockchain-based data processing method and device
US9075507B2 (en) Silence reminder
CN113301075B (en) Flow control method, distributed system, device and storage medium
CN111475142B (en) Method, device and equipment for generating applet file package
CN110496395B (en) Component operation method, system and equipment for illusion engine
US9372716B1 (en) Download prioritization
CN109918038B (en) Audio playing speed synchronization method and system
CN112511874A (en) Game control method, smart television and storage medium
CN109063645B (en) Filtering method, filtering device and storage medium
CN109062321B (en) Signal generation method, equipment and storage medium
EP3425533A1 (en) Displaying page
CN110968377B (en) Interface display processing method and device
CN108769152B (en) Service refresh policy registration method, service refresh request method, device and equipment
CN110175450A (en) A kind of processing method of information, device and equipment
KR20180122137A (en) Method for giving dynamic effect to video and electronic device thereof
JP6054003B2 (en) Program execution system and resident program start method
KR20130054372A (en) Method and device for movement of image object
CN114661666A (en) Data searching method, device, equipment and storage medium
CN113301076B (en) Flow control method, distributed system, device and storage medium
CN113885969A (en) Embedded device, embedded software loading method and storage medium
CN110716759B (en) Electronic device, computer-readable storage medium, and operation parameter configuration method
CN106802782A (en) Wearable intelligent equipment, the control method of music and its system
CN107544766B (en) Data display method and device
CN111736895A (en) Method, equipment and storage medium for merging and upgrading version numbers of software products

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201014

Address after: 261031 north of Yuqing street, east of Dongming Road, high tech Zone, Weifang City, Shandong Province (Room 502, Geer electronic office building)

Patentee after: GoerTek Optical Technology Co.,Ltd.

Address before: 261031 No. 268 Dongfang Road, Weifang hi tech Industrial Development Zone, Shandong, Weifang

Patentee before: GOERTEK Inc.

TR01 Transfer of patent right