傅里叶变换的初浅理解








function a_FS()
  %% »æ³öԭʼµÄÖÜÆÚÐźÅ
  a = -5;b=5
  t = a:0.01:b;
  f = t*0;
  t1 =t;t2= t;T =1.7;tao = 0.8;
   f( find(t>=-tao/2&t<=tao/2) ) = 1;
   figure;plot(t,f);axis([-1.5,1.5,0,1.2]);
  for i=1:5
      t1 = t1-T;f( find(t1>=-tao/2&t1<=tao/2) ) = 1;
      t2 = t2+T;f( find(t2>=-tao/2&t2<=tao/2) ) = 1;         
  end 
  subplot(3,2,1)
  plot(t,f);axis([a,b,0,1.2]);legend( 'raw_signal' );
  %% ÏÂÃæÇóCn
  N = 1000; w0 = 2*pi/T;
  % n=0ʱ£¬c0µÄϵÊýÊǶàÉÙÄØ
  C0 = tao /T;  %CnÊÇËùÓÐÕýÏîµÄ¸µÀïҶϵÊý
  for n=1:N
      C(n) = (exp(-j*n*w0*tao/2)-exp(j*n*w0*tao/2)) / (-j*n*w0) /T;  %CnÊÇËùÓÐÕýÏîµÄ¸µÀïҶϵÊý
      c(n) = (exp(j*n*w0*tao/2)-exp(-j*n*w0*tao/2)) / (j*n*w0) /T;    %cnÊÇËùÓиºÏîµÄ¸µÀïҶϵÊý
  end
  for i=2:6
      f = C0*exp(0*t);
      for n=1:i*4
          f = f + C(n) * exp(j*n*w0*t) + c(n) * exp(-j*n*w0*t);    
      end
      subplot(3,2,i);
      plot(t,f);axis([a,b,0,1.2]);legend( ['N=',num2str(i*4)] );
  end
  figure;
  f = C0*exp(0*t);
  for n=1:32
      f = f + C(n) * exp(j*n*w0*t) + c(n) * exp(-j*n*w0*t);
      plot(t,f);axis([a,b,0,1.2]);legend( 'N=32' );hold on;pause;
  end
  
end


2. function a_FT(t,f,T,tao,A)
  %% »æ³öԭʼµÄÖÜÆÚÐźÅ
  a = -5;b=5;
  t = a:0.01:b;
  f = t*0;
  t1 =t;t2= t;T =1.7;tao =0.8;A=1;
   f(find(t>=-tao/2&t<=tao/2) ) = A;
 
 plot(t,f);axis([a,b,0,1.2]);legend( 'raw_signal' );
  %% ÏÂÃ渵ÀïÒ¶Õý±ä»»
  F0 =1*tao;
  n=1;
  for w=1:0.005:40
      Fw = -A*(exp(j*w*tao/2)-exp(-j*w*tao/2))/(-j*w); %CnÊÇËùÓÐÕýÏîµÄ¸µÀïҶϵÊý
      F(n) = Fw;%ËùÓÐÕýÏò
      Fw = -A*(exp(-j*w*tao/2)-exp(j*w*tao/2))/(j*w); %CnÊÇËùÓÐÕýÏîµÄ¸µÀïҶϵÊý
      F_(n)=Fw;%ËùÓиºÊýÏî
      n=n+1;
  end
 
  figure;
  a = linspace(1,n-1,n-1);
  plot(a/200,F);xlabel('x=w') ;hold on;plot(-a/200,F_);%FF_ÊǹØÓÚwµÄÁ¬Ðøº¯Êý


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值