How to use FFT on my data?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Akzeptierte Antwort
Star Strider
am 20 Mär. 2018
Other peaks may exist, although if the constant, (or ‘d-c’) offset is large enough, you will not be able to see them.
Try this:
id = data(:,2); % to load current values from the second column of my .txt
i = id - mean(id);
That should reveal the other peaks.
8 Kommentare
Star Strider
am 22 Mär. 2018
Taking the absolute values first should not cause your data to plot upside down. Taking the absolute value is the correct way to calculate the spectrum and convert it to dB.
I described essentially this procedure in my earlier Comment:
Ia = abs(I);
Iref = max(Ia);
Inorm = 20*log10(Ia/Iref);
Note that decibels are defined with respect to the base 10 logarithm, not the natural logarithm. I corrected that in the code I posted here.
As for the scaling, you can certainly divide the dB values by 10 to get them to go from -100 to 0. However, this significantly distorts your amplitude information, and the units are no longer dB.
See if these changes improve your results.
Weitere Antworten (2)
Patrik Soukup
am 26 Mär. 2018
1 Kommentar
Star Strider
am 26 Mär. 2018
The ‘L’ parameter is the length of the Hann window, in units of samples. (The purpose of the window functions is to reduce the effects of using a finite sequence to represent an infinite sequence.)
I use windows to design filters, and do not generally use them to calculate Fourier transforms, because they significantly distort the transformed data. My signal processing references only discuss them in the context of filters.
As I read my references, ‘L’ should be the length of your signal. See for example hanning ,hamming window in matlab? (link).
Patrik Soukup
am 5 Apr. 2018
3 Kommentare
Star Strider
am 6 Apr. 2018
The default line width is 0.5 points. It may be that it is not possible to define a line width less than that. I cannot find that specific information in the documentation, so I do not know for sure.
Siehe auch
Kategorien
Mehr zu Bartlett finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


