The goal of this project was the implementation of a full analogue of iirlpnorm Matlab function being a part of DSP System Toolbox. The function is for the synthesis of Infinite Impulse Response (IIR) digital filter with piecewise-linear amplitude response using least-weighted-P^{th} approximation. It is not an open-source function in contrast to many other Matlab functions.

A quasi-Newton minimizer in couple with a simplex line searcher are employed in the heart of our program. Since the objective function is very jagged, it was decided to use a two-stage optimization strategy with two objective functions minimized in sequence. The first objective function being a rough approximation of the second (true) objective function has a virtue of smoothness. It allows us to obtain a good initial estimate for the second stage of optimization.

The program was implemented in C++ with the usage of Intel® Math Kernel Library for polynomial roots finding. (The roots are found as eigenvalues of the associated companion matrix.)

The original Matlab function does not allow watching the convergence process. However, we provided such possibility in our function through intermediate data dumping mechanism. The process is shown in the next video for several test cases. We used Matlab with its rich visualization functionality for the preparation this video.

In general case, ideal fitting of a piecewise-linear amplitude response can be accomplished only with an IIR filter of infinite order. Despite this, we used a model with only 10 zeros and 15 poles in all the tests. Also, we used the same initial estimate shown at start of the video.

Implementation of the two-stage optimization strategy allowed us to achieve convergence in some cases where the original Matlab function didn’t find the solution (e.g. in Test 3 shown in the video).

**Languages:** C++

______________________________

* *

*
― Jeff Polk
*

“There’s no obfuscated Perl contest because it’s pointless.”