# Differentiator vs Filter

Discussion in 'General Electronics Chat' started by CurlsOnKeys, Dec 26, 2015.

1. ### CurlsOnKeys Thread Starter Member

Jan 3, 2015
47
2
Hi all,

I'm confused about something which seems simple. And yet I can't wrap my head around it.

Say you have a sine wave with amplitude 2V, which is the input to a passive differentiator (or high pass filter, which is the same, correct?) with a 100k resistor and a 10 nF cap.
If you look at this from frequency perspective and work with complex impedances, the cutoff-frequency is 1/2piRC = 159 Hz. At this frequency, the output will be 45° out of phase with the input; the output voltage will be 1V. A 100 Hz sinewave will be more out of phase (some 57°), with an output voltage of 0.628V. Higher frequencies (10 kHz) will probably be completely in phase with the input and suffer no voltage loss, hence a high pass filter.

Now if you analyse this circuit in the time domain to look for its differential behaviours, (Vout = -RC*d(V)/dt), and you fill in, for example, a sine wave with 100 Hz frequency, you end up with: 0,628*cos2pi100t; the same amplitude as you'd analyse it in a frequency domain, 0.628V, but the differential of a sine wave is a cosine wave... which is 90 degrees out of phase with the original sine wave... which doesn't add up with the phase calculations I made above, using complex impedances.

If I look at this on an oscilloscope, the amplitude is as expected and the output wave is 57° out of phase with the input. So it's no pure cosine-wave. Then why does the differentiator-equation comes up with this (pure) cosine-wave as the solution? I'm filtering (the output voltage is reduced), but "how much" am I differentiating?

Thanks for clearing this up!

2. ### ramancini8 Member

Jul 18, 2012
438
114
If you use a higher frequency sinewave the output voltage will be very small but approaching 90 degrees out of phase with the input. If the input signal is a square wave you will get spikes at each transition depending on the RC time constant. Spikes are considered the differential of a square wave.

3. ### #12 Expert

Nov 30, 2010
16,026
6,540
Stabbing wildly in the dark...maybe the part that needs your attention is the fact that a sine wave does not have a constant dv/dt.

And please don't ask for a better explanation from me. I'm self taught. I can barely read the math you showed, to the point that "Vo = -RC*d(V)/(dt)" seems wrong to me because it has a negative sign on the RC part. Right now, I'm just killing time until the sweat dries off so I can take a shower. Long day. Too tired. Just taking a stab at it. Hope I was helpful.

ps, "differentiator" and, "high pass filter" are both good enough to convey the information to me.

4. ### sailorjoe Member

Jun 4, 2013
361
63
Yeah, ramancini8 is correct. What you're seeing is because you're working near the corner frequency of the filter or differentiator. So the differentiator isn't behaving like a pure differentiator, more like a sluggish one. Think about sine and cosine. At the same frequency, one is the pure differentiation of the other. But that also is because they are precisely 90 degrees out of phase. When your filter is working at the point of less phase shift, you output signal won't be exactly the cosine of the input sine. That help?

5. ### CurlsOnKeys Thread Starter Member

Jan 3, 2015
47
2
Thanks all for the insights!
Helps, but I'm still a bit confused.

Ramancini8, you mean, if I use a LOWER frequency, right? It's a high pass filter here, so if I use a lower frequency, the output voltage will be very small but 90 degrees out of phase with the input, right? I get that part then; also about the square wave and the spikes, my main confusion came from sine waves.

You're right, that's wrong, I was working on opamp circuits, hence the negative sign that accidently slipped in. Too tired yesterday as well I guess Should be RCd(V)/dt.

