MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 求助 路过帮忙看一下 (https://www.labfans.com/bbs/showthread.php?t=11803)

穿球鞋的猫 2010-06-27 16:03

求助 路过帮忙看一下
 
已经有100万个点,要求FFT,

A1=load('D:\。。。\sc1004.dat');
A1=A1-mean(A1);

A2=load('D:\。。。\sc2004.dat');
A2=A2-mean(A2);

A3=load('D:\。。。\SC1005.dat');
A3=A3-mean(A3);

A4=load('D:\。。。\SC2005.dat');
A4=A4-mean(A4);



[COLOR="Red"]B1=abs(fft(A1(99900:200000),1000000));
这里计算A1的幅值,但是没有明白fft((99900:2000000),1000000)啥意思,下面的又不要,而且说是取8192个点 ———[/COLOR]

B2=abs(fft(A2,1000000));
B3=abs(fft(A3,1000000));
B4=abs(fft(A4,1000000));




%t=0:0.01:10000.03;
%z=(t');

%plot(z,A1)




%B1=B1(1:500000);
%B2=B2(1:500000);
%B3=B3(1:125000);
%B4=B4(1:125000);

U1=B2./B1;
U2=B4./B3;

F=0:(100000000)/999999:(100000000);
f=(F');

U1=U1/max(U1);
U2=U2/max(U2);

%Plot(f,U1,'r',f,U2,'k')
%semilogx(f,U1,'r',f,U2,'k')
%loglog(F,UF1,'r',F,U2,'k')

B1=B1/max(B1);
B2=B2/max(B2);
B3=B3/max(B3);
B4=B4/max(B4);

%plot (f, B1,'b',f,B2,'r'),grid
figure (3)
subplot (2,1,1);
loglog(f,B1,'b',f,B2,'r'),grid
title('')
xlabel ('')
ylabel ('')

subplot (2,1,2);
loglog(f,U1,'g'),grid
title ('')
xlabel ('')
ylabel ('')

figure (4)
subplot (2,1,1);
loglog(f,B3,'b',f,B4,'r'),grid
title('')
xlabel ('')
ylabel ('')

subplot (2,1,2);
loglog(f,U2,'g'),grid
xlabel ('')
ylabel ('')
title ('')

yfl 2010-06-28 07:55

回复: 求助 路过帮忙看一下
 
[COLOR="Red"]B1=abs(fft(A1(99900:200000),1000000));
这里计算A1的幅值,但是没有明白fft((99900:2000000),1000000)啥意思,下面的又不要,而且说是取8192个点 ———[/COLOR]


A1(99900:200000),就是指A1的第99900到第200000的数据,fft的用法可以看看帮助文档 FFT(X,N) is the N-point FFT, padded with zeros if X has less
than N points and truncated if it has more.


所有时间均为北京时间。现在的时间是 05:21

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.