Active filters and comparators
Low-, high-, band-pass and notch active filters, order and roll-off, Sallen-Key sections and Q, comparators and Schmitt triggers, with first-order LPF, Schmitt-trigger and Butterworth Sallen-Key examples.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Sensor signals arrive with mains hum, PWM ripple and high-frequency noise, and an ADC sampling them will alias anything above half its sampling rate. Active filters remove that unwanted content before conversion. Comparators and Schmitt triggers turn analog signals into clean on/off decisions: limit switches, over-temperature trips, encoder squaring and zero-crossing detection in motor drives all rely on them.
Key ideas
Filter types. A low-pass filter (LPF) passes frequencies below its cut-off f_c and attenuates those above; a high-pass filter (HPF) does the opposite; a band-pass filter (BPF) passes a band around a centre frequency f₀; a band-stop (notch) filter rejects a band, for example 50 Hz hum. The cut-off is the −3 dB point, where the gain is 1/√2 (70.7 %) of the passband gain.
Why "active". An op-amp is added to RC networks. Compared with passive RLC filters, active filters need no inductors (bulky, lossy, impossible to integrate), can provide passband gain, have high input and low output impedance so stages can be cascaded without loading each other, and can be tuned by changing resistors. Limits: they need a power supply, the op-amp's gain-bandwidth and slew rate restrict the usable frequency range, and the output cannot exceed the supply rails.
Order and roll-off. Each reactive (capacitor) pole adds 20 dB/decade (6 dB/octave) of roll-off beyond cut-off. A first-order filter falls at 20 dB/decade, a second-order at 40 dB/decade, an n-th order at 20n dB/decade. Higher orders are built by cascading first- and second-order sections.
First-order active LPF/HPF. An RC network feeding a non-inverting amplifier. The RC sets f_c = 1/(2πRC); the amplifier sets the passband gain 1 + R_f/R1 and buffers the network.
Second-order sections and Q. A second-order section is described by its natural frequency f₀ and quality factor Q. Q = 0.707 gives the Butterworth (maximally flat) response; higher Q gives a peak near f₀ (Chebyshev-like); lower Q gives a slower, more rounded knee (Bessel-like, better step response).
- Sallen-Key: a non-inverting op-amp stage with two R's and two C's, where one capacitor feeds part of the output back (a controlled positive feedback that sets Q). With equal R's and C's, Q = 1/(3 − K), where K is the stage's non-inverting gain; K = 1.586 gives Butterworth, and K ≥ 3 makes it oscillate. Simple and low component count, but Q is sensitive to K at high Q.
- Multiple-feedback (MFB): an inverting topology, better for band-pass and higher-Q designs.
Band-pass filters. A wide band is obtained by cascading a HPF (lower cut-off f_L) and a LPF (upper cut-off f_H) with f_L < f_H; bandwidth BW = f_H − f_L and f₀ ≈ √(f_L·f_H). A narrow band (Q > about 1) needs a single second-order BPF section, with Q = f₀/BW.
Comparators. An op-amp (or a dedicated comparator IC) used without negative feedback. The output goes to +V_sat when v₊ > v₋ and to −V_sat when v₊ < v₋.
- Non-inverting comparator: signal on v₊, reference on v₋.
- Inverting comparator: signal on v₋, reference on v₊; output goes low when the signal exceeds the reference.
- Zero-crossing detector: reference = 0 V; converts a sine into a square wave.
- Dedicated comparators (LM393, LM339) are faster and often have open-collector outputs with a pull-up, which also lets them drive a different logic voltage.
Schmitt trigger (regenerative comparator). A slow or noisy input crossing a single threshold makes a plain comparator chatter. Positive feedback from the output to v₊ creates two thresholds, upper V_UT and lower V_LT. The output switches only when the input passes V_UT going up or V_LT going down, so noise smaller than the hysteresis V_H = V_UT − V_LT cannot cause false switching.
Formulas
f_c = 1 / (2π·R·C) (first-order LPF or HPF)
A_F = 1 + R_f / R1 (passband gain of a non-inverting active filter)
|H(f)| = A_F / √(1 + (f/f_c)²) (first-order LPF); |H(f)| = A_F / √(1 + (f_c/f)²) (first-order HPF)
f₀ = 1 / (2π·√(R₁R₂C₁C₂)) (second-order Sallen-Key); with equal R, C: f₀ = 1/(2πRC), Q = 1/(3 − K)
K = 3 − √2 ≈ 1.586 for a Butterworth (Q = 0.707) equal-component section
BW = f_H − f_L; f₀ = √(f_L·f_H); Q = f₀ / BW (band-pass)
Roll-off = 20·n dB/decade (n = filter order)
V_UT = +V_sat·R1/(R1 + R2); V_LT = −V_sat·R1/(R1 + R2); V_H = 2·V_sat·R1/(R1 + R2)
- Inverting Schmitt trigger: input on v₋, R2 from output to v₊, R1 from v₊ to ground; ±V_sat are the output saturation levels.
- Units: R in Ω, C in F, f in Hz, voltages in V; gains are V/V (dB = 20·log₁₀ of the ratio).
Worked examples
Example 1 (standard: first-order active LPF). A first-order LPF uses R = 10 kΩ, C = 15 nF and a non-inverting stage with R1 = R_f = 10 kΩ. Find f_c, the passband gain in dB and the gain at 5 kHz.
f_c = 1/(2πRC) = 1/(2π × 10⁴ Ω × 15 × 10⁻⁹ F) = 1061 Hz.A_F = 1 + R_f/R1 = 2, i.e. 20·log₁₀2 = 6.02 dB.|H(5 kHz)| = 2/√(1 + (5000/1061)²) = 2/√(1 + 22.21) = 0.415.- In dB: 20·log₁₀(0.415) = −7.64 dB.
f_c ≈ 1.06 kHz, passband gain 2 (6.02 dB), gain at 5 kHz ≈ 0.415 (−7.6 dB).
Example 2 (GATE level: Schmitt trigger). An inverting Schmitt trigger uses an op-amp that saturates at ±12 V, R1 = 10 kΩ (v₊ to ground) and R2 = 50 kΩ (output to v₊). Find the thresholds and hysteresis. Will a 0.5 V peak-to-peak noise riding on a slowly rising signal cause false switching?
- Feedback fraction
β = R1/(R1 + R2) = 10/60 = 0.1667. V_UT = +12 × 0.1667 = +2.0 V;V_LT = −12 × 0.1667 = −2.0 V.V_H = V_UT − V_LT = 4.0 V.- After the output switches low at +2.0 V, the input must fall below −2.0 V to switch back. Noise of 0.5 V p-p is far below 4 V, so there is no chatter.
V_UT = +2 V, V_LT = −2 V, V_H = 4 V; no false switching.
Example 3 (Butterworth Sallen-Key LPF). Design an equal-component second-order Butterworth LPF with R = 10 kΩ and C = 10 nF.
f₀ = 1/(2πRC) = 1/(2π × 10⁴ × 10⁻⁸) = 1592 Hz.- Butterworth needs
K = 3 − 1/Q = 3 − 1.414 = 1.586. K = 1 + R_f/R1, so with R1 = 10 kΩ,R_f = 0.586 × 10 kΩ = 5.86 kΩ.
f₀ ≈ 1.59 kHz, R_f ≈ 5.86 kΩ for R1 = 10 kΩ; roll-off 40 dB/decade.
Common mistakes
- Using ω_c = 1/(RC) and reporting it as a frequency in Hz; f_c = 1/(2πRC).
- Taking the −3 dB point as half the passband gain (it is 0.707 of it).
- Forgetting the passband gain when computing the output at a given frequency.
- Assuming the op-amp golden rules (v₊ = v₋) in a comparator or Schmitt trigger; there is no negative feedback.
- Swapping V_UT and V_LT, or forgetting the reference voltage shifts both thresholds.
- Designing a band-pass by cascading a LPF and HPF with f_L > f_H (no passband).
- Choosing K ≥ 3 in an equal-component Sallen-Key section, which makes it oscillate.
For GATE ME
Typical questions: cut-off frequency of an RC or active first-order filter, identifying the filter type from a circuit, gain at a given frequency, roll-off for a given order, comparator output state for given inputs, and Schmitt-trigger thresholds and hysteresis from two resistors and the saturation voltage. Practise reading which input the signal goes to and whether the feedback is positive or negative.
Quick check
- What is the cut-off frequency of an RC LPF with R = 1 kΩ and C = 1 µF?
- How fast does a third-order low-pass filter roll off beyond cut-off?
- An inverting comparator has V_ref = 2 V and the input is 3 V. Is the output high or low?
- A Schmitt trigger saturates at ±10 V with R1 = 10 kΩ and R2 = 90 kΩ. What is the hysteresis?
- Why does a Schmitt trigger reject noise that a plain comparator does not?
Answers: 1. 159 Hz. 2. 60 dB/decade. 3. Low. 4. 2 V (thresholds ±1 V). 5. Its two thresholds, set by positive feedback, mean the input must move by the full hysteresis to switch back.
Interview questions
All Electrical Circuits and Electronics interview questionsTry answering each one aloud before you open it.
1.What is an active filter, and how does it differ from a passive filter?Concept
An active filter combines resistors and capacitors with an active device, usually an op-amp, to shape the frequency response. A passive filter uses only R, L and C, so it cannot give gain, its response changes with source and load impedance, and low-frequency designs need large, lossy inductors. An active filter needs no inductors, can provide passband gain, and has high input and low output impedance, so sections can be cascaded for higher order without loading each other. Its drawbacks are the need for a power supply and an upper frequency limit set by the op-amp's gain-bandwidth and slew rate.
2.Explain the working principle of a comparator in electronic circuits.Concept
A comparator compares two input voltages and drives its output to one of two levels: high when v₊ > v₋ and low when v₊ < v₋. It works open loop, with no negative feedback, so its very high gain turns even a millivolt difference into a full output swing. Feeding the signal to v₊ gives a non-inverting comparator and feeding it to v₋ gives an inverting one; with a 0 V reference it becomes a zero-crossing detector. Comparators are used in threshold alarms, flash ADCs, PWM generation and squaring sensor signals, and positive feedback can be added to give hysteresis (a Schmitt trigger).
3.What happens if the reference voltage in a comparator circuit is set too high?Application
If the reference voltage in a comparator circuit is set too high, the comparator may not switch states as intended. This is because the input signal may never exceed the reference voltage, resulting in the comparator output remaining in a constant state. This can lead to incorrect operation of the circuit, especially in applications like zero-crossing detectors or threshold detectors, where precise switching is crucial.
4.How does a Sallen-Key filter topology work, and what are its advantages?Concept
A Sallen-Key section is a second-order filter built from two resistors, two capacitors and a non-inverting op-amp stage, with one capacitor (low-pass) or resistor (high-pass) returning part of the output to the RC network. That controlled positive feedback sets Q; for equal R's and C's, Q = 1/(3 − K), where K is the stage gain, so K = 1.586 gives a Butterworth response. Its advantages are few components, a non-inverting output, low sensitivity at low Q and easy design with unity gain. At high Q the response becomes very sensitive to K and component tolerance, so multiple-feedback designs are preferred there.
5.In what scenarios would you use a Schmitt trigger instead of a standard comparator?Application
A Schmitt trigger is used instead of a standard comparator in scenarios where noise on the input signal could cause multiple transitions at the output. The Schmitt trigger introduces hysteresis, which means it has two different threshold voltages for switching from high to low and low to high. This makes it ideal for applications like signal conditioning, where it can clean up noisy signals and provide a stable digital output.
6.Calculate the cut-off frequency of a first-order low-pass active filter with a resistor of 1 kΩ and a capacitor of 100 nF.Numerical
The cut-off frequency (f_c) of a first-order low-pass filter is given by the formula f_c = 1 / (2πRC). Substituting the given values: R = 1 kΩ = 1000 Ω, C = 100 nF = 100 × 10^-9 F. f_c = 1 / (2π × 1000 × 100 × 10^-9) = 1 / (2π × 0.0001) ≈ 1591.55 Hz.
7.What is the role of feedback in an active filter circuit?Concept
Negative feedback around the op-amp sets the passband gain through a resistor ratio, buffers the RC network and gives a low output impedance. In second-order sections, frequency-dependent feedback through capacitors shapes the response: in a Sallen-Key filter a capacitor returns part of the output as positive feedback, and the amount sets Q and therefore the flatness or peaking near f₀. Too much positive feedback (K ≥ 3 in an equal-component Sallen-Key) pushes the poles into the right half-plane and the filter oscillates.
8.Explain how a band-pass filter can be implemented using active components.Concept
A band-pass filter can be implemented using active components by combining a low-pass filter and a high-pass filter in series, with an operational amplifier providing gain and buffering. The low-pass filter allows frequencies below a certain cut-off to pass, while the high-pass filter allows frequencies above a certain cut-off to pass. By carefully selecting the cut-off frequencies of both filters, a band of frequencies can be isolated. The operational amplifier can be used to adjust the gain and improve the filter's performance.
9.A non-inverting op-amp comparator powered from ±12 V has a 2 V reference on its inverting input. What is the output when the input is 3 V?Numerical
The signal on the non-inverting input (3 V) exceeds the reference on the inverting input (2 V), so the open-loop output swings to positive saturation. For a typical op-amp that is about +10 to +11 V, a little below the +12 V rail; a rail-to-rail device gets close to +12 V. The output does not depend on the 1 V difference in any linear way, because the comparator works without negative feedback.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?