How can I filter a DC offset of a pulse train with an RC circuit? The signal is a pulse jumping between 3.07V and 3.53V. But I need a pulse which is jumping between 0V to 0.5V. How can I filter that 3V DC offset?

  • \$\begingroup\$ You need a high-pass filter, en.wikipedia.org/wiki/High-pass_filter \$\endgroup\$ – diverger Dec 5 '14 at 13:46
  • \$\begingroup\$ Be aware that a high pass filter may not work. Depending on the nature of the pulse train it may change pulse widths as the average DC level changes. Look for "DC recovery circuit" or "diode clamp" circuits as alternatives, or use a level shifter instead. \$\endgroup\$ – Brian Drummond Dec 5 '14 at 13:52
  • \$\begingroup\$ Yes, if the duty is variable, a simple RC may not enough. \$\endgroup\$ – diverger Dec 5 '14 at 13:53
  • \$\begingroup\$ Level shifting is your best bet. See this related question: electronics.stackexchange.com/questions/37095/… \$\endgroup\$ – akellyirl Dec 5 '14 at 13:53
  • \$\begingroup\$ I need the frequency of the pulse. What I understand from your words it is possible to use RC but it will effect the frequency of the pulses? \$\endgroup\$ – user16307 Dec 5 '14 at 13:57

The simple and obvious answer that meets your specs is:

This thresholds the input around the midpoint of what you say the high and low levels are. In practise a little hysteresis is probably wise:

This will create about a 50 mV hystersis band. For example, when the input goes high so that the output goes high, the input has to go 50 mV lower before the output will go low. The hystesis band will be a little assymetric due to your threshold of 3.3 V not being in the middle of the output. This can be compensated for several ways, including adjusting the reference voltage fed into the negative input. Let me know if you want to get into those details.

  • 1
    \$\begingroup\$ I think the OP wanted the output to be 0V and 0.5V, but this looks like it would output 0V and 5V. \$\endgroup\$ – Phil Frost Dec 5 '14 at 15:37
  • \$\begingroup\$ 0 to 5V is actually better for me, since I was planning to amplify it. \$\endgroup\$ – user16307 Dec 5 '14 at 15:50
  • \$\begingroup\$ I will count the pulses. Do you think I need to think about 50 mV hysteresis band issue? What farad is C1? Can I use LM324 which is the only op-amp I have currently? \$\endgroup\$ – user16307 Dec 5 '14 at 15:53
  • \$\begingroup\$ @Phil: Oops, I missed the decimal point before. Turns out the OP apparently wants more anyway, so I won't update the answer, although a voltage divider on the output of the above circuits could address the issue if 0 - 500 mV was really wanted. \$\endgroup\$ – Olin Lathrop Dec 5 '14 at 18:12
  • \$\begingroup\$ @user: C1 is just a bypass cap, around 1 uF ceramic. LM324 should work well enough assuming your signal is within its bandwidth capabilities. \$\endgroup\$ – Olin Lathrop Dec 5 '14 at 18:14

Use an op-amp to create a mixer circuit and subtract the 3.07 volts from the signal: -

enter image description here

V1 can be your input and apply -3.07 volts DC to V2. If you want to restore the polarity of your signal (because Vout = -(V1+V2)) use an op-amp inverter afterwards.

If the dc offset is slightly moving with respect to the signal then something like a data-slicer would work: -

enter image description here

This uses a comparator and one input has the signal plus offset and the other input has the much-slowed-down version of the raw input. This slowed-down version will contain hardly any signal but just the average level of the signal. providing the mark-space ratio doesn't get excessive i.e. greater than 95% or less than 5% then it will produce a logic-level version of the desired digital signal. This can be returned to the 46mVp-p level should that be desired by using a resistor attenuator.

Should the undesired DC offset be wobbling quite a bit then you can use peak detectors on the upper and lower bounds of the composite signal to set upper and lower thresholds for two comparators and get even better performance - the two comparators can set and reset a flip-flop to restore the original signal.

Alternatively, you can use a high pass filter to largely differentiate the composite signal leaving no dc offset and spikes. The spikes will rise positive for edge transitions that were positive and there will be negative spikes for negative edge transitions of the composite signal. Then use a comparator with hysterisis to convert this back to a logic-level signal.


If red signal is fed to a comparator with some hysterisis it will toggle the comparator each time a pulse/spike rises above the comparator threshold thus resoring the sq wave. Ignore the scales on the picture above - they are not important but the concept is.

  • \$\begingroup\$ The frequency of the pulses will not be more than 400 Hz. Any suggestion on type of op-Amp? \$\endgroup\$ – user16307 Dec 5 '14 at 14:00
  • \$\begingroup\$ @user16307 virtually any op-amp would work - it needs to run from at least +/- 5V suppies and should have a bandwidth that is suitable to not cause significant sluggishness to the rise and fall-time of the signal - probably an op-amp with a gain bandwidth product of 1MHz or greater will be fine. \$\endgroup\$ – Andy aka Dec 5 '14 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.