# Phase-shift filter design

If a time-domain signal has sharp corners, its frequency spectrum will contain high-frequency components. Truncating the spectrum results in Gibbs' phenomenon. So if you're trying to design an FIR, you really want the target frequency response to be nice and smooth so that windowing the impulse response down to a finite length doesn't distort the frequency response too much.

Currently I'm contemplating trying to design a very strange filter: One that has unit gain at all frequencies, but non-zero phase. I'm wondering whether or not a similar phenomenon occurs: If the filter has unit gain at all frequencies, then what does truncating the impulse response do to the phase alignment?

• Just a side note: this type of filter is called all-pass filter. A Hilbert filter is a practical example thereof. – Deve Jul 20 '12 at 11:13
• Actually, this isn't a "very strange" type of filter at all. If you're designing a new allpass filter, why would you be truncating its impulse response? You can calculate the exact response of a digital filter (down to your numeric precision) at design time. – Jason R Jul 20 '12 at 12:48
• Truncating the spectrum causes ringing, not Gibbs phenomenon. Those are different things. – Phonon Jul 20 '12 at 12:54
• @Phonon, I don't see how the effect is different. Regardless of which domain(time/freq) a jump discontinuity occurs, the other domain experiences an infinitely long effect. – Mark Borgerding Jul 20 '12 at 15:31
• @MarkBorgerding What you're saying is absolutely correct, but that's not what Gibbs phenomenon is. Gibbs phenomenon refers to a single-point peak in the waveform at the discontinuity when the Fourier series "converges" to a rect waveform, which is to say that the rect does not go from $1$ to $0$, but rather from $1$ to $k>1$ to 0. – Phonon Jul 20 '12 at 15:37

This would be an allpass filter. Except for the trivial case of unity and integer-sample delays, these can't be done as FIR filters and in general an IIR filter is required. However, they are easy to make. The zeroes of an allpass are simply the inverse of the poles (and vice versa). If you have the poles in polynomial form, you can simply flip them to get the zero polynomials. For example a second order allpass looks like this $$H(z)=\frac{a_{2}\cdot z^{0} + a_{1}\cdot z^{-1} + a_{0}\cdot z^{-2}}{a_{0}\cdot z^{0} + a_{1}\cdot z^{-1} + a_{2}\cdot z^{-2}}$$ Strict allpass filter have $\left \|H(e^{j\cdot \omega })\right \|=1$ for all frequencies. You can certainly design approximation using FIR filters if you only need this property for a limited frequency range and if the magnitude doesn't have to be exactly unity.