The full digital digital controlled oscillator
Technical field
The invention belongs to wireless communication field, especially a kind of NCO(digital controlled oscillator) method that design realizes, be suitable for the field programmable gate array at FPGA() in realization.
Background technology
The designing technique of digital controlled oscillator is key technology and the difficult point in the radio communication.Being one of main factor that determines the communication transceiver performance, also is more complicated.For designing technique and the method for NCO, in " principle of Software Radio and the application " of author Yang Xiaoniu, p123-126 has detailed theory explanation.But the method for designing in the document is only theoretical feasible, or is applied to the occasion not high to performance requirement.If very high to performance requirement, such as frequency accuracy, orthogonality and frequency purity are had very high requirement, then this method for designing is also impracticable, be that mainly the storage resources that takies is too many, and General N CO uses the mode of hardware at the FPGA(field programmable gate array) realize in the chip, present main flow FPGA(field programmable gate array) storage resources all is very limited, therefore this method for designing is quite unpractical, the present invention is directed to high-performance and take many these contradictions of storage resources, proposed a kind of solution.
Summary of the invention
The objective of the invention is to expend for design high-performance NCO in FPGA the problem of a large amount of storage resources, proposed a kind of full digital digital controlled oscillator.
Technical scheme of the present invention is:
A kind of full digital digital controlled oscillator, it comprises accumulator, adder, quantization modules and look-up table means, the method for building up of described look-up table means is as follows:
Step 1, thick, the thin two-stage list structure of setting adopt following formula to determine the figure place of the address of rough grade table and thin accuracy table;
Na+Nb=N (1)
F=2^Nb+2^(Na-2)
Ask the minimum of F, determine Na and Nb, wherein Na represents the figure place of rough grade table address, and Nb represents the figure place of thin accuracy table address, and N represents that quantization modules quantizes figure place afterwards, and F is the metric function to required hardware store resource; If have two groups of Na, Nb value all to satisfy the minimizing condition of F, then choose Na greater than this group result of Nb;
Step 2, employing rough grade table and thin accuracy table replace individual list structure, set up look-up table means;
cos(A+B)=cosAcosB-sinAsinB
cos(A+B)+jsin(A+B)=(cosAcosB-sinAsinB)+j(sinAcosB+sinBcosA)=(cosA+jsinA)×(cosB+jsinB)
(2)
Wherein A is angle corresponding to rough grade table institute storage function value, and B is angle corresponding to thin accuracy table institute's storage function value.
Also comprise after the step 2 of the present invention: judge according to formula 3 whether thin accuracy table structure can be omitted,
sin A
0-A
0<=1/2
K (3)
Wherein, θ
AThe angular resolution of expression rough grade table, K is the wave-shape amplitude word length;
When formula 3 is set up, thin accuracy table can omit, the size that then increases thin accuracy table namely increases Nb, substitution formula 3, judge further whether thin accuracy table structure can be omitted, until determine the just value of omissible Na and Nb of thin accuracy table structure, namely until formula 3 is false, gets previous step and make Na that formula 3 sets up and Nb as the thin accuracy table structure critical value of omissible Na and Nb just;
When formula 3 was false, thin accuracy table cannot omit, and then increases the value of Na, and substitution formula 3 judges further whether thin accuracy table structure can be omitted, and as still not omitting, then thin accuracy table can not omit really, and the value of described Na increases by 2 at most.
Among the present invention, for thin accuracy table structure, when the rough grade table size satisfies formula 3, further omit thin accuracy table with following formula:
sinB≈B (4)
Here θ
BThe angular resolution that represents thin accuracy table.
Among the present invention, to the rough grade table, according to formula (5)-(11), further reduce table size, and adopt a cosine table to replace two thick, thin accuracy tables, namely utilize the cosine function of first quartile to obtain one two three four-quadrant sin cos functionses;
The cycle of trigonometric function is 2 π, in its one-period waveform fully can by [0, pi/2) waveform in the phase place represented, get θ ∈ [0, pi/2), then
cos(θ+π/2)=-sin(θ)=-cos(π/2-θ) (5)
cos(θ+π)=-cos(θ) (6)
cos(θ+3π/2)=sin(θ)=cos(π/2-θ) (7)
sin(θ)=cos(π/2-θ) (8)
sin(θ+π/2)=cos(θ) (9)
sin(θ+π)=-sin(θ)=-cos(π/2-θ) (10)
sin(θ+3π/2)=-cos(θ)
(11)。
Beneficial effect of the present invention:
The invention solves traditional DDS(Direct Digital frequency synthesis) needed a large amount of storage resources when designing high-performance NCO, to be reduced to a small amount of numerical computations to the demand of a large amount of storage resources, be applicable to this class of FPGA to storage resources the not too responsive chip of few and logarithm value.
Description of drawings
Fig. 1 is based on the NCO design structure diagram of DDS.
Fig. 2 is structural representation of the present invention.
Fig. 3 is the structure after thin accuracy table of the present invention omits.
Fig. 4 is thickness accuracy table structure of the present invention structure after treatment.
Embodiment
The present invention is further illustrated below in conjunction with drawings and Examples.
As shown in Figure 1, a kind of full digital digital controlled oscillator, it comprises accumulator, adder, quantization modules and look-up table means, the method for building up of described look-up table means is as follows:
Step 1, thick, the thin two-stage list structure of setting adopt following formula to determine the figure place of the address of rough grade table and thin accuracy table;
Na+Nb=N (1)
F=2^Nb+2^(Na-2)
Ask the minimum of F, determine Na and Nb, wherein Na represents the figure place of rough grade table address, and Nb represents the figure place of thin accuracy table address, and N represents that quantization modules quantizes figure place afterwards, and F is the metric function to required hardware store resource; If have two groups of Na, Nb value all to satisfy the minimizing condition of F, then choose Na greater than this group result of Nb;
Step 2, employing rough grade table and thin accuracy table replace individual list structure, set up look-up table means;
cos(A+B)=cosAcosB-sinAsinB
cos(A+B)+jsin(A+B)=(cosAcosB-sinAsinB)+j(sinAcosB+sinBcosA)=(cosA+jsinA)×(cosB+jsinB)
(2)
Wherein A is angle corresponding to rough grade table institute storage function value, and B is angle corresponding to thin accuracy table institute's storage function value.
Embodiment one:
Implementation of the present invention is to carry out for last structure among Fig. 1.And N=22 in the hypothesis structure, the wave-shape amplitude word is wide to be 18.
According to formula 1, determine Na and Nb.
To function F differentiate in the formula 1
Be 10
Be that Na is 10 o'clock, its derivative is 10, obtains minimum this moment.
Embodiment two:
On the basis of embodiment one, according to formula 3, further optimize Na and Nb;
sinθ
A=0.0061358846491544753596402345903726
Therefore the Na and the Nb that calculate according to execution mode 2 are exactly optimal value, and thin accuracy table can omit according to formula 3
According to formula 2, calculate final sin cos functions value.
Contrast the present invention and traditional NCO design based on DDS
The storage resources that traditional design needs is:
2*2
22*18=144Mbit
And the storage resources that the present invention needs only is:
2
10*18=18kbit
The part that the present invention does not relate to all prior art that maybe can adopt same as the prior art is realized.