Disclosure of Invention
The problem to be solved by the application is to provide the square wave signal generator which not only can realize faster square wave signal edges, lower jitter and fine and adjustable duty ratio at low frequency, but also can realize faster square wave signal edges and lower jitter at 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, and 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;
a waveform selection unit for selecting a signal generated by the fast-edge pulse generator or a signal generated by the basic wave signal generator as an initial waveform signal to be output;
and the first input end of the comparator is input with the initial waveform signal output by the waveform selection unit, the second input end of the comparator is input with 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: the control unit is connected with the waveform selection unit and controls the waveform selection unit to switch the state 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 with the DDS module and sends the waveform parameters to the DDS module, the control unit further compares the waveform frequency in the waveform parameters with a preset frequency boundary value, when the waveform frequency is higher than the preset frequency, the control unit controls the waveform selection unit to be connected with the signal output end of the basic wave signal generator, and when the waveform frequency is lower than the preset frequency, the control unit controls the waveform selection unit to be connected with the signal output end of the fast-edge pulse generator.
Preferably, the waveform selection unit is a selection switch.
Preferably, the selection switch selects between the signal output terminal of the fast-edge pulse generator and the signal output terminal of the basic 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 normal 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 the first output end of the DDS module and used for filtering the fast-edge pulse signals, and the second filter is connected with the second output end of the DDS module and used for filtering the 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, and the other end of the adjusting unit is connected with the comparator and is used for adjusting and correcting the parameters in the process of level comparison and shaping through the comparator.
The beneficial effects of this application are: the square wave signal generator selects different initial signals as initial waveforms respectively at low frequency and high frequency, wherein a fast-edge pulse signal is selected at low frequency, a basic waveform signal is selected at high frequency, and after level comparison and shaping are performed through a comparator circuit, a low-frequency square wave with faster edge, lower jitter and fine and adjustable duty ratio is obtained, and a high-frequency square wave with faster edge and lower jitter is obtained, so that the square wave generator has the advantages of the fast-edge pulse signal and the comparator circuit.
Detailed Description
The present application is described in further detail below with reference to the accompanying drawings by way of specific embodiments.
As shown in fig. 1, the square wave signal generator 1 provided by the present application 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 also 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 for receiving parameters of the user input desired waveform signals, which parameters are converted into waveform parameters 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 with the first input end and the second input end of the waveform selection unit 41, and 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 signal with a fast edge according to waveform parameters, the basic wave signal generator is used for generating a basic waveform signal according to the waveform parameters, the waveform parameters can be converted from parameters input by a user and received by input equipment, and the waveform parameters can also be waveform parameter data stored in the memory 31 of the square wave signal generator 1, and the waveform parameters at least comprise frequencies. The pulse signal is a fast-edge pulse signal disclosed in a patent document with a publication number of CN103178809A, and the basic waveform signal comprises a triangular wave, a sine wave or a common pulse signal. Although the fast-edge pulse can not be used as an initial waveform signal of 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 of low frequency, has the characteristics of fast edge and large pulse width adjustment range, and can realize the characteristics of fine duty ratio and fast edge of a required square wave signal. For the high frequency initial waveform signal, in view of the fact that the DDS reconstruction filter has a large suppression effect on the high frequency harmonic components, in a specific embodiment, a single-tone sinusoidal signal is preferably selected as the high frequency band initial signal.
In some embodiments, to facilitate storing data, the square wave signal generator 1 may further include a memory 31, where the memory 31 is connected to the DDS module 3, the control unit 3, and the waveform selection unit 41, and is configured to store 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 in the transmission process 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 selecting unit 41 is connected to the comparator 52, is a selecting switch, selects between the signal of the fast-edge pulse generator and the signal of the basic wave signal generator as an initial waveform signal to be output, and transmits the initial waveform signal to the comparator 52. When the frequency value is low frequency, the waveform selection unit 41 turns 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 basic waveform signal generator, selecting the basic waveform signal as the initial waveform signal.
In some embodiments, the waveform selection unit 41 may 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 may also be configured to switch on and off the circuit 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 basic 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 perform state switching 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. When the frequency value is low frequency, the control waveform selection unit 41 performs state switching to connect 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 control waveform selection unit 41 performs state switching to turn on the signal output terminal of the basic waveform signal generator, and selects the basic waveform signal as the initial waveform signal.
The control unit 2 is further connected with the DDS module 2, and sends the waveform parameters to the DDS module 2, and the control unit 2 also compares the waveform frequency in the waveform parameters with a frequency boundary value, wherein the frequency boundary value can be obtained through the preset or calculation analysis of 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 greater 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 comparator 52 has a first input terminal to which the initial waveform signal outputted from the waveform selection unit is inputted, a second input terminal to which the reference level is inputted, compares the initial waveform signal with the reference level, and an output terminal to perform level inversion to shape the waveform according to the comparison result, thereby outputting a desired square wave signal. It should be noted that, as described in the background art, the comparator circuit built by using discrete components is used to perform level comparison and shaping on the basic waveform signal generated by the DDS to obtain a square wave signal, which has the disadvantages of large jitter and unstable triggering position. This is because the waveform signal inevitably generates an offset, i.e., the jitter, between its edges and ideal positions at the time of level transition of high and low levels. As shown in fig. 3, since the slope relationship corresponding to the intersection of the trigger edge and the same level is that the triangular wave 101< sine wave 102< fast edge pulse 103, the square wave signal output by the comparator is directly affected by the comparison level shift, which is specifically a difference in jitter performance. As shown in fig. 4, the offset of the square wave signal output by the comparator is different from the triangular wave, the sine wave and the fast edge pulse, and the jitter is the triangular wave 101> the sine wave 102> the 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 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 edge change of the waveform signal is quickened, the high-frequency signal with quicker edge is obtained, the edge index of the square wave signal under the low sampling rate is improved, the problem that the edge of the fast-edge pulse signal is limited by the DDS sampling rate is solved, and the low-frequency signal with quicker edge is obtained.
In some embodiments, in order to make the square wave edge of output faster, jitter lower and duty ratio fine adjustable in the initial waveform signal level comparison, the square wave signal generator 1 further comprises an adjusting unit 51, one section of the adjusting unit 51 is connected with the control unit 3, and the other section of the adjusting unit 51 is connected with the comparator 52, and waveform parameters including high level, low level, pulse width, frequency, delay time, rising time and falling time are adjusted and corrected in the process of level comparison and shaping of the initial waveform signal through the comparator 52.
As shown in fig. 2, the square wave signal generator 1 can input parameters including at least frequency according to user's requirements, and output the required square wave signal. The square wave signal generator 1 selects different initial signals as initial waveforms respectively at low frequency and high frequency, wherein a fast-edge pulse signal is selected at low frequency, a basic waveform signal is selected at high frequency, and then a low-frequency square wave with quicker edge, lower jitter and fine adjustable duty ratio is obtained after level comparison and shaping are performed by a comparator circuit, so that a high-frequency square wave with quicker edge and lower jitter is obtained, the advantages of the fast-edge pulse signal and the comparator circuit are achieved, the advantages of the two traditional methods in the background art are fully absorbed, and the defects of the two traditional methods are overcome.
Based on the above square wave signal generator 1, as shown in fig. 5, a process for generating a DDS square wave signal is provided herein, which includes the following steps:
parameters are input. Waveform parameters of the desired square wave signal are input by the user, said waveform parameters comprising 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 a patent document with a publication number of CN103178809A, and the basic waveform signal comprises a triangular wave, a sine wave or a common pulse signal.
In some embodiments, after the initial waveform signal is generated, the waveform signal is further filtered to remove 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 frequency value of the waveform signal, wherein the initial waveform signal comprises the steps of selecting a fast-edge pulse signal as the initial waveform signal when the frequency value is low; when the frequency value is high frequency, a basic waveform signal is selected as an initial waveform signal.
In a specific embodiment, a frequency boundary value is preset or calculated and analyzed, 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 subsequent selection prior to selection of the base waveform signal.
Outputting square waves. And comparing the selected initial waveform signal with a reference level, performing level inversion according to a comparison result, shaping the waveform, and outputting a required square wave signal. In the level comparison and shaping process, a mode of high conversion rate and as small as possible transmission delay time (nanosecond level) 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 edge change of the waveform signal is quickened, the high-frequency signal with quicker edge is obtained, the edge index of the square wave signal under the low sampling rate is improved, the problem that the edge of the fast-edge pulse signal is limited by the DDS sampling rate is solved, and the low-frequency signal with quicker edge can be obtained.
In some embodiments, parameters including high level, low level, pulse width, frequency, delay time, rise time and fall time are also adjusted and modified during the initial waveform signal level comparison and shaping process, so that the square wave edges of the output are faster, jitter is lower, and the duty cycle is fine-tunable.
According to the square wave signal generating process, parameters can be input according to the requirements of users, and the required square wave signal can be output. Different initial signals are selected as initial waveforms respectively at low frequency and high frequency, wherein a fast-edge pulse signal is selected at low frequency, a basic waveform signal is selected at high frequency, and a comparator circuit is used for level comparison and shaping to obtain a low-frequency square wave with quicker edge, lower jitter and fine adjustable duty ratio, thereby obtaining a high-frequency square wave with quicker edge and lower jitter.
The foregoing is a further detailed description of the present application in connection with the specific embodiments, and it is not intended that the practice of the present application be limited to such descriptions. It will be apparent to those skilled in the art from this disclosure that several simple deductions or substitutions can be made without departing from the inventive concepts of the present application.