时间t 位移x 0 1 1.65E-05 0.999983045 3.31E-05 0.99996526 4.96E-05 0.999946645 6.62E-05 0.999927199 0.000148853 0.999817534 0.000231549 0.999687168 0.000314245 ... 时间t 位移x
0 1
1.65E-05 0.999983045
3.31E-05 0.99996526
4.96E-05 0.999946645
6.62E-05 0.999927199
0.000148853 0.999817534
0.000231549 0.999687168
0.000314245 0.999536141
0.000396941 0.999364493
0.000810422 0.998198388
0.001223903 0.996523048
0.001637383 0.99434393
0.002050864 0.991666701
0.004118267 0.971017254
0.00618567 0.938881651
0.008253073 0.896176808
0.010320476 0.843903563
0.013909462 0.733576368
0.017498447 0.60373725
0.021087433 0.460679539
0.024676419 0.310544505
0.028465691 0.150844979
0.032254963 -0.003353877
0.036044235 -0.145975632
0.039833507 -0.272127807
0.0429578 -0.360954094
0.046082092 -0.434033112
0.049206384 -0.490111668
0.052330677 -0.52857146
0.055954892 -0.551040245
0.059579108 -0.550371564
0.063203324 -0.528122443
0.06682754 -0.486716536
0.069973943 -0.437603602
0.073120347 -0.378637957
0.07626675 -0.312278735
0.079413154 -0.241010094
0.08317876 -0.152670404
0.086944367 -0.064957361
0.090709973 0.018408264
0.094475579 0.09442318
0.097733314 0.152397469
0.100991048 0.20177429
0.104248782 0.24165641
0.107506516 0.271553851
0.111244103 0.2933616
0.114981689 0.301924287
0.118719275 0.297806704
0.122456861 0.282036001
0.125608558 0.260685249
以上为采集到的数据,diyi行为时间,第二行为位移,如何用matlab对这组数据进行傅里叶变化?如何画频谱图?
非常感谢各位回答!!!
先把第二列数据索引出来,再进行傅里叶变换就好了。下面是代码,
X=shuju(:,2);%数据换成你采集到的数据
Fs=1000;%采样频率,这个是要根据你的修改
n=length(X);
Fw1=abs(fft(X))/n*2;
Fw=Fw1(1:n/2);
xt=Fs/n:Fs/n:Fs/2; %产生横坐标,单位为Hz,
plot(xt,Fw)
grid off