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 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Ganavi Mg
le 6 Fév 2018
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).
Réponse acceptée
Wayne King
le 2 Oct 2013
Modifié(e) : Wayne King
le 2 Oct 2013
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.
1 commentaire
Plus de réponses (0)
Communautés
Plus de réponses dans Power Electronics Control
Voir également
Catégories
En savoir plus sur Spectral Measurements 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!