Ip_01_05.m
上传用户:loeagle
上传日期:2013-03-02
资源大小:1236k
文件大小:0k
源码类别:

通讯编程文档

开发平台:

Matlab

  1. % MATLAB script for Illustrative Problem 5.1. 
  2. df=0.01;
  3. fs=10;
  4. ts=1/fs;
  5. t=[-5:ts:5];
  6. x1=zeros(size(t));
  7. x1(41:51)=t(41:51)+1;
  8. x1(52:61)=ones(size(x1(52:61)));
  9. x2=zeros(size(t));
  10. x2(51:71)=x1(41:61);
  11. [X1,x11,df1]=fftseq(x1,ts,df);
  12. [X2,x21,df2]=fftseq(x2,ts,df);
  13. X11=X1/fs;
  14. X21=X2/fs;
  15. f=[0:df1:df1*(length(x11)-1)]-fs/2;
  16. plot(f,fftshift(abs(X11)))
  17. figure
  18. plot(f(500:525),fftshift(angle(X11(500:525))),f(500:525),fftshift(angle(X21(500:525))),'--')