www.pudn.com > pinsanquxian.rar > bispeci_exm.m, change:2004-09-21,size:553b


%双谱例子 
clear all; 
N=64; 
n=0:N-1; 
f1=0.1;f2=0.15;f3=0.25;f4=0.4; 
fai1=pi/6; 
fai2=pi/3; 
fai3=pi/2; 
fai4=pi/4; 
s1=cos(2*pi*f1*n+fai1); 
s2=cos(2*pi*f2*n+fai2); 
s3=cos(2*pi*f3*n+fai3); 
s4=cos(2*pi*f4*n+fai4); 
x=s1+s2+s3+s4; 
subplot(2,2,1); 
plot(x) 
X=fft(x); 
X=fftshift(X);      %下面的Fy才是数据Y的傅立叶变换 Fy=fftshift(fft(Y)); 取幅值相位[mag,pha]=bode(sys,w)  
subplot(2,2,2); 
plot((n-N/2),abs(X));grid on; 
subplot(2,2,3); 
[bspec,waxis]=bispeci(x,10); 
subplot(2,2,4); 
mesh(abs(bspec)); 
%bspec=bispecd(x);figure;mesh(abs(bspec))