Forum Discussion
Altera_Forum
Honored Contributor
11 years ago --- Quote Start --- I'm a bit confused with the Eq 37 (from your FPGA-DSP document) --- Quote End --- Whenever you are confused, try and create the equivalent code in MATLAB and plot the data. For example, plot a single period of a complex-valued exponential ...
N = 1024;
n = ;
x = exp(-j*2*pi*n/N);
x_re = real(x);
x_im = imag(x);
figure(1)
subplot(2,1,1)
plot(n,x_re)
subplot(2,1,2)
plot(n,x_im)
and you'll see that the real part is a cosine and the imaginary part is a negative sinsuoid - just like Eq 37. --- Quote Start --- The fo in Eq 37 is a normalised frequency, the center frequency divided by the sampling frequency. Does that mean NCO should generate the cosine and sinusoid components with frequency of fo not the centre frequency? --- Quote End --- If your FPGA is operating at 80MHz, and its generating a 2.5MHz sinusoid, then the normalized frequency is 2.5/80 = 0.03125. Another way to think of it, is that each 2.5MHz period is 400ns long, and that is equivalent to 400ns x 80MHz = 32 samples. So as long as your NCO phasor has a multiple of 32 samples, your 2.5MHz output signal will always quantize to a whole number, i.e., your frequency tuning word will not have any fractional component when represented as a fractional integer. See slides 113+114 for an example ... http://www.ovro.caltech.edu/~dwh/correlator/pdf/esc-104slides_hawkins.pdf --- Quote Start --- For example, the signal's centre frequency is 2.5MHz and the sampling frequency is 80MHz. So the normalised frequency fo = 2.5/80 = 0.0313. So in the NCO, the "Desired output frequnecy" shoud be set to 0.0313 not 2.5 MHz. Is it correct? --- Quote End --- Not unless the Quartus NCO GUI has changed. Figure 36 on p64 shows that the parameters can be entered in terms of frequencies. http://www.ovro.caltech.edu/~dwh/correlator/pdf/esc-104paper_hawkins.pdf Cheers, Dave