7.6 Filters

7.6 Filters

1. Filter Applications and Ideal Filter Characteristics

1.1 Filter Applications

  1. Signal Processing:

    • Noise reduction and signal enhancement.

    • Signal separation (demultiplexing).

    • Anti-aliasing before sampling.

  2. Communications:

    • Channel selection in radios.

    • Modulation and demodulation.

    • Equalization to compensate channel distortion.

  3. Audio Processing:

    • Graphic equalizers.

    • Crossover networks in speakers.

    • Noise cancellation.

  4. Image Processing:

    • Edge detection.

    • Image smoothing/enhancement.

    • Pattern recognition.

  5. Control Systems:

    • Noise filtering in sensor measurements.

    • Loop shaping for stability.

  6. Biomedical:

    • ECG/EEG signal conditioning.

    • Removing power line interference.

1.2 Ideal Filter Characteristics

  1. Ideal Low-Pass Filter:

    • H(jω)={1ω<ωc0ω>ωcH(j\omega) = \begin{cases} 1 & |\omega| < \omega_c \\ 0 & |\omega| > \omega_c \end{cases}

    • Passband: ωc<ω<ωc-\omega_c < \omega < \omega_c

    • Stopband: ω>ωc|\omega| > \omega_c

    • Impulse response: h(t)=ωcπsinc(ωct)h(t) = \frac{\omega_c}{\pi} \text{sinc}(\omega_c t)

  2. Ideal High-Pass Filter:

    • H(jω)={0ω<ωc1ω>ωcH(j\omega) = \begin{cases} 0 & |\omega| < \omega_c \\ 1 & |\omega| > \omega_c \end{cases}

    • HHP(jω)=1HLP(jω)H_{HP}(j\omega) = 1 - H_{LP}(j\omega)

  3. Ideal Band-Pass Filter:

    • H(jω)={1ω1<ω<ω20otherwiseH(j\omega) = \begin{cases} 1 & \omega_1 < |\omega| < \omega_2 \\ 0 & \text{otherwise} \end{cases}

    • Center frequency: ω0=ω1+ω22\omega_0 = \frac{\omega_1 + \omega_2}{2}

    • Bandwidth: BW=ω2ω1BW = \omega_2 - \omega_1

  4. Ideal Band-Stop (Notch) Filter:

    • H(jω)={0ω1<ω<ω21otherwiseH(j\omega) = \begin{cases} 0 & \omega_1 < |\omega| < \omega_2 \\ 1 & \text{otherwise} \end{cases}

    • HBS(jω)=1HBP(jω)H_{BS}(j\omega) = 1 - H_{BP}(j\omega)

  5. Problems with Ideal Filters:

    • Non-causal impulse response (extends to t<0t < 0).

    • Infinite duration impulse response.

    • Physically unrealizable.

    • Sharp transitions cause Gibbs phenomenon.

2. Digital vs. Analog Filters

2.1 Analog Filters

  1. Characteristics:

    • Process continuous-time signals.

    • Implemented with RLC components, op-amps.

    • Operate in real-time.

  2. Advantages:

    • No quantization noise.

    • High speed (limited only by components).

    • No aliasing issues.

    • Can handle very high frequencies.

  3. Disadvantages:

    • Component tolerances affect performance.

    • Temperature sensitivity.

    • Difficult to tune/adjust.

    • Bulky for low frequencies.

2.2 Digital Filters

  1. Characteristics:

    • Process discrete-time signals.

    • Implemented in software or digital hardware.

    • Operate on sampled data.

  2. Advantages:

    • High accuracy and reproducibility.

    • Easy to modify (programmable).

    • No component aging or temperature drift.

    • Can implement complex filters.

    • Linear phase achievable.

  3. Disadvantages:

    • Limited by sampling rate.

    • Quantization errors.

    • Finite word-length effects.

    • Computational delay.

    • Aliasing if not properly designed.

2.3 Comparison Summary

Aspect
Analog Filters
Digital Filters

Signal Type

Continuous-time

Discrete-time

Implementation

Hardware (RLC, op-amps)

Software/hardware

Accuracy

Limited by components

Limited by word length

Flexibility

Fixed by design

Programmable

Frequency Range

High (GHz)

Limited by sampling

Cost

Increases with precision

Decreases with technology

Stability

Component dependent

Algorithm dependent

3. Active vs. Passive Filters

3.1 Passive Filters

  1. Components: Resistors (R), Capacitors (C), Inductors (L).

  2. No External Power: Use only passive components.

  3. Common Types:

    • RC filters: First-order, no inductors.

    • RL filters: First-order.

    • RLC filters: Second-order, can resonate.

    • LC filters: Second-order, no resistors.

  4. Frequency Response Characteristics:

    • Low-pass RC: H(jω)=11+jωRCH(j\omega) = \frac{1}{1 + j\omega RC}

    • High-pass RC: H(jω)=jωRC1+jωRCH(j\omega) = \frac{j\omega RC}{1 + j\omega RC}

    • Cutoff frequency: ωc=1RC\omega_c = \frac{1}{RC}

    • Roll-off: 20 dB/decade per pole.

  5. Advantages:

    • Simple and reliable.

    • No power supply needed.

    • Good for high frequencies.

    • No noise from active components.

  6. Disadvantages:

    • Signal attenuation (loss).

    • Impedance matching issues.

    • Inductors large at low frequencies.

    • Loading effects.

3.2 Active Filters

  1. Components: Op-amps with resistors and capacitors (no inductors).

  2. External Power: Requires power supply for op-amps.

  3. Common Topologies:

    • Sallen-Key: Popular second-order configuration.

    • Multiple Feedback (MFB).

    • State Variable: Can implement all filter types.

    • Biquad: Second-order section.

  4. Frequency Response Characteristics:

    • Can have gain (>1).

    • High input impedance, low output impedance.

    • No loading effects between stages.

    • Precise control of parameters.

  5. Advantages:

    • Gain available (amplification).

    • No inductors (compact size).

    • Good isolation between stages.

    • Tunable (via variable resistors).

    • Can implement complex filters.

  6. Disadvantages:

    • Limited bandwidth (op-amp limitations).

    • Requires power supply.

    • Noise from active components.

    • Stability concerns.

    • More complex than passive.

3.3 Comparison Summary

Aspect
Passive Filters
Active Filters

Power

No external power

Requires power

Components

R, L, C

R, C, Op-amps

Gain

Attenuation only

Gain possible

Size

Large (inductors)

Compact

Frequency

Good for high freq

Limited by op-amps

Cost

Low for simple

Higher

Noise

Thermal only

Op-amp noise

4. Analog Filter Approximations

4.1 Butterworth Filter (Maximally Flat)

  1. Magnitude Response: H(jω)2=11+(ω/ωc)2N|H(j\omega)|^2 = \frac{1}{1 + (\omega/\omega_c)^{2N}} where NN = filter order, ωc\omega_c = cutoff frequency.

  2. Characteristics:

    • Maximally flat in passband (no ripple).

    • Monotonic in both passband and stopband.

    • Roll-off: 20N dB/decade.

    • Group delay not constant.

  3. Pole Locations:

    • Equally spaced on circle of radius ωc\omega_c.

    • In left half-plane (for stability).

    • Angles: θk=π2+(2k1)π2N\theta_k = \frac{\pi}{2} + \frac{(2k-1)\pi}{2N}, k=1,2,...,Nk=1,2,...,N

  4. Transfer Function: H(s)=KωcNk=1N(ssk)H(s) = \frac{K\omega_c^N}{\prod_{k=1}^{N} (s - s_k)} where sks_k are the poles.

  5. Design Steps:

    1. Determine NN from specifications.

    2. Find pole locations.

    3. Form transfer function.

    4. Realize with circuit.

4.2 Chebyshev Filters

4.2.1 Type I (Equiripple in Passband)

  1. Magnitude Response: H(jω)2=11+ϵ2TN2(ω/ωc)|H(j\omega)|^2 = \frac{1}{1 + \epsilon^2 T_N^2(\omega/\omega_c)} where TN(x)T_N(x) = Chebyshev polynomial of order N.

  2. Characteristics:

    • Equiripple in passband.

    • Monotonic in stopband.

    • Sharper roll-off than Butterworth for same order.

    • Ripple controlled by ϵ\epsilon.

  3. Parameters:

    • Passband ripple (δ\delta in dB): ϵ=10δ/101\epsilon = \sqrt{10^{\delta/10} - 1}

    • Order NN determined by stopband requirements.

4.2.2 Type II (Equiripple in Stopband)

  1. Magnitude Response: H(jω)2=11+ϵ2[TN(ωs/ωc)TN(ωs/ω)]2|H(j\omega)|^2 = \frac{1}{1 + \epsilon^2 \left[\frac{T_N(\omega_s/\omega_c)}{T_N(\omega_s/\omega)}\right]^2}

  2. Characteristics:

    • Monotonic in passband.

    • Equiripple in stopband.

    • Better phase response than Type I.

4.3 Comparison of Approximations

Filter Type
Passband
Stopband
Roll-off
Phase Response

Butterworth

Flat

Monotonic

Moderate

Nonlinear

Chebyshev I

Ripple

Monotonic

Steep

Nonlinear

Chebyshev II

Monotonic

Ripple

Steep

Better than I

Elliptic

Ripple

Ripple

Steepest

Worst

Bessel

Flat

Poor

Gentle

Linear

4.4 Filter Order Determination

For Butterworth: Nlog[10As/10110Ap/101]2log(ωs/ωp)N \geq \frac{\log\left[\frac{10^{A_s/10} - 1}{10^{A_p/10} - 1}\right]}{2\log(\omega_s/\omega_p)} where:

  • ApA_p = passband attenuation (dB)

  • AsA_s = stopband attenuation (dB)

  • ωp\omega_p = passband edge

  • ωs\omega_s = stopband edge

5. Digital Filter Fundamentals

5.1 Digital Filter Representation

General form: y[n]=k=0Mbkx[nk]k=1Naky[nk]y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]

  • x[n]x[n] = input

  • y[n]y[n] = output

  • bkb_k = feedforward coefficients

  • aka_k = feedback coefficients

5.2 Transfer Function

H(z)=Y(z)X(z)=k=0Mbkzk1+k=1NakzkH(z) = \frac{Y(z)}{X(z)} = \frac{\sum_{k=0}^{M} b_k z^{-k}}{1 + \sum_{k=1}^{N} a_k z^{-k}}

5.3 Frequency Response

H(ejΩ)=H(z)z=ejΩH(e^{j\Omega}) = H(z)\big|_{z=e^{j\Omega}}

  • Periodic with period 2π2\pi.

  • Ω=ωT\Omega = \omega T = normalized frequency.

6. Finite Impulse Response (FIR) Filters

6.1 Definition and Structure

  1. Difference Equation: y[n]=k=0Mbkx[nk]y[n] = \sum_{k=0}^{M} b_k x[n-k]

    • No feedback terms (ak=0a_k = 0 for k1k \geq 1).

  2. Impulse Response:

    • Finite length: h[n]=bnh[n] = b_n for n=0,1,...,Mn = 0,1,...,M.

    • Length = M+1M+1 (order = MM).

  3. Transfer Function: H(z)=k=0Mh[k]zkH(z) = \sum_{k=0}^{M} h[k] z^{-k}

    • Only zeros (except possibly at origin).

    • Always stable (no poles except at z=0).

6.2 FIR Filter Design Methods

  1. Window Method:

    • Truncate ideal impulse response with window.

    • h[n]=hd[n]w[n]h[n] = h_d[n] \cdot w[n] for n=M/2,...,M/2n = -M/2,...,M/2.

    • Common windows: Rectangular, Hamming, Hanning, Blackman.

  2. Frequency Sampling Method:

    • Specify desired frequency response at equidistant points.

    • Compute inverse DFT for filter coefficients.

  3. Optimal (Parks-McClellan) Method:

    • Minimax design using Remez exchange algorithm.

    • Optimal in Chebyshev sense.

    • Produces equiripple error.

6.3 Linear Phase FIR Filters

For linear phase: h[n]=±h[Mn]h[n] = \pm h[M-n] Four types:

  1. Type I: Symmetric, odd length (M even)

    • Can implement all filter types.

  2. Type II: Symmetric, even length (M odd)

    • H(π) = 0, cannot implement high-pass.

  3. Type III: Anti-symmetric, odd length

    • H(0) = H(π) = 0, suitable for Hilbert transformers.

  4. Type IV: Anti-symmetric, even length

    • H(0) = 0, suitable for differentiators.

6.4 Advantages of FIR Filters

  1. Always stable.

  2. Linear phase achievable.

  3. Simple implementation.

  4. No limit cycles.

  5. Good numerical properties.

6.5 Disadvantages of FIR Filters

  1. High order needed for sharp cutoff.

  2. Large delay (group delay = M/2 samples).

  3. Computationally intensive.

7. Infinite Impulse Response (IIR) Filters

7.1 Definition and Structure

  1. Difference Equation: y[n]=k=0Mbkx[nk]k=1Naky[nk]y[n] = \sum_{k=0}^{M} b_k x[n-k] - \sum_{k=1}^{N} a_k y[n-k]

    • Contains feedback terms.

  2. Transfer Function: H(z)=k=0Mbkzk1+k=1NakzkH(z) = \frac{\sum_{k=0}^{M} b_k z^{-k}}{1 + \sum_{k=1}^{N} a_k z^{-k}}

    • Both poles and zeros.

  3. Canonical Forms:

    • Direct Form I: Separate feedforward and feedback.

    • Direct Form II: Minimal storage.

    • Cascade Form: Series of second-order sections.

    • Parallel Form: Parallel second-order sections.

7.2 IIR Filter Design Methods

  1. Analog-to-Digital Transformation:

    • Impulse Invariance: Sample analog impulse response.

      • Preserves time response.

      • May cause aliasing.

    • Bilinear Transform: s=2T1z11+z1s = \frac{2}{T} \frac{1-z^{-1}}{1+z^{-1}}

      • No aliasing.

      • Warps frequency axis.

  2. Direct Digital Design:

    • Least squares method.

    • Prony's method.

7.3 Stability Considerations

  1. Stability Condition: All poles inside unit circle (|poles| < 1).

  2. Stability Test:

    • Compute poles of H(z).

    • Jury's stability test.

    • Schur-Cohn test.

7.4 Advantages of IIR Filters

  1. Lower order for same specifications.

  2. Less computation per output sample.

  3. Can match analog filters.

  4. Efficient implementation.

7.5 Disadvantages of IIR Filters

  1. Nonlinear phase (except all-pass).

  2. Potential instability.

  3. Limit cycles due to quantization.

  4. Sensitivity to coefficient quantization.

8. FIR vs IIR Comparison

Aspect
FIR Filters
IIR Filters

Impulse Response

Finite duration

Infinite duration

Stability

Always stable

Can be unstable

Phase

Linear phase possible

Nonlinear phase

Order

High for sharp cutoff

Low for sharp cutoff

Computation

More per output

Less per output

Delay

Large

Small

Design Methods

Window, optimal

Bilinear, impulse invariance

Implementation

Simple

More complex

Applications

Where phase important

Where efficiency important

9. Important Formulas

9.1 Analog Filter Design

  1. Butterworth: H(jω)2=11+(ω/ωc)2N|H(j\omega)|^2 = \frac{1}{1 + (\omega/\omega_c)^{2N}}

  2. Chebyshev Type I: H(jω)2=11+ϵ2TN2(ω/ωc)|H(j\omega)|^2 = \frac{1}{1 + \epsilon^2 T_N^2(\omega/\omega_c)}

  3. Order Calculation: Nlog[(10As/101)/(10Ap/101)]2log(ωs/ωp)N \geq \frac{\log[(10^{A_s/10}-1)/(10^{A_p/10}-1)]}{2\log(\omega_s/\omega_p)}

9.2 Digital Filter Structures

  1. FIR Direct Form: y[n]=k=0Mh[k]x[nk]y[n] = \sum_{k=0}^{M} h[k] x[n-k]

  2. IIR Direct Form II: w[n]=x[n]k=1Nakw[nk]w[n] = x[n] - \sum_{k=1}^{N} a_k w[n-k] y[n]=k=0Mbkw[nk]y[n] = \sum_{k=0}^{M} b_k w[n-k]

9.3 Transformations

  1. Bilinear Transform: s=2T1z11+z1s = \frac{2}{T} \frac{1-z^{-1}}{1+z^{-1}} Prewarping: ωa=2Ttan(ωdT2)\omega_a = \frac{2}{T} \tan\left(\frac{\omega_d T}{2}\right)

  2. Impulse Invariance: h[n]=Thc(nT)h[n] = T h_c(nT)

9.4 Filter Specifications

  1. Passband ripple: δp\delta_p (linear) or ApA_p (dB).

  2. Stopband attenuation: δs\delta_s (linear) or AsA_s (dB).

  3. Cutoff frequency: ωc\omega_c (3-dB point).

  4. Transition band: ωsωp\omega_s - \omega_p.

9.5 Window Functions (Length M+1)

  1. Rectangular: w[n]=1w[n] = 1

  2. Hamming: w[n]=0.540.46cos(2πn/M)w[n] = 0.54 - 0.46\cos(2\pi n/M)

  3. Hanning: w[n]=0.50.5cos(2πn/M)w[n] = 0.5 - 0.5\cos(2\pi n/M)

  4. Blackman: w[n]=0.420.5cos(2πn/M)+0.08cos(4πn/M)w[n] = 0.42 - 0.5\cos(2\pi n/M) + 0.08\cos(4\pi n/M)

9.6 Linear Phase Conditions

For FIR filter of length L = M+1:

  1. Type I (M even): h[n]=h[Mn]h[n] = h[M-n]

  2. Type II (M odd): h[n]=h[Mn]h[n] = h[M-n]

  3. Type III (M even): h[n]=h[Mn]h[n] = -h[M-n]

  4. Type IV (M odd): h[n]=h[Mn]h[n] = -h[M-n]

9.7 Group Delay

  1. FIR with linear phase: τg=M/2\tau_g = M/2 samples.

  2. General: τg(Ω)=ddΩH(ejΩ)\tau_g(\Omega) = -\frac{d}{d\Omega} \angle H(e^{j\Omega})

Last updated