How to use FFT for time series data

68 次查看(过去 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.
  2 个评论
KSSV
KSSV 2023-8-14
REad the documentation of fft. It is clearly explained.
Matt Thomas
Matt Thomas 2023-8-14
i have read some of it but that is with basic varible name and stuff. the matlab thing i am using is not basic. I have tried
y=FFT((time, Channels(:,iChan)))
and i get errors back.
i have tried y=fft(iChan) and it gives me the number 29 which is the channel name of the time series im looking at.
i do not know anything about syntax or programming to know hwo to setup the syntax at all. Im trying, but its becomming a failure every step of the way to say the least haha.

请先登录,再进行评论。

采纳的回答

Walter Roberson
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
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
ans =
0.00625
format short
ans
ans = 0.0063
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.
Matt Thomas
Matt Thomas 2023-8-15
thanks for this information. i am actualyl writing anpother post on FFT specifically so i dont keep using this area haha. I think i understand more now than i did earlier haha. I know of FFT but have never used it. i have used laplace alot for linear systems but not FFT

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Vibration Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by