From: Pawel on
Dear All,

Maybe one of You Gurus would be able to shed to confirm (or criticise)
my way of thinking. I am not DSP expert I am just trying to use DSP
methods in other fields of science.
My question relate to an all-pass filter structure: H(z)=z^-N[A(z^-1)/
A(z)]. The problem that I am trying to solve do not easily tolerate N
sample delay z^-N.
1. So I thought that it might be possible to express all-pass function
as a cascade of anti-causal FIR filter A(z^-1) and causal IIR 1/A(z)
effectively eliminating the excess delay z^-N that it is there to only
make A(z^-1) causal. My application is offline so it can be
implemented as a backward filtering?
2. Therefore my H_1=A(z^-1)/A(z), now how do I find inverse of it
H_1inv=A(z)/A(z^-1). 1/A(z^-1) will be unstable since its poles will
be inside the unit circle (A(z^-1) zeros where inside the circle),
however I can resort again to the noncausal filtering and treat
A(z^-1) as causal that would give me a stable filter?
3. How do I invert filter H_1?
4. What would be pitfalls when I would try to implement this in
reality for offline processing – I know that there might be some
problems with initial conditions in forward filtering?

Regards

Pawel
From: Tim Wescott on
On 07/20/2010 01:04 PM, Pawel wrote:
> Dear All,
>
> Maybe one of You Gurus would be able to shed to confirm (or criticise)
> my way of thinking. I am not DSP expert I am just trying to use DSP
> methods in other fields of science.
> My question relate to an all-pass filter structure: H(z)=z^-N[A(z^-1)/
> A(z)]. The problem that I am trying to solve do not easily tolerate N
> sample delay z^-N.
> 1. So I thought that it might be possible to express all-pass function
> as a cascade of anti-causal FIR filter A(z^-1) and causal IIR 1/A(z)
> effectively eliminating the excess delay z^-N that it is there to only
> make A(z^-1) causal. My application is offline so it can be
> implemented as a backward filtering?
> 2. Therefore my H_1=A(z^-1)/A(z), now how do I find inverse of it
> H_1inv=A(z)/A(z^-1). 1/A(z^-1) will be unstable since its poles will
> be inside the unit circle (A(z^-1) zeros where inside the circle),
> however I can resort again to the noncausal filtering and treat
> A(z^-1) as causal that would give me a stable filter?
> 3. How do I invert filter H_1?
> 4. What would be pitfalls when I would try to implement this in
> reality for offline processing � I know that there might be some
> problems with initial conditions in forward filtering?

What are you really trying to do?

