A kind of DDS signal generator and waveshape memory depth control method thereof
Technical field
The present invention relates to the signal generator technology, being particularly related to the control to Direct Digital frequency synthesis (DDS:DirectDigital Frequency Synthesis) signal generator waveform storage depth, is a kind of DDS signal generator and waveshape memory depth control method thereof concretely.
Background technology
As shown in Figure 1, the overall architecture of DDS signal generator generally comprises man-machine interface, wave memorizer, frequency synthesis unit, Waveform Control unit and analogue unit.Wave memorizer is being deposited the sampled point in the wave period; The frequency synthesis unit produces different waveform phase change points according to frequency configuration, and extracts the sampled point amplitude of respective phase from wave memorizer; The amplitude of waveform is then being controlled in the Waveform Control unit, correlation parameters such as skew; Analogue unit is sampled point to be reconstituted simulating signal export.
But in fact not all waveform all needs to take whole waveform storage spaces just can reconstruct satisfactory waveform.And for random waveform, the inside waveform storage space that the DDS signal generator provides for the user is the waveform storage space of regular length, the random waveform that is less than this length for the waveform sampling point also has to take a storage space, and this wastes very much.And can't be stored in the storage space for the random waveform greater than this length, this can't satisfy the requirement of different length random waveform storage just because of utilizing remaining storage space to cause the huge waste of storage space.
Summary of the invention
The invention provides a kind of DDS signal generator and waveshape memory depth control method thereof, be used for quantity according to the random waveform sampled point, reconstruct a kind of storage depth controlling mechanism that neither makes waveform distortion can make full use of storage space again, not only can satisfy the requirement of depositing more shortwave shapes but also can satisfy the requirement of depositing long wave shape.
In order to realize above-mentioned goal of the invention, one of purpose of the present invention is, a kind of DDS signal generator waveshape memory depth control method is provided, said method comprising the steps of: according to Wave data length the waveform storage space degree of depth is set, and Wave data is deposited in the waveform storage space of respective depth; A Wave data in the described waveform storage space is carried out exterior storage in certain sequence; Obtain the Wave data length of exterior storage; According to add up out the phase bit address of next waveform data points of the initial waveform data points phase bit address of the Wave data of exterior storage; According to described Wave data length, with described phase place map addresses to the Wave data address of exterior storage; Wave data structure waveform output after digital-to-analog conversion is handled with exterior storage.
The described Wave data length of obtaining exterior storage comprises: judge whether the waveform request of reading read Wave data has surpassed the corresponding waveform storage space degree of depth, if then rollback reads waveform data points to the reference position of exterior storage.
Another object of the present invention is to, a kind of DDS signal generator is provided, comprising: control device, wave memorizer, waveform processing device, analogue unit, human-computer interface device and display device; Described control device is connected with display device with described waveform processing device, human-computer interface device respectively, and described waveform processing device is connected with analogue unit; Described DDS signal generator also comprises: the storage depth control module, be connected with described control device, and be used for controlling the Wave data of described waveform memory stores respective length according to the storage space degree of depth of human-computer interface device setting; External memory storage is connected with described waveform processing device, is used for a Wave data of wave memorizer is stored in certain sequence; Wave data length control module is used to obtain the phase bit address of the waveform data points of external memory storage, and according to described Wave data length, with described phase place map addresses to the Wave data address of external memory storage; Described analogue unit is used to receive the Wave data that external memory storage transmits, and the Wave data that receives is carried out digital-to-analog conversion handle back structure waveform output.
Described waveform processing device comprises: the frequency synthesis unit is used for sending to read the waveform request and read Wave data to described external memory storage sending described analogue unit to; Described Wave data length control module, intercepting frequency synthesis unit is to the waveform request of reading of external memory storage, judge whether the Wave data length read the waveform request has surpassed corresponding storage depth, if then rollback reads waveform data points to the reference position of external memory storage; If otherwise with the phase mapping of frequency synthesis unit to the Wave data address of external memory storage.
Described frequency synthesis unit comprises: phase accumulator is used for add up out the phase bit address of next waveform data points of initial waveform data points phase bit address according to the Wave data of external memory storage.
Described control device is DSP, is integrated with described storage depth control module in described DSP.Described waveform processing device is FPGA, and described FPGA is integrated with frequency synthesis unit, Wave data length control module.
Described human-computer interface device is keyboard, touch-screen, mouse or communication interface.
Described display device is LCD or plasma display.
Described wave memorizer is FLASH, and described external memory storage is SRAM.
Beneficial effect of the present invention is, by a kind of DDS signal generator and waveshape memory depth control method thereof are provided, reappear the requirement of wave-shape amplitude details for needs, signal generator can be deposited all waveforms with whole storage spaces, because the data point number is many more in DDS, phase accumulator just can obtain phase amplitude value more accurately, reduces phase noise.The amplitude that allows signal generator reappear each sampled point subtly, overall reproduced wave-shape amplitude feature.
For the requirement of needs reproduction waveform frequency characteristic and basic amplitude, signal generator needs less sampled point, and the storage space that occupies seldom utilizes the advantageous characteristic of DDS just can reproduce waveform basic amplitude feature very quickly.
Description of drawings
Fig. 1 is the structured flowchart of DDS signal generator in the prior art;
Fig. 2 is the inventive method process flow diagram;
Fig. 3 is the structured flowchart of embodiments of the invention 1;
Fig. 4 is the structured flowchart of the DDS signal generator of the embodiment of the invention 2.
Embodiment
Below in conjunction with description of drawings the specific embodiment of the present invention.
Embodiment 1
The invention provides a kind of DDS signal generator waveshape memory depth control method, as shown in Figure 2, a variable-length control module is set in common DDS signal generator, this variable-length control module is between the frequency synthesis unit and wave memorizer of common DDS signal generator, is used for the access control of controlled frequency synthesis unit to wave memorizer.
At first, the waveform degree of depth is by passing under the man-machine interface in the storage depth control module, storage control unit intercepting frequency synthesis unit has surpassed the storage depth that is provided with to the request of reading of wave memorizer in case find the waveform request, reads data point with regard to rollback to the beginning of wave memorizer.Concrete steps wherein are (as shown in Figure 3): according to Wave data length the waveform storage space degree of depth is set, and Wave data is deposited in the waveform storage space of respective depth; A Wave data in the described waveform storage space is carried out exterior storage in certain sequence; Obtain the Wave data length of exterior storage; According to add up out the phase bit address of next waveform data points of the initial waveform data points phase bit address of the Wave data of exterior storage; According to described Wave data length, with described phase place map addresses to the Wave data address of exterior storage; Wave data structure waveform output after digital-to-analog conversion is handled with exterior storage.
The described Wave data length of obtaining exterior storage comprises: judge whether the waveform request of reading read Wave data has surpassed the corresponding waveform storage space degree of depth, if then rollback reads waveform data points to the reference position of exterior storage.If otherwise with the phase mapping of frequency synthesis unit to the Wave data address of external memory storage.
Embodiment 2
The invention provides a kind of DDS signal generator.As shown in Figure 4, adopting digital signal processing (DSP) chip is control device, adopting flash memory (FLASH) is wave memorizer, adopting field programmable gate array (FPGA) is the waveform processing device, analogue unit still adopts the digital-to-analog conversion and the simulation part of common DDS signal generator, and adopting keyboard is that human-computer interface device and LCD (LCD) are display device; DSP is connected with FPGA, keyboard and LCD respectively, and FPGA is connected with analogue unit.
Be integrated with a storage depth control module in DSP, the storage space degree of depth control FLASH that is used for being provided with according to keyboard stores the Wave data of respective length;
Employing SRAM is an external memory storage, and SRAM is connected with FPGA, is used for the Wave data of FLASH is stored in certain sequence;
In FPGA, also be integrated with a Wave data length control module, be used to obtain the phase bit address of the waveform data points of SRAM, and according to described Wave data length, with described phase place map addresses to the Wave data address of SRAM;
Described analogue unit is used to receive the Wave data that SRAM transmits, and the Wave data that receives is carried out digital-to-analog conversion handle back structure waveform output.
Also be integrated with the frequency synthesis unit among the FPGA, be used for sending to read the waveform request and read Wave data sending described analogue unit to described external memory storage; Described Wave data length control module, intercepting frequency synthesis unit is to the waveform request of reading of external memory storage, judge whether the Wave data length read the waveform request has surpassed corresponding storage depth, if then rollback reads waveform data points to the reference position of external memory storage; If otherwise with the phase mapping of frequency synthesis unit to the Wave data address of external memory storage.
Described frequency synthesis unit comprises: phase accumulator is used for add up out the phase bit address of next waveform data points of initial waveform data points phase bit address according to the Wave data of external memory storage.
A Wave data length control module integrated among the FPGA is an important component part of DDS signal generator of the present invention, and it is between frequency synthesis unit and the wave memorizer, is controlling the access control of frequency synthesis unit to wave memorizer.At first, the waveform degree of depth is by passing under the man-machine interface in the storage depth control module, storage control unit intercepting frequency synthesis unit has surpassed the storage depth that is provided with to the request of reading of wave memorizer in case find the waveform request, reads data point with regard to rollback to the beginning of wave memorizer.
The variable scheme of embodiment 2 also comprises: human-computer interface device can be keyboard, touch-screen, mouse or communication interface or its combination.Display device can be plasma display.
In DDS signal generator of the present invention, be the boundary with the wave memorizer capacity, the stored waveform size in the waveform storage unit can be a random length.Periodically strong for some like this, the simple waveform of spectral characteristic can be deposited less sampling point just can recover original waveform by frequency synthesis (DDS) mode.When can shortening the man-machine interface switching waveform, few waveform storage arrives the stand-by period between the actual output complete waveform.Especially signal generator, its numerical portion often and between the simulation part branch is isolated, and in order to reduce the quantity of communication line between two parts, takes the serial mode interaction data usually, Duan waveform will inevitably shorten the time that Wave data transmits widely like this, improves system response time.
Random waveform flexibly prestores.Random waveform is edited and deposited to an important application of signal generator exactly, and the random waveform storage space that system provided (non-waveform storage space) is very limited, can only deposit the waveform of several regular lengths.And the length of the random waveform that the user provides in the practical application is very limited: much smaller than this regular length; Perhaps the length of random waveform is very long: greater than this regular length.Both of these case is for common signal generator, or wasted storage space, or can't store so big waveform.And this storage depth control module just can solve this problem at an easy rate, to small form can deposit more, for big waveform also deposit following.
Reappear the requirement of wave-shape amplitude details for needs, signal generator can be deposited all waveforms with whole storage spaces, because the data point number is many more in DDS, phase accumulator just can obtain phase amplitude value more accurately, reduces phase noise.The amplitude that allows signal generator reappear each sampled point subtly, overall reproduced wave-shape amplitude feature.
For the requirement of needs reproduction waveform frequency characteristic and basic amplitude, signal generator needs less sampled point, and the storage space that occupies seldom utilizes the advantageous characteristic of DDS just can reproduce waveform basic amplitude feature very quickly.
Above embodiment only is used to illustrate the present invention, but not is used to limit the present invention.