That helps, yes, but if I understand it correctly, this means that if you want a high pass filter to work as a differentiator, it is only doing so at (very) low frequencies. When you raise your frequency to somewhere near the corner frequency, there will be less phase shift and when you raise it even more to high frequencies, there will be no phase shift, correct? (aside: is that also the fact with other waveforms?)
That would correspond to what we tested in the lab; we recently build a passive high pass filter and measured in/out sinewaves with the scope: the phase shift was 90 degrees at very low frequencies ("pure differentiator" then?), less at around the corner frequency ("sluggish differentiator") and gone at high frequencies ("no differentiator?").
I guess the above is correct, but then my confusion still rises from the fact that the formule RCd(V)/dt seems only to be trusted at very low (for a high pass filter) frequencies, since there the differentiation of the sinewave is a pure cosine wave, which implies 90 degrees phase shift. If you were to graph the output voltage of a high frequency sinewave based on that formula, you'd draw something different than the scope would show, which is odd, no?

Last edited: Dec 27, 2015
6. ### sailorjoe Member

Jun 4, 2013
361
63
Oops, you did catch an important mistake that ramancini8 and I both made. At higher frequencies the output gets larger, not smaller.
Check this out: http://www.animations.physics.unsw.edu.au/jw/RCfilters.html
Look at the graphs for phase and amplitude. Does this clear up your understanding?

7. ### CurlsOnKeys Thread Starter Member

Jan 3, 2015
47
2
Yes, I'd already seen that website, which again confirms my thoughts that differentiation only occurs at frequencies where w << 1/RC, which is in line with what you see on a scope and what you calculate using complex impedances.
I understand the difference between filtering and differentiating and that both are frequency-related, but that means - as I understand it - you cannot always trust the formula RCd(V)/dt since that will always give a cosine-wave as V(out) which - in reality - is not the case. Correct?

8. ### sailorjoe Member

Jun 4, 2013
361
63
You're right, you can't always trust the simple RCdV/dt formula. Look at the derivation of the formula. It requires that RC << 1/omega. If that condition isn't true, then the full frequency dependent form of the equation is required. This kind of thing comes up a lot in engineering school, by the way.

Dec 27, 2015
1
0
Hi i am new here, i just want to say that i read this forum a lot and i learned a lot so i just want to thank you all,you really helped me for styding.

10. ### CurlsOnKeys Thread Starter Member

Jan 3, 2015
47
2
Ah but of course! That formula requires that Vin is almost equal tot Vc, so that I is CdV/dt and Vout is R*I = RCdV/dt. And for Vin to be equal to Vc, R has to be << 1/wC or w << 1/RC. Didn't see that while it was right under my nose all the time. Thanks!

That also means that in a pure differentiator you have quiet an amount of voltage loss, no? Since most of Vin is across C, Vout over R will be perfectly differentiated, but will be small compared to Vin?

If we take this a step further towards an active differentiator with opamp, can you conclude the same thing? Asking this because in an exercise with the same numbers as original topic (100k, 10 nF, 100 Hz AC sine input), the solution in the book was given using the RCdV/dt formule, which resulted in -0.628(cos2pi100t).
But considering the fact that 100 Hz is near the corner frequency, they should've used complex impedances to calculate the exact result instead, no? -0.628V is the right amplitude, but for the exact phase shift, you can't rely on the dV/dt formula here, correct?

11. ### Jony130 AAC Fanatic!

Feb 17, 2009
3,936
1,088
Active differentiator with ideal opamp work as an "ideal" differentiator with gain (Av = ωRC). So you do not need to worry about this ω << 1/RC condition. And for ωo = RC the differentiator gain is 1V/V. And for F = 100Hz the gain is Av = ω/ωo ≈ 100Hz/160Hz = 0.625V/V

12. ### sailorjoe Member

Jun 4, 2013
361
63
Yes, exactly. Consider that a capacitor is effectively an open circuit at DC, so no voltage on the resistor. But at high freq a capacitor is a short circuit, so all of the signal appears across the resistor.

Seems like they only calculated the amplitude, not the phase. But your logic is correct.

13. ### CurlsOnKeys Thread Starter Member

Jan 3, 2015
47
2
Brilliant, thanks a lot (all of you) for your help!