Matlab firpm 对于大型 AFR 数据阵列失败
这是一个快速&尝试创建高精度均衡器的肮脏代码:
bandPoints = 355;
for n = 1:bandPoints
x = (n / (bandPoints + 2));
f = (x*x)*(22000-20)+20; % 20...22000
freqs(n) = f;
niqfreqs(n) = f/22050.0;
amps(n) = 0;
end
amps(bandPoints+1) = 0; % firpm needs even numbers
niqfreqs(bandPoints+1) = 1; % firpm needs even numbers
% set some point to have a high amplitude
amps(200) = 1;
fircfs = firpm(101,niqfreqs,amps);
[h,w] = freqz(fircfs,1,512);
plot(w/pi,abs(h));
legend('firpm Design')
但它给了我
Warning:
*** FAILURE TO CONVERGE ***
Probable cause is machine rounding error.
所有 FIR 系数均为 0。
如果我将 n 参数从 101 降低到 91,firpm
工作时没有错误,但频率响应远未达到预期。考虑到我想计算硬件DSP FIR模块的FIR系数,该模块最多支持12288个抽头,我怎样才能让Matlab计算所需的系数? firpm 是否能够执行此操作,或者我是否需要在 Matlab 以及稍后的应用程序 C++ 代码中使用另一种方法(逆 FFT)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
哦,看来MP算法确实无法处理这个问题,所以我需要一些其他解决方案:
http://www.eetimes.com/design/embedded/4212775/Designing-very-high-order-FIR-filters-with-zero-stuffing
我想,我会有然后继续使用逆FFT。
Oh, it seems MP algorithm really cannot handle this, so I need some other solution:
http://www.eetimes.com/design/embedded/4212775/Designing-very-high-order-FIR-filters-with-zero-stuffing
I guess, I'll have to stick with inverse FFT then.