# Construct Postfilter for overall Minimum or Linear Phase Filter

I have a given FIR filter impulse response $h[k]$ for a linear system $y[k] = x[k] \star h[k]$. $x$ is some input, $y$ is the output of the system.

My goal is to construct a postfilter $g[k]$, so that we have $y[k] = x[k] \star h[k] \star g[k]$ with $h_{\rm overall}[k] = h[k] \star g[k]$ being minimum phase.

Though $h$ can vary, it will in general always have most of its zeros on the unit circle.

Question now: How can we construct $g[k]$? My original approach is quite simple:

• Let $a_i$ be zero of $h$ outside the unit circle, then form $G_i(z) = \displaystyle\frac{z - 1/a^\ast}{z-a}$
• Form the overall $G$ as $G(z) = \displaystyle\prod_i G_i(z)$

In theory this should work, right?

I implemented this approach in MATLAB and the results are completely useless. My assumption would be that there are (if my approach is correct) are of numerical nature. So my questions are:

1. Is my approach described above correct?
2. How can I implement this in Matlab the best way?

What you're trying to do is impossible to implement (i.e., if we require that the post-filter is causal and stable). If the original filter $h[n]$ is not already a minimum-phase filter, it has zeros outside the unit circle. These zeros need to be compensated for by the post-filter $g[n]$, i.e., the filter $g[n]$ must have poles outside the unit circle, and, consequently, it cannot be causal and stable.
On the other hand, constructing a linear phase filter using a post-filter is possible. Just make sure that for each zero $z_{0,i}$ of the filter $h[n]$, the post-filter $g[n]$ has a zero at $1/z^*_{0,i}$, i.e., for each zero you need another one mirrored across the unit circle.