📄 m37.m
字号:
fs=8000;
load mtlb;
x=mtlb;
X=fft(x,1024);
subplot(3,2,1);plot(x);
title('语音信号时域波形');
subplot(3,2,2);plot([-512:511],fftshift(abs(X)));
title('语音信号幅度谱');
xI=zeros(1,2*length(x));
xI(1:2:end)=x;
X1=fft(xI,2048);
subplot(3,2,3);plot([-1024:1023],fftshift(abs(X1)));
title('内插后幅度谱');
b1=fir1(24,1/2,hamming(25));
y1=filter(b1,1,xI);
Y1=fft(y1,2048);
subplot(3,2,4);plot([-1024:1023],fftshift(abs(Y1)));
title('内插后通过低通滤波器的幅度谱');
b2=fir1(24,1/2,hamming(25));
y2=filter(b2,1,x);
xD=y2(1:2:end);
Y2=fft(xD,512);
subplot(3,2,5);plot([-256:255],fftshift(abs(Y2)));
title('抽取后通过低通滤波器的幅度谱');
xI=zeros(1,5*length(x));
xI(1:5:end)=x;
X1=fft(xI,1024);
b3=fir1(24,1/5,hamming(25));
y3=filter(b3,1,xI);
xD=y3(1:4:end);
Y3=fft(xD,1024);
subplot(3,2,6);plot([-512:511],fftshift(abs(Y3)));
title('有理数倍抽样率转换后序列的幅度谱');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -