DSPRelated.com
Forums

Allpass filter with specific phase response

Started by sparafucile17 April 10, 2008
I don't know how best to describe the type of filter design I'm looking for
but I'll try my best:  I'm looking for a way to design a "roughly" flat
magnitude response with a phase response that I define.

For example I want a "flat" magnitude response, but the phase response of
a 200Hz butterworth LPF.  When I say roughly flat I mean to say that I
define some allowable ripple around 0dB that can still produce the phase
response that I want.

The reason I'm struggling this this is becasue I KNOW I've seen this in a
paper somewhere and I also know I've sen it in Matlab before.  However, I
have been searching online and Matlab to find it again with no luck.  The
problem is I can't remember what that type of filter design is called. 
The name would, of course, help speed up my research... but my aging brain
will not help me!!

Does anyone know what method exists to design an allpass filter with a
specific phase response???

Jeff
On Apr 10, 9:37 am, "sparafucile17" <sparafucil...@hotmail.com> wrote:
> I don't know how best to describe the type of filter design I'm looking for > but I'll try my best: I'm looking for a way to design a "roughly" flat > magnitude response with a phase response that I define. > > For example I want a "flat" magnitude response, but the phase response of > a 200Hz butterworth LPF. When I say roughly flat I mean to say that I > define some allowable ripple around 0dB that can still produce the phase > response that I want.
Just curious: Are you looking for a FIR or an IIR design method?
On Apr 10, 12:37 pm, "sparafucile17" <sparafucil...@hotmail.com>
wrote:
> > Does anyone know what method exists to design an allpass filter with a > specific phase response???
yeah, what Ron said. (if it's FIR, would you tolerate some ripple error in magnitude? or must the magnitude = 0 dB and you design the phase response to within an error constraint?) if it's IIR, you can design cascaded biquad APFs in a similar way as one designs cascaded LPFs. in fact, if what you are looking at is group delay (minus the derivative of phase with frequency) then the APF group delay looks just like an LPF magnitude response of twice the order. is it the actual phase angle you're shooting at or is it the delay associated with it? r b-j
Jeff,

   Recent Matlab has a function called "iirgrpdelay".

   Type "help iirgrpdelay" and you will get the 
   description with example.

Regards
Bharat Pathak

Arithos Designs
www.Arithos.com

DSP design consultancy and training company.



>The reason I'm struggling this this is becasue I KNOW I've seen this in
a
>paper somewhere and I also know I've sen it in Matlab before. However,
I
>have been searching online and Matlab to find it again with no luck.
The
>problem is I can't remember what that type of filter design is called. >The name would, of course, help speed up my research... but my aging
brain
>will not help me!!
>On Apr 10, 9:37 am, "sparafucile17" <sparafucil...@hotmail.com> wrote: >> I don't know how best to describe the type of filter design I'm looking
for
>> but I'll try my best: I'm looking for a way to design a "roughly"
flat
>> magnitude response with a phase response that I define. >> >> For example I want a "flat" magnitude response, but the phase response
of
>> a 200Hz butterworth LPF. When I say roughly flat I mean to say that I >> define some allowable ripple around 0dB that can still produce the
phase
>> response that I want. > >Just curious: Are you looking for a FIR or an IIR design >method? >
Sorry, should have been more specific... I'm looking for an IIR. Just some simple trial an error has showed me that a 1st order allpass has exactly the same response as a 2nd order LPF butterworth. The allpass equation that I'm using comes from RBJ's Audio EQ Cookbook. Still not exactly what I'm looking for, cause I can't input my desired phase response, but it's a least and example of an allpass that has a unique phase response. Your help is greatly appreciated. Jeff
>Jeff, > > Recent Matlab has a function called "iirgrpdelay". > > Type "help iirgrpdelay" and you will get the > description with example. > >Regards >Bharat Pathak > >Arithos Designs >www.Arithos.com > >DSP design consultancy and training company. > > > >>The reason I'm struggling this this is becasue I KNOW I've seen this in >a >>paper somewhere and I also know I've sen it in Matlab before. However, >I >>have been searching online and Matlab to find it again with no luck. >The >>problem is I can't remember what that type of filter design is called. >>The name would, of course, help speed up my research... but my aging >brain >>will not help me!! > >
Yes, I found this filter type in Matlab and unfortunately I don't have the toolbox at work for this feature!!! (Argg) All I'm really looking for is the design behind this function because I need to implement this coefficient calculation on a windows-based program that I'll have to write myself in c-code. So, unfortunately just using the Matlab command (assuming I actually had access to the toolbox) doesn't really help out unless I can get a paper describing the math behind the filter... Jeff
>On Apr 10, 12:37 pm, "sparafucile17" <sparafucil...@hotmail.com> >wrote: >> >> Does anyone know what method exists to design an allpass filter with a >> specific phase response??? > >yeah, what Ron said. (if it's FIR, would you tolerate some ripple >error in magnitude? or must the magnitude = 0 dB and you design the >phase response to within an error constraint?) > >if it's IIR, you can design cascaded biquad APFs in a similar way as >one designs cascaded LPFs. in fact, if what you are looking at is >group delay (minus the derivative of phase with frequency) then the >APF group delay looks just like an LPF magnitude response of twice the >order. > >is it the actual phase angle you're shooting at or is it the delay >associated with it? > >r b-j >
Robert, Excellent questions! I am looking for phase angle in my design, not delay. I replied earlier stating what you just said about the twice the order concept. I discovered this through trial and error in Matlab and it's nice to get confirmation from someone else that the behavior you observed is correct. Here's a tricky question... If an allpass has the same phase response of a LPF twice it's order, how do you match a 1st order LPF!? In theory you'd need a 1/2 order allpass right? How do you design something around that? BTW, This question is currently what is baffling me. If there is another way to create a transfer function of ANYTHING (doesn't have to be an allpass IIR) to match a 1st order LPF butter phase response, I'm up for that as well. - Jeff
sparafucile17 wrote:
>> On Apr 10, 12:37 pm, "sparafucile17" <sparafucil...@hotmail.com> >> wrote: >>> Does anyone know what method exists to design an allpass filter with a >>> specific phase response??? >> yeah, what Ron said. (if it's FIR, would you tolerate some ripple >> error in magnitude? or must the magnitude = 0 dB and you design the >> phase response to within an error constraint?) >> >> if it's IIR, you can design cascaded biquad APFs in a similar way as >> one designs cascaded LPFs. in fact, if what you are looking at is >> group delay (minus the derivative of phase with frequency) then the >> APF group delay looks just like an LPF magnitude response of twice the >> order. >> >> is it the actual phase angle you're shooting at or is it the delay >> associated with it? >> >> r b-j >> > > Robert, > > Excellent questions! I am looking for phase angle in my design, not > delay. I replied earlier stating what you just said about the twice the > order concept. I discovered this through trial and error in Matlab and > it's nice to get confirmation from someone else that the behavior you > observed is correct. > > Here's a tricky question... If an allpass has the same phase response of a > LPF twice it's order, how do you match a 1st order LPF!? In theory you'd > need a 1/2 order allpass right? How do you design something around that? > > BTW, This question is currently what is baffling me. If there is another > way to create a transfer function of ANYTHING (doesn't have to be an > allpass IIR) to match a 1st order LPF butter phase response, I'm up for > that as well.
FYI: A first-order dilter is a degenerate case, It is at once Butterworth, Cauer, Chebychev, and all other filter types. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
> >FYI: A first-order dilter is a degenerate case, It is at once >Butterworth, Cauer, Chebychev, and all other filter types. > >Jerry >-- >Engineering is the art of making what you want from things you can get. >&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533; >
Jerry, I won't argue with you on that one! But let's assume that is a design constraint. I have a 1st order LPF and I need to match it's phase response with an "close-to-no-gain" filter. (for arguements sake let's call it an allpass) As you say in your signature: "Engineering is the art of making what you want from things you can get." Well, I want an allpass and all I get for a design template is a 1st-order LPF. How do I engineer a filter to do that? (BTW, I think I have something that will work for 2nd order and higher LPF's to match-up... It's the 1st order case that eludes me) Thanks guys, Jeff
sparafucile17 wrote:
>> FYI: A first-order dilter is a degenerate case, It is at once >> Butterworth, Cauer, Chebychev, and all other filter types.
...
> Jerry, > > I won't argue with you on that one! But let's assume that is a design > constraint. I have a 1st order LPF and I need to match it's phase response > with an "close-to-no-gain" filter. (for arguements sake let's call it an > allpass) > > As you say in your signature: "Engineering is the art of making what you > want from things you can get." Well, I want an allpass and all I get for a > design template is a 1st-order LPF. > > How do I engineer a filter to do that? > > > (BTW, I think I have something that will work for 2nd order and higher > LPF's to match-up... It's the 1st order case that eludes me)
I don't see how it's possible to specify x=1=2n and at the same time have n be an integer. The problem is not just with first, but with any odd order. All I was saying about the first-order filter is that it can't meaningfully be of a distinct type. For example, the Butterworth LPF design constraint is that the sections be so chosen that all controllable derivatives of the response be zero at f=0. Since every LPF response has its first derivative zero there, there aren't enough degrees of freedom in a first-order filter to apply the constraint. Jerry -- Engineering is the art of making what you want from things you can get.