# Is there a way in MATLAB to approximate an FIR filter using an IIR Filter? [duplicate]

I am a student trying to understand how this is possible. I've done some research on the web with not many sources showing up with solutions to this problem that are usable. What techniques are used to give an approximation of an FIR filter using IIR filters with say the same order?

• What is your reason for wanting to do this? I was under the impression that in most cases an FIR filter would be preferred so trying to understand the motivation and possible advantages – Dan Boschen Apr 23 '20 at 1:57
• Does this answer your question? dsp.stackexchange.com/questions/27085/… – Dan Boschen Apr 23 '20 at 1:59
• I am looking for more specifically how to code it in Matlab. I am a beginner coder and am not very good at coding – user Apr 23 '20 at 3:28
• I suggest writing out the pseudo-code of what you would implement, derived from the other link to get to the root of your question, and then if there is a signal processing question you could ask that here- but if it is truly just specific to MATLAB coding you should probably ask that on StackOverflow – Dan Boschen Apr 23 '20 at 10:53

The simplest version would be to calculate the transfer function of your FIR filter, sample it on some meaningful frequency grid and then shove it into invfreqz() to design the IIR filter.