How to use FFT on my data?
9 次查看(过去 30 天)
显示 更早的评论
采纳的回答
Star Strider
2018-3-20
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 个评论
Star Strider
2018-3-22
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.
更多回答(2 个)
Patrik Soukup
2018-3-26
1 个评论
Star Strider
2018-3-26
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
2018-4-5
3 个评论
Star Strider
2018-4-6
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Bartlett 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


