LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT HELP

I need FFT example code, CVI, for non-coherent dualtone waveform.  I've tried creating my own using nationals white paper and example but it has plenty of issues.  The example doesn't show how to apply the collelation.  This is a dual tone waveform with a beat frequency of 10 kHz.  I'm sampling at 1.25mHz.  Because the waveform is non-coherent I think I need to do a correlation matrix but I'm not sure how to apply this.  The basic code is:
 
     //get the waveform
     DAQ_6259GetWaveform(nNumOfSamples, dWaveform, &nNumDataSamples);//4096
     //window
     ScaledWindowEx(dWaveform, nNumOfSamples, HANNING, NULL, &WinConst);
     //Get Mag phase spectrum
     AmpPhaseSpectrum (dWaveform, nNumOfSamples, FALSE, (1.0/rate), Mag_Spec, Phase_Spec, &df);
     //Get the mag
     PowerFrequencyEstimate (Mag_Spec, Phase_Spec, 110000.00, WinConst, df, 7, &Freq, &PeakVolts);
 
Somewhere in here I have to get the phase information so I can apply the sign to the PeakVolts.
 
Where does the collelation matrix come in and how is it applied?
 
Thanks,
 
Andy L
 
0 Kudos
Message 1 of 2
(3,261 Views)
Hello Andy,

Probably you typed your sample frequency wroong, unless you do want a good amount of aliasing (1.25mHz). Could it be 1.25MHz?
Now, I am not sure about the correlation you talk, I am not familiar probably (or collelation). Do you want the magnitude of the frequency domain or the power spectrum?

A couple of things if you read this article:
- If you window, you are already reducing spectral lekage and therefore coherent sampling is not a must.
- If you sample at 1.25 MHz and get n*125 samples (n is an integer), you will get a multiple number of cycles of your 10 kHz signal so it will be coherent. You did not mention what is the other tone.

Finally, try to keep your questions on one forum so that future customers can find them in a centralized location.

Gerardo O.
RF SW Engineering R&D
National Instruments
0 Kudos
Message 2 of 2
(3,219 Views)