response spectrum - time domain to frequency domain

4 ビュー (過去 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 Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by