How to use FFT for time series data
74 次查看(过去 30 天)
显示 更早的评论
Thank you all who helped to answer my first question. Now im on to my second question:
using an open source software called openFAST, i have calculated loads over 300 seconds in Kn. The graph below is what it looks like. i use the following code to produce the image
%% Run this command first
%% Read a binary output file
% Read file
outbfile = '5MW_Land_DLL_WTurb.outb';
[Channels, ChanName, ChanUnit, FileID, DescStr] = ReadFASTbinary(outbfile);
time = Channels(:,1);
%%CHange the plot number to reflect the parameter in channel names matrix generated from above command.
% Plot Channel 34
iChan=29
figure()
plot(time, Channels(:,iChan))
xlabel('Time (s)')
ylabel([ChanName(iChan) ChanUnit(iChan)])
I have very little to know knowledge of programming. The above code is example code i found in a user guide.
What i would like to do now is FFT so that i can find the peak frequency of this data. However, i do not know how to do that in matlab or the correct syntax.
thanks for all the help and continued help.
采纳的回答
Walter Roberson
2023-8-14
if you have regular times, then
y = fft(Channels(:,iChan));
and see the first example for fft() for code that can calculate appropriate frequency bins.
If you do not have the frequency information but you do have regular time slots then frequency is Fs = 1/mean(diff(time))
If you do not have regular times then see nufft
4 个评论
Walter Roberson
2023-8-14
编辑:Walter Roberson
2023-8-14
Your plot lots like it might end at time 300 and you have 48000 samples. If so then
format long g
300/48000
format short
ans
So perhaps your real sample time is 0.00625 but the displaying round it off to 0.0063 ?
Yes, you have 160 samples per second. That does not mean that the wave shape is the same frequency.
Imagine that you had a 40 Hz sine wave, but you sampled it 4 times during each cycle, then the sampling rate would be 160 Hz even though the wave is only 40 Hz.
In the field of signal transmission, if you can sample a wave much faster than the nominal signal frequency, then you have the opportunity to overlay modifications to the basic wave, and so get multiple bits per "symbol". This is an important signalling mechanism in practice.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!