Decomposing the time series of wind turbulance using Fourier series, and computing the spectra.
3 views (last 30 days)
Show older comments
I have wind turbulence data for every 30 minutes. I need to compute spectra using Fourier series and to get the graph in the image below. How can I do it with using MATLAB. In the attachment file, I have the u,v and w component of the wind turbulence. Thanks for answers.
0 Comments
Answers (1)
Star Strider
on 15 Sep 2022
Try this —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1125355/data-MOOCTurbulenceDataSeries.xls')
u = T1.u;
v = T1.v;
w = T1.w;
t = T1.time/60; % Guessing Here (Units = Minutes)
figure
plot(t, [w v u])
grid
legend('u','v','w', 'Location','best')
xlabel('Time (Minutes)')
ylabel('Amplitude (Units?)')
Fs = 1/(t(2)-t(1))/60; % Sampling Frequency (Hz) (Cy/Min * Min/Sec)
Fn = Fs/2; % Nyquist Frequency
L = size(T1,1);
NFFT = 2^nextpow2(L); % FOr Efficiency
FTuvw = fft([u v w],NFFT)/L; % Fourier Transform
Fv = linspace(0, 1, NFFT/2+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
plot(Fv, abs(FTuvw(Iv,:))*2)
grid
% xlim([1E-4 10])
Ax = gca;
Ax.XScale = 'log';
Ax.YScale = 'log';
legend('u','v','w', 'Location','best')
xlabel('Frequency (Hz)')
ylabel('Magnitude')
Scale the time (‘t’ vector) correctly in that assignment. I believe I did it correctly, however the frequencies do not match with the posted plot, being several orders-of-magnitude smaller. Set the xlim values correctly in the Fourier Transform plot to show whatever the region of interest is (possibly Hz to Hz).
.
1 Comment
E. Cheynet
on 14 Apr 2023
Edited: E. Cheynet
on 14 Apr 2023
To further smooth the spectrum, you can use Welch's algorithm with multiple overlapping segments and use bin-averaging over logarithmically-spaced bins. See e.g. https://se.mathworks.com/matlabcentral/fileexchange/73584-averaging-noisy-data-into-bins
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!