www.pudn.com > pinsanquxian.rar > dispeci_exm.m, change:2004-09-18,size:461b


%˫ 
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) 
fftx=abs(fft(x))*2/N; 
f=0:1/(N-1):1; 
fftx=fftshift(fftx); 
subplot(2,2,2) 
plot(f(1:N/2-1),fftx(1:N/2-1));grid on; 
subplot(2,2,3); 
[bspec,waxis]=bispeci(x,10); 
subplot(2,2,4); 
mesh(abs(bspec));