Trouble with phase shift function

Thread Starter

planeguy67

Joined Jan 29, 2015
60
This problem is driving me nuts! Please consider the active all-pass filter below.

The corner frequency, Fc, is where the incoming signal will get shifted 90° in phase and is given by:


Fc = 1/(2πRC)
So, using a value of 22kΩ for R and 47nF for C, we get a frequency of 154 Hz. Good so far, right?

Ok, when I reverse the calculation and plug in 154 Hz into the formula for phase shift, I do NOT get 90°!

The phase shift is supposed to be given by:


Φ = -2 arctan(RC/2πF)
But when I use the values for R, C and F above, I get Φ = -0.001208..... This number looks meaningless (Yes, my calculator is set to DEG, not RAD). Any help? Thanks.




2000px-Active_Allpass_Filter.svg.png
 

shteii01

Joined Feb 19, 2010
4,644
You have a better way of shifting the phase?
you said it is all pass... if everything passes though... than what are you filtering out?

since you don't filter out anything... there is no pass region, there is no block region, there is no corner frequency that is the border of the two regions...

if i recall correctly time delay in time domain is the phase shift in frequency domain... so... if my recall is correct, you are going about your goal the wrong way. i will have to dig out my textbook and see if i got this right so i be back in a couple of hours.
 

Thread Starter

planeguy67

Joined Jan 29, 2015
60
you said it is all pass... if everything passes though... than what are you filtering out?
I am NOT filtering out ANYTHING. It's an ALL-pass filter, meaning ALL frequencies pass through, but their PHASE is shifted relative to their frequency. The corner frequency, as I stated and will repeat here, is the frequency where the phase shift equals 90°. That's it! The filter does nothing else than that. Hence, the term "phase-shifter".

Here is a plot of the transfer function if that helps you understand what it does. In this example, R is 237k and C is .001uF for a corner frequency of 672 Hz. You can see on the plot where that corresponds with a 90° phase shift.

BTW, I never stated my goal, I just want help with the equation.


Image8.gif
 

Thread Starter

planeguy67

Joined Jan 29, 2015
60
There are a few (!) aspects of signal modification besides "filtering out".

https://en.wikipedia.org/wiki/All-pass_filter

ak
Thanks. Been all over that Wiki page. The trouble remains, I calculate an Fc, which gives me the frequency where the signal gets shifted by 90°. Take THAT frequency, plug it into the formula to calculate phase shift and I do NOT get 90° back out. Why?

I know I'm rusty with my trig, but the maximum value for an arc or inverse tangent is ±90°, correct? So the formula which multiplies that arctan by a factor of 2 should cover phase shifts of ±180°, which should pretty much cover the gamut of possible phase shifts.
 

Thread Starter

planeguy67

Joined Jan 29, 2015
60
I have another formula for calculating the phase shift, but the result is equally useless:

Φ = -tan(2πfRC) + tan(-2πfRC)
In case you're wondering where I'm going with this, I would like to calculate OTHER frequencies that give me a different phase shift. For example, in the first post, I found the 90° phase shift occurred at 154 Hz. At what frequency would the phase shift equal 45°? Can't figure it out because the formula doesn't seem to work.
 

Papabravo

Joined Feb 24, 2006
22,082
In order to get 90° out of the arctan() function, the argument needs to approach ∞. Your expression for the argument actuallly approaches zero. I'd recheck that formula if I was you.

My TI-30 says that the arctan(1E99) = 90°, and I guess that is close enough for me.

From the Wikipedia page:

https://en.wikipedia.org/wiki/All-pass_filter

The formula you actually want is:



So:

180° - 2*arctan(2*3.1415926*154*22,000*47e-9) = 89.97°

Also close enough for me.
 
Last edited:

cmartinez

Joined Jan 17, 2007
8,759
In order to get 90° out of the arctan() function, the argument needs to approach ∞. Your expression for the argument actuallly approaches zero. I'd recheck that formula if I was you.

My TI-30 says that the arctan(1E99) = 90°, and I guess that is close enough for me
And the arctan() function (performed in a computer, of course) does some pretty weird stuff when it's used with extremely large values.... that is because the number of digits used internally is actually finite
 

Thread Starter

planeguy67

Joined Jan 29, 2015
60


So:

180° - 2*arctan(2*3.1415926*154*22,000*47e-9) = 89.97°

Also close enough for me.
Thanks Papabravo!!! You done broke the code! The formula I had, out of an e-Book no less, was wrong!!! See the attached screenshot. They placed the frequency in the denominator instead of the numerator. Everything makes sense now. Thanks!!! :):cool:


all pass wrong.jpg
 

crutschow

Joined Mar 14, 2008
38,503
you said it is all pass... if everything passes though... than what are you filtering out?

since you don't filter out anything... there is no pass region, there is no block region, there is no corner frequency that is the border of the two regions...

if i recall correctly time delay in time domain is the phase shift in frequency domain... so... if my recall is correct, you are going about your goal the wrong way. i will have to dig out my textbook and see if i got this right so i be back in a couple of hours.
Depends upon the goal. :rolleyes:
Did you google all pass filter?
An all pass filter does indeed pass all frequencies but it provides a phase shift of 90° at the corner frequency. It's a way to provide a phase shift of near 0° to near 180° with a constant amplitude.
Sometimes all you want is a phase shift.
 

shteii01

Joined Feb 19, 2010
4,644
Depends upon the goal. :rolleyes:
Did you google all pass filter?
An all pass filter does indeed pass all frequencies but it provides a phase shift of 90° at the corner frequency. It's a way to provide a phase shift of near 0° to near 180° with a constant amplitude.
Sometimes all you want is a phase shift.
Yes, I followed AK wiki link. I just never encountered this name of it. In controls we talked about phase shift and mathematics of it, but we did not do circuits in that class.
 
Top