Disclosure of Invention
The problem that this application will be solved provides one kind not only to realize that square wave signal edge is faster, the shake is lower, the fine and adjustable of duty cycle when the low frequency, can also realize that square wave signal edge is faster, the shake is lower square wave signal generator when the high frequency.
The application provides a square wave signal generator, its characterized in that includes:
the DDS module comprises a fast edge pulse generator and a basic wave signal generator, wherein the fast edge pulse generator is used for generating a pulse wave signal with a fast edge according to waveform parameters, the basic wave signal generator is used for generating a basic wave signal according to the waveform parameters, and the waveform parameters at least comprise waveform frequency;
the waveform selection unit is used for selecting the signal generated by the fast edge pulse generator or the signal generated by the basic wave signal generator to be output as an initial waveform signal;
and a comparator, wherein the first input end of the comparator inputs the initial waveform signal output by the waveform selection unit, the second input end of the comparator inputs the reference level, the comparator compares the initial waveform signal with the reference level, and the output end of the comparator performs level inversion according to the comparison result so as to output the required square wave signal.
Preferably, in the square wave signal generator, the square wave signal generator further includes: and the control unit is connected with the waveform selection unit and controls the waveform selection unit to switch states according to the frequency value of the initial waveform signal so as to switch on the signal output end of the fast edge pulse generator or the signal output end of the basic wave signal generator.
Preferably, the control unit is further connected to the DDS module, and sends the waveform parameters to the DDS module, and the control unit further compares a waveform frequency in the waveform parameters with a preset frequency boundary value, and controls the waveform selection unit to switch on the signal output terminal of the fundamental wave signal generator when the waveform frequency is higher than the preset frequency, and controls the waveform selection unit to switch on the signal output terminal of the fast edge pulse generator when the waveform frequency is lower than the preset frequency.
Preferably, the waveform selection unit is a selection switch.
Preferably, the selection switch selects between the signal output of the fast edge pulse generator and the signal output of the fundamental wave signal generator by toggling, rotating or pressing.
Preferably, the comparator is a high speed comparator.
Preferably, the basic waveform signal includes a triangular wave, a sine wave, or a general pulse signal.
Preferably, the parameters include high level, low level, pulse width, frequency, delay time, rise time and fall time.
Preferably, in the square wave signal generator, the square wave signal generator further includes: the first filter is connected with a first output end of the DDS module and used for filtering fast edge pulse signals, and the second filter is connected with a second output end of the DDS module and used for filtering basic waveform signals.
Preferably, in the square wave signal generator, the square wave signal generator further includes: and one section of the adjusting unit is connected with the control unit, the other end of the adjusting unit is connected with the comparator, and the adjusting unit is used for adjusting and correcting the parameters in the process of level comparison and shaping through the comparator.
The beneficial effect of this application is: the square wave signal generator selects different initial signals as initial waveforms at low frequency and high frequency respectively, wherein a fast edge pulse signal is selected at the low frequency, a basic waveform signal is selected at the high frequency, and then the low frequency square wave with faster edge, lower jitter and fine and adjustable duty ratio is obtained after level comparison and shaping are carried out by the comparator circuit, and the high frequency square wave with faster edge and lower jitter is obtained, so that the advantages of the fast edge pulse signal and the comparator circuit are achieved.
Detailed Description
The present application will be described in further detail below with reference to the accompanying drawings by way of specific embodiments.
As shown in fig. 1, the present application provides a square wave signal generator 1, which includes an input device 11, a DDS module 2, a control unit 3, a waveform selection unit 41, an adjustment unit 51, and a comparator 52. The input device 11 is connected with the control unit 3, the DDS module 2 is connected with the waveform selection unit 41, the waveform selection unit 41 is further connected with the comparator 52, and the control unit 3 is connected with the input device 11, the DDS module 2, the waveform selection unit 41 and the adjustment unit 51. Wherein,
the input device 11 is connected to the control unit 3 and configured to receive a parameter of a square wave signal required by a user input, and the parameter is converted into a waveform parameter after being processed by the control unit 3.
The first output end and the second output end of the DDS module 2 are respectively connected to the first input end and the second input end of the waveform selection unit 41, and include a fast edge pulse generator and a fundamental wave signal generator, where the fast edge pulse generator is configured to generate a pulse signal with a fast edge according to a waveform parameter, the fundamental wave signal generator is configured to generate a fundamental waveform signal according to a waveform parameter, the waveform parameter may be converted from a parameter input by a user and received by an input device, or may be waveform parameter data stored in the memory 31 of the square wave signal generator 1, and the waveform parameter at least includes a frequency. The pulse signal is a fast edge pulse signal disclosed in patent document CN103178809A, and the basic waveform signal includes a triangular wave, a sine wave or a general pulse signal. Although the fast edge pulse cannot be used as an initial waveform signal with a high frequency due to the frequency limitation and the edge is limited by the DDS sampling rate, the fast edge pulse signal is used as an initial waveform signal with a low frequency, has the characteristics of fast edge and large pulse width regulation range, and can realize the characteristics that the required square wave signal has a fine duty ratio and a fast edge. For high frequency initial waveform signals, considering that the DDS reconstruction filter has a large suppression effect on high frequency harmonic components, in a specific embodiment, a single-tone sinusoidal signal is preferably selected as the initial signal of the high frequency band.
In some embodiments, to facilitate storing data, the square wave signal generator 1 further comprises a memory 31, and the memory 31 is connected to the DDS module 3, the control unit 3, and the waveform selection unit 41, and is used for storing data, including fast edge pulse signal data, basic waveform signal data, or waveform parameter data.
In some embodiments, after the initial waveform signal is generated, in order to filter noise, distortion and clutter during the transmission of the waveform signal, the square wave signal generator 1 further includes a first filter 21 and a second filter 22, where the first filter 21 is connected to the first output terminal of the DDS module 2 for filtering the fast edge pulse signal, and the second filter 22 is connected to the second output terminal of the DDS module 2 for filtering the basic waveform signal.
The waveform selection unit 41 is connected to the comparator 52, is a selection switch, selects the signal of the fast edge pulse generator and the signal of the fundamental wave signal generator as an initial waveform signal, and outputs the initial waveform signal to the comparator 52. When the frequency value is a low frequency, the waveform selection unit 41 switches on the signal output end of the fast edge pulse generator, and selects the fast edge pulse signal as an initial waveform signal; when the frequency value is high frequency, the waveform selection unit 41 turns on the signal output terminal of the fundamental wave signal generator, and selects the fundamental waveform signal as the initial waveform signal.
In some embodiments, the waveform selection unit 41 can select between the signal output of the fast edge pulse generator and the signal output of the fundamental wave signal generator by toggling, rotating or pressing in. In some embodiments, the waveform selection unit 41 can also switch the circuit on and off by current or voltage driving, and select between the signal output terminal of the fast edge pulse generator and the signal output terminal of the fundamental wave signal generator.
The control unit 2 is connected with the waveform selection unit 41, and the control unit 2 controls the waveform selection unit 41 to switch states according to the initial waveform signal frequency value so as to switch on a signal output end of the fast edge pulse generator or a signal output end of the fundamental wave signal generator. When the frequency value is a low frequency, the waveform selection unit 41 is controlled to switch the state to connect the signal output end of the fast edge pulse generator, and the fast edge pulse signal is selected as an initial waveform signal; when the frequency value is high frequency, the waveform selection unit 41 is controlled to switch the state to turn on the signal output terminal of the fundamental wave signal generator, and the fundamental waveform signal is selected as the initial waveform signal.
The control unit 2 is further connected to the DDS module 2, and sends the waveform parameters to the DDS module 2, and the control unit 2 further compares the waveform frequency in the waveform parameters with a frequency boundary value, which can be obtained by presetting or calculation analysis by the control unit 2. When the frequency value of the initial waveform signal is smaller than the frequency boundary value, the control unit 2 controls the waveform selection unit 41 to switch on the signal output end of the fast edge pulse generator, and selects the fast edge pulse signal as the initial waveform signal; when the frequency value of the initial waveform signal is larger than the frequency boundary value, the control unit 2 controls the waveform selection unit 41 to turn on the signal output terminal of the basic waveform signal generator, selecting the basic waveform signal as the initial waveform signal.
The initial waveform signal outputted from the waveform selection unit is inputted to a first input terminal of the comparator 52, the reference level is inputted to a second input terminal, the initial waveform signal is compared with the reference level by the comparator, and the waveform is shaped by level inversion at an output terminal thereof according to the comparison result, thereby outputting a desired square wave signal. It should be noted that, as described in the background art, a comparator circuit built with discrete components is used to perform level comparison and shaping on a basic waveform signal generated by the DDS to obtain a square wave signal, which has the disadvantages of large jitter and unstable trigger position. This is because the waveform signal inevitably undergoes an offset, i.e., the jitter, between its edge and an ideal position at the time of level transition between high and low levels. As shown in fig. 3, the slope relationship corresponding to the intersection point of the trigger edge and the same level is triangle wave 101< sine wave 102< fast edge pulse 103, which directly causes the square wave signal output by the comparator to be affected differently by the offset of the comparison level, specifically, the difference in jitter performance. As shown in fig. 4, the offset of the square wave signal output by the comparator is different between the triangular wave, the sine wave and the fast edge pulse, and the jitter is triangular wave 101> sine wave 102> fast edge pulse 103. The comparator 52 is a high-speed comparator, and performs level comparison and shaping on the initial waveform signal in a manner of high conversion rate and as small as possible transmission delay time (nanosecond level), so that both the output low-frequency square wave and the output high-frequency square wave have the characteristic of lower jitter; meanwhile, the rising time and the falling time are fixed at a very small nominal value (picosecond level), the change of the waveform signal edge is accelerated, a high-frequency signal with a faster edge is obtained, the edge index of a square wave signal under a low sampling rate is improved, the problem that the fast-edge pulse signal edge is limited by the DDS sampling rate is solved, and a low-frequency signal with a faster edge is obtained.
In some embodiments, in the level comparison of the initial waveform signal, in order to make the output square wave edge faster, jitter lower and duty ratio fine and adjustable, the square wave signal generator 1 further includes an adjusting unit 51, one section of the adjusting unit 51 is connected to the control unit 3, and the other end is connected to the comparator 52, and is used for adjusting and modifying waveform parameters including high level, low level, pulse width, frequency, delay time, rise time and fall time during the level comparison and shaping of the initial waveform signal by the comparator 52.
As shown in fig. 2, the square wave signal generator 1 can input parameters including at least frequency according to the user's requirement and output the required square wave signal. The square wave signal generator 1 selects different initial signals as initial waveforms at low frequency and high frequency respectively, wherein a fast edge pulse signal is selected at the low frequency, a basic waveform signal is selected at the high frequency, and then a comparator circuit is used for level comparison and shaping to obtain a low-frequency square wave with faster edge, lower jitter, fine and adjustable duty ratio and a high-frequency square wave with faster edge and lower jitter, so that the advantages of the fast edge pulse signal and the comparator circuit are combined, the advantages of two traditional methods in the background art are fully absorbed, and the defects of the two traditional methods are overcome.
Based on the square wave signal generator 1, as shown in fig. 5, a process for generating a DDS square wave signal provided by the present application includes the following steps:
and inputting parameters. Waveform parameters of the desired square wave signal are input by a user, the waveform parameters including at least frequency.
An initial waveform is generated. And generating an initial waveform signal according to the parameters input by the user, wherein the initial waveform signal comprises a fast edge pulse signal and a basic waveform signal. The fast edge pulse signal is a fast edge pulse signal disclosed in patent document CN103178809A, and the basic waveform signal includes a triangular wave, a sine wave, or a general pulse signal.
In some embodiments, after the initial waveform signal is generated, the waveform signal is further filtered to filter noise, distortion and clutter in the transmission process of the waveform signal.
An initial waveform is selected. Selecting an initial waveform signal according to the magnitude of the waveform signal frequency value, wherein when the frequency value is low frequency, a fast edge pulse signal is selected as the initial waveform signal; when the frequency value is a high frequency, the basic waveform signal is selected as the initial waveform signal.
In one embodiment, a frequency boundary value is analyzed by presetting or calculation, and when the frequency value of the initial waveform signal is smaller than the frequency boundary value, the fast edge pulse signal is selected as the initial waveform signal; when the frequency value of the initial waveform signal is greater than the frequency boundary value, a single-tone sinusoidal signal is selected as the initial waveform signal.
In some embodiments, the waveform data is stored separately for later selection before the base waveform signal is selected.
Outputting square waves. And comparing the selected initial waveform signal with a reference level, performing level inversion according to a comparison result to shape the waveform, and outputting a required square wave signal. In the level comparison and shaping process, a mode of high conversion rate and transmission delay time (nanosecond level) as small as possible is adopted, so that the output low-frequency square wave and high-frequency square wave have the characteristic of lower jitter; meanwhile, the rising time and the falling time are fixed at a very small nominal value (picosecond level), the change of the waveform signal edge is accelerated, a high-frequency signal with a faster edge is obtained, the edge index of a square wave signal under a low sampling rate is improved, the problem that the fast-edge pulse signal edge is limited by the DDS sampling rate is solved, and a low-frequency signal with a faster edge can be obtained.
In some embodiments, during the initial waveform signal level comparison and shaping process, parameters including high level, low level, pulse width, frequency, delay time, rise time and fall time are also adjusted and modified, so that the output square wave has faster edge, lower jitter and fine and adjustable duty ratio.
According to the square wave signal generation process, parameters can be input according to user requirements, and the required square wave signal can be output. Different initial signals are respectively selected as initial waveforms at low frequency and high frequency, wherein a fast edge pulse signal is selected at the low frequency, a basic waveform signal is selected at the high frequency, and then a comparator circuit is used for carrying out level comparison and shaping to obtain a low-frequency square wave with faster edge, lower jitter and finely adjustable duty ratio, and a high-frequency square wave with faster edge and lower jitter, so that the advantages of the fast edge pulse signal and the comparator circuit are combined, the advantages of two traditional methods in the background art are fully absorbed, and the defects of the two traditional methods are overcome.
The foregoing is a more detailed description of the present application in connection with specific embodiments thereof, and it is not intended that the present application be limited to the specific embodiments thereof. It will be apparent to those skilled in the art from this disclosure that many more simple derivations or substitutions can be made without departing from the inventive concepts herein.