Matlab FFT显示多个峰而不是一个

时间:2016-07-26 14:49:48

标签: matlab fft

我有一个数据文件,其中第1列为时间,第2列为某个响应变量。这是我的时间序列的图像。

enter image description here

我正在计算这个时间序列的fft,并期待一个峰值,但是得到了多个峰值,如下所示:(在x轴上我有时间段而不是频率)

enter image description here

请注意,第二个峰值(幅度较小)大约是最高峰值的一半时间段。对我来说,这看起来不像谐波。 这些其他峰值意味着什么呢?这种“周期性观察”时间序列实际上是准周期性的吗?

我是第一次使用FFT,但是,我已经检查了我的代码中已知的函数,如正弦波,它只能显示单个周期。

fft的功能:

function [X,freq]=FFT1(x,Fs)

N=length(x); %get the number of points

k=0:N-1; %create a vector from 0 to N-1

T=N/Fs; %get the frequency interval

freq=k/T; %create the frequency range

X=fft(x)/N; % normalize the data

cutOff = ceil(N/2);

X = X(1:cutOff);

freq = freq(1:cutOff);

,主要脚本是:

filename = 'e=0_TS_P1_S408080.dat';

m = dlmread(filename);

m = m(1:end-1,:);

s1 = m(:,2)';
s2 = m(:,3)';
t  = m(:,1)';
%s1 = sin(t);

dt = t(2)-t(1);
fs = 1.0/dt;

[YfreqDomain,frequencyRange] = FFT1(s1,fs);

fig_fft1 = figure;

timeperiod = 1.0./frequencyRange;

plot(timeperiod,abs(YfreqDomain));

set(fig_fft1,'Position',[500,500,500,300])

xlabel('Time period')
ylabel('Amplitude')

0 个答案:

没有答案