response spectrum - time domain to frequency domain

조회 수: 2 (최근 30일)
Thomas Kirk
Thomas Kirk 2020년 4월 4일
답변: Star Strider 2020년 4월 4일
Hi all, hope this message finds you well. I have been running tests on a model wind turbine using fast and have an example of the output data in the time domain as shown below.
Time RotSpeed
(s) (rpm)
0 12.10
0.0125 12.11
0.025 12.11
0.0375 12.11
0.05 12.09
0.0625 12.07
0.075 12.03
I need a response spectrum to find natural frequencies etc. If anyone could give me any advice it would be really appreciated.
Kind regards,
Tom

답변 (1개)

Star Strider
Star Strider 2020년 4월 4일
Here is some example code that you can adapt to your data:
t = linspace(0, 5, 1E+4); % Time Vector
s = sum(sin([100; 250; 300; 700]*2*pi*t)); % Signal Vector
figure
plot(t, s)
grid
L = numel(t); % Signal Length
Ts = mean(diff(t)); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
n = nextpow2(numel(t)); % Zero-Pad So Length Is The Next Highest Power Of 2 (Not Required)
FTs = fft(s,2^n)/L; % Discrete Fourier Transform
Fv = linspace(0, 1, fix(2^n/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
plot(Fv, abs(FTs(Iv))*2)
grid
If you do not use nextpow2, the fft call becomes:
FTs = fft(s)/L;
and the frequency vector calculation becomes:
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
The rest of the code is unchanged.

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by