By definition, a useful all-pass filter has delay, at least at some
frequencies. It must, because a slope in the phase of a filter's
transfer function in the frequency domain translates to a delay (or
prediction) in the time domain. So the best that you can do is to run
your all-pass filter in just one direction, then shift the answer (which
you can do because you're running off line) to get the least overall
delay, or the least delay "where it matters".

Note that this problem with allpass vs. phase delay is evinced a bit if
you think about your question 2: Work out the math, and you'll find
that H_1 * H_1inv is the only no-delay allpass filter in existence: H = 1.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" was written for you.
See details at http://www.wescottdesign.com/actfes/actfes.html
From: Pawel on
On Jul 20, 9:30 pm, Tim Wescott <t...(a)seemywebsite.com> wrote:
> On 07/20/2010 01:04 PM, Pawel wrote:
>
>
>
> > Dear All,
>
> > Maybe one of You Gurus would be able to shed to confirm (or criticise)
> > my way of thinking. I am not DSP expert I am just trying to use DSP
> > methods in other fields of science.
> > My question relate to an all-pass filter structure: H(z)=z^-N[A(z^-1)/
> > A(z)]. The problem that I am trying to solve do not easily tolerate N
> > sample delay z^-N.
> > 1. So I thought that it might be possible to express all-pass function
> > as a cascade of anti-causal FIR filter A(z^-1) and causal IIR 1/A(z)
> > effectively eliminating the excess delay z^-N that it is there to only
> > make A(z^-1) causal. My application is offline so it can be
> > implemented as a backward filtering?
> > 2. Therefore my H_1=A(z^-1)/A(z), now how do I find inverse of it
> > H_1inv=A(z)/A(z^-1).  1/A(z^-1) will be unstable since its poles will
> > be inside the unit circle (A(z^-1) zeros where inside the circle),
> > however I can resort again to the noncausal filtering and treat
> > A(z^-1) as causal that would give me a stable filter?
> > 3. How do I invert filter H_1?
> > 4. What would be pitfalls when I would try to implement this in
> > reality for offline processing – I know that there might be some
> > problems with initial conditions in forward filtering?
>
> What are you really trying to do?
>
> By definition, a useful all-pass filter has delay, at least at some
> frequencies.  It must, because a slope in the phase of a filter's
> transfer function in the frequency domain translates to a delay (or
> prediction) in the time domain.  So the best that you can do is to run
> your all-pass filter in just one direction, then shift the answer (which
> you can do because you're running off line) to get the least overall
> delay, or the least delay "where it matters".
>
> Note that this problem with allpass vs. phase delay is evinced a bit if
> you think about your question 2:  Work out the math, and you'll find
> that H_1 * H_1inv is the only no-delay allpass filter in existence: H = 1.
>
> --
>
> Tim Wescott
> Wescott Design Serviceshttp://www.wescottdesign.com
>
> Do you need to implement control loops in software?
> "Applied Control Theory for Embedded Systems" was written for you.
> See details athttp://www.wescottdesign.com/actfes/actfes.html

Tim,

Foremost thanks a lot for reply.
My application is in the area of microwave engineering and microwave
filter design. I am working on an algortihm that allows to include
some defficiences of the transmission lines of which filter is built
to be included in the design procedure and their influence
eliminated.

Anyway, I do not want zero delay but I want to retain only nonlinear
portion of the all-pass phase shift - z^-N is an artifact coming from
the fact that usually one is interested in the causal filter. Would my
concept as outlined in the question 1 retain this nonlinear phase
shift or I am misinterpreting something?

Pawel
From: Tim Wescott on
On 07/20/2010 01:50 PM, Pawel wrote:
> On Jul 20, 9:30 pm, Tim Wescott<t...(a)seemywebsite.com> wrote:
>> On 07/20/2010 01:04 PM, Pawel wrote:
>>
>>
>>
>>> Dear All,
>>
>>> Maybe one of You Gurus would be able to shed to confirm (or criticise)
>>> my way of thinking. I am not DSP expert I am just trying to use DSP
>>> methods in other fields of science.
>>> My question relate to an all-pass filter structure: H(z)=z^-N[A(z^-1)/
>>> A(z)]. The problem that I am trying to solve do not easily tolerate N
>>> sample delay z^-N.
>>> 1. So I thought that it might be possible to express all-pass function
>>> as a cascade of anti-causal FIR filter A(z^-1) and causal IIR 1/A(z)
>>> effectively eliminating the excess delay z^-N that it is there to only
>>> make A(z^-1) causal. My application is offline so it can be
>>> implemented as a backward filtering?
>>> 2. Therefore my H_1=A(z^-1)/A(z), now how do I find inverse of it
>>> H_1inv=A(z)/A(z^-1). 1/A(z^-1) will be unstable since its poles will
>>> be inside the unit circle (A(z^-1) zeros where inside the circle),
>>> however I can resort again to the noncausal filtering and treat
>>> A(z^-1) as causal that would give me a stable filter?
>>> 3. How do I invert filter H_1?
>>> 4. What would be pitfalls when I would try to implement this in
>>> reality for offline processing � I know that there might be some
>>> problems with initial conditions in forward filtering?
>>
>> What are you really trying to do?
>>
>> By definition, a useful all-pass filter has delay, at least at some
>> frequencies. It must, because a slope in the phase of a filter's
>> transfer function in the frequency domain translates to a delay (or
>> prediction) in the time domain. So the best that you can do is to run
>> your all-pass filter in just one direction, then shift the answer (which
>> you can do because you're running off line) to get the least overall
>> delay, or the least delay "where it matters".
>>
>> Note that this problem with allpass vs. phase delay is evinced a bit if
>> you think about your question 2: Work out the math, and you'll find
>> that H_1 * H_1inv is the only no-delay allpass filter in existence: H = 1.
>>
>> --
>>
>> Tim Wescott
>> Wescott Design Serviceshttp://www.wescottdesign.com
>>
>> Do you need to implement control loops in software?
>> "Applied Control Theory for Embedded Systems" was written for you.
>> See details athttp://www.wescottdesign.com/actfes/actfes.html
>
> Tim,
>
> Foremost thanks a lot for reply.
> My application is in the area of microwave engineering and microwave
> filter design. I am working on an algortihm that allows to include
> some defficiences of the transmission lines of which filter is built
> to be included in the design procedure and their influence
> eliminated.
>
> Anyway, I do not want zero delay but I want to retain only nonlinear
> portion of the all-pass phase shift - z^-N is an artifact coming from
> the fact that usually one is interested in the causal filter. Would my
> concept as outlined in the question 1 retain this nonlinear phase
> shift or I am misinterpreting something?

What is A(z) in your definition above? I ask, because the "control
engineer's formulation" of an IIR filter would have

A(z) = a_N * z^N + ... + a_1 * z + a_0,

while the "DSP engineer's formulation" of an IIR filter would have

A(z) = a_N / z^N + ... + a_1 / z + a_0.

In the former case, A(1/z) would have a be perfectly causal, if delayed.
In the latter case A(1/z) would, indeed, have substantial lead that
would have to be corrected with the z^-N term. You could leave it off
if you're not interested in causality.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" was written for you.
See details at http://www.wescottdesign.com/actfes/actfes.html
From: Pawel on
On Jul 20, 10:22 pm, Tim Wescott <t...(a)seemywebsite.com> wrote:
> On 07/20/2010 01:50 PM, Pawel wrote:
>
>
>
> > On Jul 20, 9:30 pm, Tim Wescott<t...(a)seemywebsite.com>  wrote:
> >> On 07/20/2010 01:04 PM, Pawel wrote:
>
> >>> Dear All,
>
> >>> Maybe one of You Gurus would be able to shed to confirm (or criticise)
> >>> my way of thinking. I am not DSP expert I am just trying to use DSP
> >>> methods in other fields of science.
> >>> My question relate to an all-pass filter structure: H(z)=z^-N[A(z^-1)/
> >>> A(z)]. The problem that I am trying to solve do not easily tolerate N
> >>> sample delay z^-N.
> >>> 1. So I thought that it might be possible to express all-pass function
> >>> as a cascade of anti-causal FIR filter A(z^-1) and causal IIR 1/A(z)
> >>> effectively eliminating the excess delay z^-N that it is there to only
> >>> make A(z^-1) causal. My application is offline so it can be
> >>> implemented as a backward filtering?
> >>> 2. Therefore my H_1=A(z^-1)/A(z), now how do I find inverse of it
> >>> H_1inv=A(z)/A(z^-1).  1/A(z^-1) will be unstable since its poles will
> >>> be inside the unit circle (A(z^-1) zeros where inside the circle),
> >>> however I can resort again to the noncausal filtering and treat
> >>> A(z^-1) as causal that would give me a stable filter?
> >>> 3. How do I invert filter H_1?
> >>> 4. What would be pitfalls when I would try to implement this in
> >>> reality for offline processing – I know that there might be some
> >>> problems with initial conditions in forward filtering?
>
> >> What are you really trying to do?
>
> >> By definition, a useful all-pass filter has delay, at least at some
> >> frequencies.  It must, because a slope in the phase of a filter's
> >> transfer function in the frequency domain translates to a delay (or
> >> prediction) in the time domain.  So the best that you can do is to run
> >> your all-pass filter in just one direction, then shift the answer (which
> >> you can do because you're running off line) to get the least overall
> >> delay, or the least delay "where it matters".
>
> >> Note that this problem with allpass vs. phase delay is evinced a bit if
> >> you think about your question 2:  Work out the math, and you'll find
> >> that H_1 * H_1inv is the only no-delay allpass filter in existence: H = 1.
>
> >> --
>
> >> Tim Wescott
> >> Wescott Design Serviceshttp://www.wescottdesign.com
>
> >> Do you need to implement control loops in software?
> >> "Applied Control Theory for Embedded Systems" was written for you.
> >> See details athttp://www.wescottdesign.com/actfes/actfes.html
>
> > Tim,
>
> > Foremost thanks a lot for reply.
> > My application is in the area of microwave engineering and microwave
> > filter design. I am working on an algortihm that allows to include
> > some defficiences of the transmission lines of which filter is built
> > to be included in the design procedure and their influence
> > eliminated.
>
> > Anyway, I do not want zero delay but I want to retain only nonlinear
> > portion of the all-pass phase shift - z^-N is an artifact coming from
> > the fact that usually one is interested in the causal filter. Would my
> > concept as outlined in the question 1 retain this nonlinear phase
> > shift or I am misinterpreting something?
>
> What is A(z) in your definition above?  I ask, because the "control
> engineer's formulation" of an IIR filter would have
>
> A(z) = a_N * z^N + ... + a_1 * z + a_0,
>
> while the "DSP engineer's formulation" of an IIR filter would have
>
> A(z) = a_N / z^N + ... + a_1 / z + a_0.
>
> In the former case, A(1/z) would have a be perfectly causal, if delayed.
>   In the latter case A(1/z) would, indeed, have substantial lead that
> would have to be corrected with the z^-N term.  You could leave it off
> if you're not interested in causality.
>
> --
>
> Tim Wescott
> Wescott Design Serviceshttp://www.wescottdesign.com
>
> Do you need to implement control loops in software?
> "Applied Control Theory for Embedded Systems" was written for you.
> See details athttp://www.wescottdesign.com/actfes/actfes.html

I define A(z) as a_0+a_1z^-1+a_2z^-2+...+a_Nz^-N - which of those
above mentioned cases would it be - forgive me my stupid question?

Pawel