文档介绍:实验四信号的频谱分析
,非周期信号的频谱,如周期,非周期方波,正弦信号等。理解CFS,CTFT与DFT(FFT)的关系。
,非周期信号的频谱,如周期,非周期方波,正弦信号等。理解DFS,DTFT与DFT(FFT)的关系,并讨论连续信号与离散信号频谱分析方法的异同。
;
。
,分析并画出频谱,改变采样间隔与截断长度,分析混叠与泄漏对单一频率成分信号频谱的影响。
(1)sin(100*pi*t)产生程序:
close all;
clc;
clear;
t=0::-;
f=400*t;
w0=100*pi;
y=sin(w0*t);
a=fft(y);
b=abs(a)/200;
d=angle(a)*180/pi;
subplot(311);
plot(t,y);
title('y=sin(wt)');
xlabel('t');
ylabel('y(t)');
subplot(312);
stem(f,b);
title('振幅');
xlabel('f');
ylabel('y(t)');
subplot(313);
stem(f,d);
title('相位');
xlabel('t');
ylabel('y(t)');
混叠
close all;
clc;
clear;
t=0::-;
f=(t/)*2;
w0=100*pi;
y=sin(w0*t);
a=fft(y);
b=abs(a)/40;
d=angle(a)*180/pi;
subplot(311);
plot(t,y);
title('y=sin(wt)');
xlabel('t');
ylabel('y(t)');
subplot(312);
stem(f,b);
title('振幅');
xlabel('f');
ylabel('y(t)');
subplot(313);
stem(f,d);
title('相位');
xlabel('t');
ylabel('y(t)');
泄漏
close all;
clc;
clear;
t=0::-;
f=800*t;
w0=100*pi;
y=sin(w0*t);
a=fft(y);
b=abs(a)/198;
d=angle(a)*180/pi;
subplot(311);
plot(t,y);
title('y=sin(wt)');
xlabel('t');
ylabel('y(t)');
subplot(312);
stem(f,b);
title('振幅');
xlabel('f');
ylabel('y(t)');
subplot(313);
stem(f,d);
title('相位');
xlabel('t');
ylabel('y(t)');
(2)cos(100*pi*t);
close all;
clc;
clear;
t=0::-;
f=800*t;
w0=100*pi;
y=cos(w0*t);
a=fft(y);
b=abs(a)/200;
d=angle(a)*180/pi;
subplot(311);
plot(t,y);
title('y=cos(wt)');
xlabel('t');
ylabel('y(t)');
grid on;
hold on;
subplot(312);
stem(f,b);
title('振幅');
xlabel('f');
ylabel('y(t)');
grid on;
hold on;
subplot(313);
stem(f,d);
title('相位');
xlabel('f');
ylabel('y(t)');
混叠
close all;
clc;
clear;
t=0::-;
f=(t/)*2;
w0=100*pi;
y=cos(w0*t);
a=fft(y);
b=abs(a)/40;
d=angle(a)*180/pi;
subplot(311);
plot(t,y);
title('y=cos(wt)');
xlabel('t');
ylabe