Time normalization in FFT!

7 次查看(过去 30 天)
Hossein
Hossein 2016-2-2
Hi everyone,
I'm trying to take a FFt from a time signal being resulted from an ODE procedure for simulating an imbalance response of a rotor-bearing system in a specific rotational speed. I am a little bit confused after having the fft signal because I can see the pick but not at the right frequency in Herz (theoretically I should see the pick at a frequency equal to rotaional speed of the shaft), I guess something is wrong with time normalization by timesignal but I don't know what exactly:
%
z=Y(:,1); %Timesignal
N=length(z); %Number of samplerates
ts=51/51000; %Sampletime
Fs=1/ts %Samplefrequency
fB = Fs/2;
Yc = fft(z)/N;
YY = 2 * abs( Yc( 1:N/2+1 ) );
YY(1) = YY(1)/2;
f = fB * linspace(0, 1, N/2+1)/0.05882;
Many thanks in advance!
  1 个评论
Daniel Armyr
Daniel Armyr 2016-2-2
I am curious at the number 0.05882. It seems like an oddly specific hard-coded value. Are you sure it is the right value there, and that this is not a number that should be computed from for example ts or Fs?

请先登录,再进行评论。

回答(1 个)

Star Strider
Star Strider 2016-2-2
In order to use the fft with your ODE integration, you have to use a vector of fixed values for ‘tspan’, rather than the adaptive times reported by the differential equation solvers. The easiest way to do this is to use the linspace function:
tspan = linspace(t_start, t_end, 500);
This creates a 500-element vector of equally-spaced time values between the values you choose for ‘t_start’ and ‘t_end’.
  2 个评论
Hossein
Hossein 2016-2-2
Hi dude, I've done that, but the question is something else....I don't know how should I nomalize the time scale with respert zu omega (rotational speed of rotor) in my case
Star Strider
Star Strider 2016-2-2
You don’t need to. If you choose enough time points, you will get adequate frequency resolution. I linked to the R2015a documentation on fft in my original Answer, and I’m linking to it here as well. Note specifically the code between the top two plot figures as to how to correctly use the sampling time difference to correctly calculate the frequency vector and plot the fft.
Example code:
s = ... SIGNAL ...
L = length(s); % Length Of Signal
Ts = tspan(2)-tspan(1); % Sampling Time Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
FTs = fft(s)*2/L; % Calculate FFT
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector (Hz)
Iv = 1:length(Fv); % Index Vector
figure(1)
plot(Fv, abs(FTs(Iv)))
grid

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Spectral Estimation 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by