DSPRelated.com
Forums

How do All-Pass Filters Work?

Started by Chris Barrett May 21, 2007
All a highpass, lowpass, bandpass, or band stop filters is, is a 
discrete numerical solutions to differential equation.  Is this also 
true for all-pass filters?  Is there some continuous time equation that 
functions as an all-pass filter?  What I am getting at is: How does an 
all pass filter change the phase of a signal?
On Mon, 21 May 2007 11:29:20 -0400, Chris Barrett wrote:

> All a highpass, lowpass, bandpass, or band stop filters is, is a > discrete numerical solutions to differential equation.
Mostly, yes. To be precise, in continuous time such a filter can be _modeled_ by a differential equation, and in discrete time a filter can be _implemented_ as a _difference_ equation.
> Is this also > true for all-pass filters?
Yes.
> Is there some continuous time equation that > functions as an all-pass filter?
Yes, and there are physical realizations, also. One can do this with op-amps, or even with capacitors and coils -- although you'll need at least some of those coils to be transformers, if you want an entirely passive network.
> What I am getting at is: How does an > all pass filter change the phase of a signal?
An all pass filter changes the phase (but not the amplitude) of a signal by pairing a stable pole (be it resonant or not) with an unstable zero. In a continuous-time system this boils down to a Laplace transfer function with pairs that go like: T(s) = product of ((s - a_k) / (s + a_k)) where every a_k is stable (i.e. it has a positive real part) and, if it's complex, a conjugate to keep the description real. In a discrete-time IIR filter this boils down to a z-domain transfer function with pairs that go like T(z) = (gain adjust) * product of ((z - 1/a_k) / (z - a_k)) Again, every a_k must be stable (in this case it must follow |a_k| < 1), and any complex a_k must have a conjugate. For an FIR filter your job is conceptually easier: just gin up the phase vs. frequency response you want, accept the fact that you're going to need a really, really long FIR, and go to it. -- Tim Wescott Control systems and communications consulting http://www.wescottdesign.com Need to learn how to apply control theory in your embedded system? "Applied Control Theory for Embedded Systems" by Tim Wescott Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
Chris Barrett wrote:
> All a highpass, lowpass, bandpass, or band stop filters is, is a > discrete numerical solutions to differential equation. Is this also > true for all-pass filters? Is there some continuous time equation that > functions as an all-pass filter? What I am getting at is: How does an > all pass filter change the phase of a signal?
Do you understand how an analog all-pass works? If not (and you can hack simple circuit theory) you might find it instructive. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
Chris Barrett wrote:
> All a highpass, lowpass, bandpass, or band stop filters is, is a > discrete numerical solutions to differential equation. > Is this also true for all-pass filters? Is there some > continuous time equation that functions as an all-pass filter?
Sure. Just take the (discrete) impulse response of some allpass examples that you can find here, http://www-ccrma.stanford.edu/~jos/waveguide/Example_Allpass_Filters.html then use sinc-interpolation to get the impulse response of a continuous-time allpass system.
> What I am getting at is: How does an > all pass filter change the phase of a signal?
Here is a simple allpass: http://www-ccrma.stanford.edu/~jos/waveguide/Allpass_Two_Combs.html The trick is to cancel every pole inside the unit circle with a corresponding zero reflected about the unit circle. The recursive part of the allpass is minimum phase, the transversal part is maximum phase. Regards, Andor
Tim Wescott wrote:
> On Mon, 21 May 2007 11:29:20 -0400, Chris Barrett wrote:
...
>> Is there some continuous time equation that >> functions as an all-pass filter? > > Yes, and there are physical realizations, also. One can do this with > op-amps, or even with capacitors and coils -- although you'll need at > least some of those coils to be transformers, if you want an entirely > passive network.
For a simple example, consider a transformer with a center-tapped secondary. Ground the secondary and connect one end to the (infinite impedance) load with a resistor, the other end with a capacitor. The output amplitude is constant for constant-amplitude input to the primary. High and low frequencies have their relative phase shifted 180 degrees. The phase is quadrature at w = 1/RC. ... Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
I wrote:
> Chris Barrett wrote: > > All a highpass, lowpass, bandpass, or band stop filters is, is a > > discrete numerical solutions to differential equation. > > Is this also true for all-pass filters? Is there some > > continuous time equation that functions as an all-pass filter? > > Sure. Just take the (discrete) impulse response of some allpass > examples that you can find here, > > http://www-ccrma.stanford.edu/~jos/waveguide/Example_Allpass_Filters.... > > then use sinc-interpolation to get the impulse response of a > continuous-time allpass system.
Oops. That's not an allpass system ...
Jerry Avins wrote:
> Tim Wescott wrote: >> On Mon, 21 May 2007 11:29:20 -0400, Chris Barrett wrote: > > ... > >>> Is there some continuous time equation that >>> functions as an all-pass filter? >> >> Yes, and there are physical realizations, also. One can do this with >> op-amps, or even with capacitors and coils -- although you'll need at >> least some of those coils to be transformers, if you want an entirely >> passive network. > > For a simple example, consider a transformer with a center-tapped > secondary. Ground the secondary and connect one end to the (infinite > impedance) load with a resistor, the other end with a capacitor. The > output amplitude is constant for constant-amplitude input to the > primary. High and low frequencies have their relative phase shifted 180 > degrees. The phase is quadrature at w = 1/RC.
I got an email requesting that I provide a mathematical justification of my example above. I won't, because there's a more elegant way. Plot the output across the open-circuit load on the complex voltage plane in the usual orientation: positive real to the right, positive imaginary up. Connect the capacitor to the secondary end marked positive and the resistor to the other. (The center tap is at the origin, of course.) The phasor from the origin to the load represents the output voltage in amplitude and phase. At very high frequencies, the capacitor is a short, and the output is on the real axis at a distance represented by the signal's magnitude, say A. At very low frequencies, the output phasor again lies on the real axis, this time pointing left. The currents through the resistor and capacitor are of course the same, so the phasors representing their voltages must be perpendicular. The resistor phasor starts from [-A, 0], the capacitor phasor starts from {+A, 0], and they meet at the output node at right angles. Clearly, the locus of possible meeting points is a semicircle. The output phasor runs from the origin to a point on that semicircle. It's length is clearly constant. I could have proved the same with a little algebra and less typing, but the ideas expressed wouldn't have been as compelling or memorable. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
Jerry Avins wrote:
> Chris Barrett wrote: > >> All a highpass, lowpass, bandpass, or band stop filters is, is a >> discrete numerical solutions to differential equation. Is this also >> true for all-pass filters? Is there some continuous time equation >> that functions as an all-pass filter? What I am getting at is: How >> does an all pass filter change the phase of a signal? > > > Do you understand how an analog all-pass works? If not (and you can hack > simple circuit theory) you might find it instructive. > > Jerry
No. I was hoping I could figure this out mathematically. It seemed to worked for basic equalization filters.
Chris Barrett wrote:
> Jerry Avins wrote: >> Chris Barrett wrote: >> >>> All a highpass, lowpass, bandpass, or band stop filters is, is a >>> discrete numerical solutions to differential equation. Is this also >>> true for all-pass filters? Is there some continuous time equation >>> that functions as an all-pass filter? What I am getting at is: How >>> does an all pass filter change the phase of a signal? >> >> >> Do you understand how an analog all-pass works? If not (and you can >> hack simple circuit theory) you might find it instructive. >> >> Jerry > > No. I was hoping I could figure this out mathematically. It seemed to > worked for basic equalization filters.
Well, circuit theory is math applied to Kirchoff's laws. Of course, EEs learn some shortcuts so they don't have to go back to first principles every time. Make two voltage dividers using three equal resistors and one capacitor. Calculate the open-circuit voltage as a function of frequency that can be measured from tap to tap. You will find that you have written the equation of an analog all-pass filter very similar to the one I described. (You deserve for the world to know that it was not you who asked for its mathematical analysis.) Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
Jerry Avins wrote:
> Chris Barrett wrote: > >> Jerry Avins wrote: >> >>> Chris Barrett wrote: >>> >>>> All a highpass, lowpass, bandpass, or band stop filters is, is a >>>> discrete numerical solutions to differential equation. Is this also >>>> true for all-pass filters? Is there some continuous time equation >>>> that functions as an all-pass filter? What I am getting at is: How >>>> does an all pass filter change the phase of a signal? >>> >>> >>> >>> Do you understand how an analog all-pass works? If not (and you can >>> hack simple circuit theory) you might find it instructive. >>> >>> Jerry >> >> >> No. I was hoping I could figure this out mathematically. It seemed >> to worked for basic equalization filters. > > > Well, circuit theory is math applied to Kirchoff's laws. Of course, EEs > learn some shortcuts so they don't have to go back to first principles > every time. Make two voltage dividers using three equal resistors and > one capacitor. Calculate the open-circuit voltage as a function of > frequency that can be measured from tap to tap. You will find that you > have written the equation of an analog all-pass filter very similar to > the one I described. (You deserve for the world to know that it was not > you who asked for its mathematical analysis.) > > Jerry
Is this in any filter design web pages or books? What I would like to see is some example formulas in the s-domain along with corresponding phase plots.