Difference in FFT plot in Dewesoft and matlab
I have acquired acceleration data using Dewe-43V. Sampling frequency is 20KHz and duration of acquired signal is 1200 seconds. Then I have plotted FFT for the data using FFT analyzer (overall averaged) and also using matlab. Here I observed the amplitudes and frequency values are not matching.
I would like to know why this difference arises. Here I attached my matlab code.
Requesting for help
For one you didn't apply any window function - what kind of window did you use in dewesoft? If rectangular (not advisable) then your matlab is correct; but its more usual to use hanning or blackman.
For two your matlab code is performing an FFT of the entire chunk of data (1200s) which will give you a spectral resolution of 1/1200 = 0.83mHz! What resolution did you use in Dewesoft? Even though you selected "overall averaged", dewesoft still expects you to specify a spectral resolution (Hz) or a number of spectral lines between 0Hz and fs/2.
Try setting Matlab and Dewesoft to perform the same FFT and see if you get the same results. It normally works. Good Luck
Thank You Nick Arran.
I have used hanning window and the line resolution is 0.61035Hz. And this is the maximum resolution I can get in the Analyzer, and also It is showing that if you want to increase resolution sync DB buffer length. So how to give 0.83mHZ resolution in the analyzer.
Here I attached the screen shot of the FFT analyzer.
Requesting for help.
This is a maths issue, not a dewesoft one really. But anyway:
If you set the dewesoft fft analyser to use a hanning window, then you also need to use a hanning window in your matlab script. Happily Matlab provide the function "window=hanning(n)" where n is the number of data samples you want to window, but then you have to scale the results by 1/sum(hanning(n)) NOT 1/(number of samples).
I guess dewesoft can't manage to analyse the WHOLE data length in one window because its buffer is too small so it is giving you the longest window it can manage with the given buffer size. It then does a separate FFT for each 1/0.61035 = 1.638s, then it is taking a linear average of all those FFT results. you can make the buffer longer by going to settings (or "options in X3) then clicking Performance. On my PC the SyncDB bufffer length is set to 2s; I don't know what range is available, but I guess using a long buffer will slow down the calculations using a greater % of CPU power.
Really, what I would do, is use a 1Hz resolution FFT (or whatever resolution you need) then plot the peak and the average of all the resulting spectra. In dewesoft, you would have to run two FFT instances; both with set resolution to 1Hz, calcuation type to overall (Averaged), overlap to 0% (if that's what you want), then one with Averaging set to peak and the other set to lin. You can replicate this really easily in Matlab using the spectrogram command which returns a matrix containing all the FFT results (one for each 1s window) which you can then process using Max(matrix) and Average (Matrix).