DSPRelated.com
Forums

Symmetric phase response of an IIR allpass.

Started by gilad August 17, 2006
Hi all,

Does anybody know if there is a way to design a symmetric phase
response allpass iir filter?

I'm able to design a filter with an approximately accurate phase
response compared to a prescribed phase response for the positive
frequencies. However, plotting the phase response of the filter (e.g.
with fvtool(b,a) in matlab) for the full -pi to pi range the negative
phase response is antisymmetric with the positive frequencies (about
the phase at w=0).

Any way around this? I need the angle(H(w)) = angle(H(-w)) where H is
the filter's response.

Thanks,
gilad.

gilad wrote:

> Does anybody know if there is a way to design a symmetric phase > response allpass iir filter?
> I need the angle(H(w)) = angle(H(-w)) where H is the filter's > response.
Except for the trivial case H(z) = 1, that requires a complex impulse response (complex roots of H that don't occur in conjugate pairs) because realness in one domain is equivalent to hermitian symmetry in the other. Martin -- Quidquid latine scriptum sit, altum viditur.
just to add to Martin's response...

gilad wrote:
> Hi all, > > Does anybody know if there is a way to design a symmetric phase > response allpass iir filter? > > I'm able to design a filter with an approximately accurate phase > response compared to a prescribed phase response for the positive > frequencies. However, plotting the phase response of the filter (e.g. > with fvtool(b,a) in matlab) for the full -pi to pi range the negative > phase response is antisymmetric with the positive frequencies (about > the phase at w=0).
as is the phase response for any LTI filter with a real impulse response. this is normal. just as it is normal (and unavoidable) that the magnitude frequency response has even symmetry about w=0.
> Any way around this?
not unless your IIR filter has both real *and* imaginary components to the input and output signals. that would otherwise be thought of as a two input, two output filter (with real inputs and outputs).
> I need the angle(H(w)) = angle(H(-w)) where H is the filter's response.
can't do it. r b-j
gilad wrote:
> Hi all, > > Does anybody know if there is a way to design a symmetric phase > response allpass iir filter? > > I'm able to design a filter with an approximately accurate phase > response compared to a prescribed phase response for the positive > frequencies. However, plotting the phase response of the filter (e.g. > with fvtool(b,a) in matlab) for the full -pi to pi range the negative > phase response is antisymmetric with the positive frequencies (about > the phase at w=0). > > Any way around this? I need the angle(H(w)) = angle(H(-w)) where H is > the filter's response.
Is your question how to transform a given H(w) which has Hermitian symmetry, ie. H(-w) = H(w)* into a H'(w) which has H'(w) = H(w), for 0 <= w <= pi, and H'(-w) = H'(w) ? Regards, Andor
In article <1155867188.122360.254290@b28g2000cwb.googlegroups.com>,
 "robert bristow-johnson" <rbj@audioimagination.com> wrote:

> just to add to Martin's response... > > gilad wrote: > > Hi all, > > > > Does anybody know if there is a way to design a symmetric phase > > response allpass iir filter? > > > > I'm able to design a filter with an approximately accurate phase > > response compared to a prescribed phase response for the positive > > frequencies. However, plotting the phase response of the filter (e.g. > > with fvtool(b,a) in matlab) for the full -pi to pi range the negative > > phase response is antisymmetric with the positive frequencies (about > > the phase at w=0). > > as is the phase response for any LTI filter with a real impulse > response. this is normal. just as it is normal (and unavoidable) that > the magnitude frequency response has even symmetry about w=0. > > > Any way around this? > > not unless your IIR filter has both real *and* imaginary components to > the input and output signals. that would otherwise be thought of as a > two input, two output filter (with real inputs and outputs). > > > I need the angle(H(w)) = angle(H(-w)) where H is the filter's response. > > can't do it.
If your input can be broken into separate, bufferable vectors, you can obtain the desired result by constructing two filters such that, if H is the desired response, H = (H1)(H2). Then reverse the direction of your input after applying H1... y(n)=x(n) conv h1 z(-n) = y(-n) conv h2 HTH, Ken P.
Andor wrote:
> gilad wrote: > > Hi all, > > > > Does anybody know if there is a way to design a symmetric phase > > response allpass iir filter? > > > > I'm able to design a filter with an approximately accurate phase > > response compared to a prescribed phase response for the positive > > frequencies. However, plotting the phase response of the filter (e.g. > > with fvtool(b,a) in matlab) for the full -pi to pi range the negative > > phase response is antisymmetric with the positive frequencies (about > > the phase at w=0). > > > > Any way around this? I need the angle(H(w)) = angle(H(-w)) where H is > > the filter's response. > > Is your question how to transform a given H(w) which has Hermitian > symmetry, ie. > > H(-w) = H(w)* > > into a H'(w) which has > > H'(w) = H(w), for 0 <= w <= pi, > > and > > H'(-w) = H'(w) > > ? > > Regards, > Andor
Yes, Andor, this is exactly my question.
gilad wrote:
> Andor wrote: > > gilad wrote: > > > Hi all, > > > > > > Does anybody know if there is a way to design a symmetric phase > > > response allpass iir filter? > > > > > > I'm able to design a filter with an approximately accurate phase > > > response compared to a prescribed phase response for the positive > > > frequencies. However, plotting the phase response of the filter (e.g. > > > with fvtool(b,a) in matlab) for the full -pi to pi range the negative > > > phase response is antisymmetric with the positive frequencies (about > > > the phase at w=0). > > > > > > Any way around this? I need the angle(H(w)) = angle(H(-w)) where H is > > > the filter's response. > > > > Is your question how to transform a given H(w) which has Hermitian > > symmetry, ie. > > > > H(-w) = H(w)* > > > > into a H'(w) which has > > > > H'(w) = H(w), for 0 <= w <= pi, > > > > and > > > > H'(-w) = H'(w) > > > > ? > > > > Regards, > > Andor > > Yes, Andor, this is exactly my question.
I'm not sure whether you'll like the answer. It goes like this: Let R(w) be the (linear-phase) brickwall lowpass filter with cutoff pi/2, ie | R(w) | = 1, -pi/2 <= w <= pi/2, | R(w) | = 0, else. Then G(w) = R(w - pi/2) H(w) is the positive frequency part of your filter, and therefore H'(w) = G(w) + G(-w) = R(w - pi/2) H(w) + R(pi/2 - w) H(-w) has the required symmetry property. If your filter H has a rational transfer function, then you can try to approximate the onesided rectangular filters also by rational transfer functions. The approximation is never exact, though (watch out for the phase distortion at DC and Nyquist due to R of your approximate allpass filter). You can start by designing a rational transfer function lowpass R(w), and then apply the pi/2 frequency shifts to the left and the right. This results in complex coefficients and a complex impulse response, as others have pointed out. Or you can implement the filter H'(w) with an FIR approximation. The impulse responses of the shifted rectangular filters follow from the shift theorem. Regards, Andor
Ken Prager wrote:
> > If your input can be broken into separate, bufferable vectors, you can > obtain the desired result by constructing two filters such that, if H is > the desired response, H = (H1)(H2). Then reverse the direction of your > input after applying H1... > > y(n)=x(n) conv h1 > z(-n) = y(-n) conv h2
this sounds like FILTFILT() which results in a constant delay or linear phase. but linear phase is also odd-symmetry. the OP wants even-symmetry which can't be done with a purely real impulse respone. so i'm not sure i get the point. r b-j
In article <1155917648.612228.152080@m73g2000cwd.googlegroups.com>,
 "robert bristow-johnson" <rbj@audioimagination.com> wrote:

> Ken Prager wrote: > > > > If your input can be broken into separate, bufferable vectors, you can > > obtain the desired result by constructing two filters such that, if H is > > the desired response, H = (H1)(H2). Then reverse the direction of your > > input after applying H1... > > > > y(n)=x(n) conv h1 > > z(-n) = y(-n) conv h2 > > this sounds like FILTFILT() which results in a constant delay or linear > phase. but linear phase is also odd-symmetry. the OP wants > even-symmetry which can't be done with a purely real impulse respone. > so i'm not sure i get the point. > > r b-j
Doh, I didn't take the time to understand the OP's question. (and to think I wasted my once-a-year posting answering the wrong question.) KP
Andor wrote:
> gilad wrote: > > Andor wrote: > > > gilad wrote:
...
> > > > Any way around this? I need the angle(H(w)) = angle(H(-w)) where H is > > > > the filter's response. > > > > > > Is your question how to transform a given H(w) which has Hermitian > > > symmetry, ie. > > > > > > H(-w) = H(w)* > > > > > > into a H'(w) which has > > > > > > H'(w) = H(w), for 0 <= w <= pi, > > > > > > and > > > > > > H'(-w) = H'(w) > > > > > > ? > > > > > > > Yes, Andor, this is exactly my question. > > I'm not sure whether you'll like the answer. It goes like this:
Andor, i dunno if i like the answer. if H'(-w) = H'(w) for all w (or |w|<pi, same thing), then the same must be true for the real and imaginary parts. Hr'(-w) = Hr'(w) and Hi'(-w) = Hi'(w) where H'(w) = Hr'(w) + j*Hi'(w). both Hr'() and Hi'() are real functions of a single variable. we know that the F.T. and inverse F.T. of a real and even symmetry function is itself real and with even symmetry. so the impulse response h'(t) = iFT{ H'(w) } = iFT{ Hr'(w) + j*Hi'(w) } = hr'(t) + j*hi'(t) where both hr'() and hi'() are real functions with even symmetry. the only way for the impulse response to be real is if hi'() and Hi'() are identically zero. he can have his even symmetry as long as there is no phase shift (outside of polarity inversion). can't have it any other way except to have a filter that has imaginary output (as well as real output). r b-j