Why does the FIRPM function yield different output in MATLAB

C
camillajoy · Mar 17, 2021 · 2.2K views
Question
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 PhD Expert
Answered Aug 15, 2026
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).

 

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!