2011-10-17 28 views
1

這裏是試圖建立一個高精度的均衡快速&髒代碼: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的工作原理沒有錯誤,但是頻率響應遠不如人意。考慮到我想計算一個支持12288抽頭的硬件DSP FIR模塊的FIR係數,我怎樣才能讓Matlab計算出所需的係數? firpm能夠做到這一點,或者我需要在Matlab和後來的應用程序C++代碼中使用另一種方法(反向FFT)嗎?

回答