I want FFT plot of a motor data mat-file. It is of 10kHz frequency but I'm not getting the peaks of the plot at 50 Hz frequency. What corrections are needed? And how to write comments for the FFT plots drawn between frequency vs amplitude?
11 次查看(过去 30 天)
显示 更早的评论
load t10k50sno.mat;
>> n = 1000;
>> ts =0.0001;
>> ws = 2*pi/ts;
>> f = fft(t10k50sno.Y(1).Data(1:1000));
>> fc=fftshift(f)*ts;
>> w = ws*(-n/2:(n/2)-1)/n;
>> plot(w,abs(fc))
>> xlabel('frequency');
>> ylabel('amplitude');
>> title('fast fourier transform of healthy motor at no-load condition');
1 个评论
Ganavi Mg
2018-2-6
Hi Even I want fft plot of ppg data mat file. In your code specially in this line-f = fft(t10k50sno.Y(1).Data(1:1000));how you had choosen Y(1).
采纳的回答
Wayne King
2013-10-2
编辑:Wayne King
2013-10-2
Without your data it is difficult to say exactly, but your frequency vector is in radians/second, not cycles/second, so could you just not be looking for a peak at the correct frequency.
In radians/second, you should be getting peaks at (2*pi*50) radians/second (approx 314)
If you want you can just modify your example a little bit to see if that is the issue. Since I don't have your data, I have to make up a signal here.
n = 1000;
ts =0.0001;
ws = 2*pi/ts;
t = 0:ts:0.1-ts;
x = cos(2*pi*1000*t)+randn(size(t));
f = fft(x);
fc=fftshift(f)*ts;
w = ws*(-n/2:(n/2)-1)/n;
plot(w,abs(fc))
xlabel('frequency');
ylabel('amplitude');
The above plot is in radians/second. Now to convert to Hz.
n = 1000;
ts =0.0001;
ws = 2*pi/ts;
t = 0:ts:0.1-ts;
x = cos(2*pi*1000*t)+randn(size(t));
f = fft(x);
fc=fftshift(f)*ts;
w = ws*(-n/2:(n/2)-1)/n;
plot(w./(2*pi),abs(fc))
xlabel('frequency');
ylabel('amplitude');
You see in the preceding plot, the line components are at 1000 Hz as expected.
更多回答(0 个)
社区
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!