Matlab - 绘制过滤后的音频

Matlab - Plotting filtered audio

我正在尝试绘制过滤后的音频,但我做错了,因为第二个图什么也没显示。

[wave,fs]=wavread('my-audio.wav');
t=0:1/fs:(length(wave)-1)/fs;
figure(1);plot(t,wave);
b = [1.1 1];
a = [-0.1 0 1];
FIR = filter(b,a,wave);
figure(2);plot(t,FIR);

我使用的函数是:H(z)=(z + 1.1)/(z^2 - 0.1)

我错过了什么?

谢谢!

您似乎颠倒了 ab 向量中系数的顺序。反转系数的顺序对于定义传递函数的极点(并因此确定滤波器的稳定性)的反馈系数 a 特别显着。因此,过滤后的输出结果 FIR 可能超过了浮点数容量,而 plot 遇到了问题。

根据filter's documentation, the a and b coefficients are defined using a transfer function of the form

因为你的传递函数是

你应该使用系数

b = [0  1  1.1]
a = [1  0 -0.1]