fftshift使用

关于matlab中fftshift的使用,两种使用方式一种是fftshift(fft()),另一种是fftshift(fft(fftshift()))。

 

t_s = 0.01;
t_start = 0.5; t_end = 5;
t = t_start:t_s:t_end;
y = 0.5*sin(2*pi*15*t)+2*sin(2*pi*40*t);
y_f = fft(y);
 
subplot(5,1,1);
plot(t,y); title('original signal');
 
Duration = t_end - t_start;
Sampling_points = Duration/t_s + 1;
 
f_s = 1/t_s;
f_x = 0:f_s/(Sampling_points-1):f_s;
 
subplot(5,1,2);
plot(f_x,abs(y_f)); title('fft() transform');
 
subplot(5,1,3);
plot(f_x-f_s/2,abs(fftshift(y_f)));
title('fftshift(fft()) transform');
 
subplot(5,1,4);
plot(f_x-f_s/2,abs(fft(fftshift(y))));
title('fft(fftshift()) transform');
 
subplot(5,1,5);
plot(f_x-f_s/2,abs(fftshift(fft(fftshift(y)))));
title('fftshift(fft(fftshift()) transform');

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值