Why does the FIRPM function yield different output in MATLAB

Illustration
camillajoy - 2021-03-17T11:36:17+00:00
Question: Why does the FIRPM function yield different output in MATLAB

Why does the FIRPM function yield different output in MATLAB 7.2 (R2006a) and MATLAB 7.3 (R2006b)? The following code produced different figures in MATLAB 7.2 (R2006a) and  MATLAB 7.3 (R2006b)     Ts = 0.0005; Fs = 1/(2*Ts); lgrid=256; F=[0:0.1:1000]; %lgrid=16; m2=2; m3=4; Fsn3=Fs/m3; N3=40; f3=[ 0.0/Fsn3 0.01/Fsn3 ... 30.0/Fsn3 Fsn3/Fsn3 ... ]; w3=[ 1 ... 1 ... ]; a3=[ 1 1 ... 0 0 ... ]; fresp = {'pre',a3,m2,m3}; h3=firpm(N3,f3,fresp,w3); h3=h3./sum(h3); H3=freqz(h3,1,F,Fsn3*2); figure; semilogx(F,20*log10(abs(H3)),'b'); xlabel('Frequency(Hz)');ylabel('Gain(dB)'); legend('1st stage'); axis([1 1000 -120 20]); grid; title('firpm')  

Expert Answer

Profile picture of Neeta Dsouza Neeta Dsouza answered . 2025-11-20

This is the expected behavior in MATLAB. The difference between releases in the function FIRPM is due to a new FIRPM algorithm being implemented in MATLAB 7.3 (R2006b). If you would like to use the old algorithm instead, it is still available by calling the function FIRPMMEX within MATLAB 7.3 (R2006b).

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!