How to use FFT on my data?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Réponse acceptée
Star Strider
le 20 Mar 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 commentaires
Star Strider
le 22 Mar 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.
Plus de réponses (2)
Patrik Soukup
le 26 Mar 2018
1 commentaire
Star Strider
le 26 Mar 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
le 5 Avr 2018
3 commentaires
Star Strider
le 6 Avr 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.
Voir également
Catégories
En savoir plus sur Bartlett dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


