DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

fft frequency is not consistent with matlab

Solved!
Go to solution

Hello all,

Please find the .jpg in the attachement. The signal is generated by a signal generator and collected by datashuttle/3000. Then I use the 'FFT module' and 'statistical value' to find the max position (frequency). I also downloaded the data and processed it by matlab FFT function.  What I find out is that the frequency value of dasylab is always a little less than matlab. For example, when the signal generator gives 10Hz, the dasylab indicate 9.77Hz, and the matlab gives 9.99Hz. I used matlab for years, so I trust it. It must be something wrong with my program or dasylab.  First I though it is because of the resolution, so I changed the 'statistical values--mode--block based  and tick block relative (not quite sure about this) and one value for every 240 blocks, which is the same time for matlab sampling.  Unfortunately, there is no change at all . Anyone can help?

Many thanks,

 

Alan

0 Kudos
Message 1 of 3
(6,627 Views)
Solution
Accepted by topic author Alan005

What is your DASYLab sample rate and block size?

 

Try making the block size an even number, for example, if you sample at 1000 hz, make the block size 500 or 1000.

 

What is the equivalent Matlab block? How much data is used to do the computation.

 

You can also use the Block Average module to average over 250 blocks, and then use the Statistical Values module to compute the Maximum Position.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 3
(6,612 Views)

I just did some trial and error... you need a bigger block size... you can increase it to multiple seconds, rounded to a power of two in the Experiment Setup, or you can use the Data Window module to adapt the block size to a larger number.

 

With V10 and V11, you can have the block size be any number, not just a power of two, and the FFT math will work correctly.

 

Note that it is hard to support old versions of the software. V9 is now 4+ years old.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 3 of 3
(6,607 Views)