可视化计算离线作业(2)
时间:2025-04-21
时间:2025-04-21
3.5056 -0.8979 -0.2745 0.1438 0.0137
2.(10分)信号y = 5*sin(pi*20*t)+3*cos(2*pi*50*t)幅度为1的白噪声的干扰,请画出此信号,然后进行傅立叶变换,画出变换后的频域信号。
clear
t=(0:0.001:1)';
y = 5*sin(2*pi*10*t)+3*cos(2*pi*50*t);
plot(y(1:150))
title('');
傅立叶转变后:
clear
t=0:0.001:0.6;
y=5*sin(2*pi*10*t)+3*cos(2*pi*50*t);
plot(y(1:150));
y=fft(y,512);
Y=real(y);
figure,plot(Y(1:512))
title(' ')
0 50 100 150
-8
-6
-4
-2
2
4
6
8
??