matlab验证傅⾥叶变换的线性性质(纯代码附运⾏结果)傅⾥叶变换性质验证:产⽣时域信号f1(t)和f2(t),并分别画出时域波形;求f1(t)和f2(t)的频谱和,并分别画出频谱;验证⼀个傅⾥叶变换性质(线性性质),要求画出相应的图形进⾏对⽐并分析。
subplot(3,2,1);
A = 2;
tao = 4;
X = [-tao/2 -tao/2 tao/2 tao/2];
Y = [0 3 3 0];
plot(X,Y);
title('门信号f1')
axis([-tao,tao,0, 4]);
box off;
subplot(3,2,2);
tao = 8;
X = [-tao/2 -tao/2 tao/2 tao/2];
Y = [0 4 4 0];
plot(X,Y);
axis([-tao,tao,0, 4]);
title('门信号f2')
axis([-6,6,0, 6]);
box off;
w1 = -4 * pi;
w2 = 4 * pi;
t1 = -2;
t2 = 2;
N = 500;
wk = linspace(w1,w2,N);
F = zeros(1,N);
Fw1 = @ (w)(quad(@(t)((A + 1)*rectpuls(t,4).*exp(- 1i * w * t)),t1,t2));
for k = 1 : N
matlab求傅里叶变换F(k) = Fw1(wk(k));
end
subplot(3,2,3);
plot(wk,real(F));
yscale = get(gca,'ylim');
set(gca,'ylim',[yscale(1),yscale(2)+0.2]);
label = {'-2\pi';'-\pi';'0';'\pi';'2\pi'}';
x = [-2*pi -pi 0 pi 2*pi];
y = yscale(1) * ones(1,5) - 0.2;
set(gca,'xtick',[-2*pi -pi 0 pi 2*pi],'xticklabel',[]);
text(x,y,label);
xlabel('\omega');
title('g_{4}(t)');
grid;
box off;
Fw2 = @ (w)(quad(@(t)((A + 2)*rectpuls(t,8).*exp(- 1i * w * t)),t1,t2));
for k = 1 : N
F(k) = Fw2(wk(k));
end
subplot(3,2,4);
plot(wk,real(F));
yscale = get(gca,'ylim');
set(gca,'ylim',[yscale(1),yscale(2)+0.2]);
label = {'-2\pi';'-\pi';'0';'\pi';'2\pi'}';
x = [-2*pi -pi 0 pi 2*pi];
y = yscale(1) * ones(1,5) - 0.2;
set(gca,'xtick',[-2*pi -pi 0 pi 2*pi],'xticklabel',[]);
text(x,y,label);
xlabel('\omega');
title('g_{8}(t)');
grid;
box off;
直接打开matlab运⾏即可。
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论