EE 321 : Digital Signal Processing
Department of Electronics and Electrical Engineering
Indian Institute of Technology, Guwahati
Monsoon 2025
Topic 13: Filters (Bandpass, Bandstop, all pass, notch)
Instruction and notes by : Manish
1 Introduction
A bandpass filter (BPF) allows frequencies within a certain range (the passband) to pass
through while attenuating frequencies outside this range. Conversely, a bandstop filter (BSF),
also known as a notch filter, rejects a specified band of frequencies while allowing frequencies
outside this band to pass.
2 Mathematical Formulation
2.1 Ideal bandpass
Frequency response
Let the desired discrete-time bandpass occupy Ω1 < |Ω| < Ω2 with 0 < Ω1 < Ω2 < π. Define
the ideal DTFT: (
1, Ω1 < |Ω| < Ω2 ,
Hd (ejΩ ) =
0, otherwise.
This is the difference of two ideal low-pass (LP) responses:
Hd (ejΩ ) = Hlp (ejΩ ; Ω2 ) − Hlp (ejΩ ; Ω1 ).
Impulse response
1
Rπ
Using the inverse DTFT, hd [n] = 2π −π
Hd (ejΩ )ejΩn dΩ, and the ideal LP kernel
(Ω
c
π
, n = 0,
hlp [n; Ωc ] = sin(Ωc n)
πn
, n ̸= 0,
1
we obtain the ideal (noncausal, infinite-length) bandpass impulse response
Ω2 −Ω1 , n = 0,
π
hd [n] = (1)
sin(Ω2 n)−sin(Ω1 n) , n ̸= 0.
πn
Equivalent form
Define the center frequency and half-bandwidth
Ω1 + Ω 2 Ω2 − Ω1
Ω0 = , B= .
2 2
Using sin a − sin b = 2 cos a+b sin a−b
2 2
, Eq. (1) becomes
2
hd [n] = cos(Ω0 n) sin(Bn) = 2 cos(Ω0 n) hlp [n; B] .
πn
2.1.1 Causal FIR realization by windowing
Since hd [n] is noncausal and infinite, a practical FIR uses windowing. For odd length N , let
M = (N − 1)/2 and choose a window w[n] (rectangular, Hamming, Blackman, . . .), such that
h[n] = hd [n − M ] w[n], n = 0, 1, . . . , N − 1,
Equivalently,
h[n] = 2 cos Ω0 (n − M ) hlp [n; B] w[n],
To summarize,
• A bandpass filter can be designed by modulating a low-pass filter.
• Suppose we start with a prototype low-pass filter with impulse response hlp [n]. A band-
pass version can be obtained as:
hbp [n] = hlp [n] · 2 cos(Ω0 n), (2)
where Ω0 is the center frequency of the bandpass filter.
• The bandpass filter should contain one or more pairs of complex-conjugate poles near
the unit circle, at angles corresponding to the desired center frequency (or frequencies)
of the passband.
2.2 Pole - zero behavior
Consider a filter with a pole located at
p = rejΩ0 , 0 < r < 1.
Near Ω0 , the transfer function can be written approximately as
1
H(ejΩ ) ≈ .
1 − rej(Ω0 −Ω)
• The magnitude response |H(ejΩ )| exhibits a peak at Ω = Ω0 .
2
• As r → 1, the denominator becomes very small near Ω0 , producing a high and narrow
peak (sharp resonance).
• For smaller r, the peak becomes flatter and broader.
• Poles determine where the filter has resonance. The closer a pole is to the unit circle, the
narrower and sharper the resonance (longer impulse response). If the poles are farther
away (towards the origin), the response is broader and less selective.
• Zeros create attenuations (nulls) that suppress unwanted frequency ranges. For a band-
pass filter, we want strong attenuation at frequencies outside the passband. Placing zeros
directly on the unit circle at certain angles forces the frequency response to be exactly
zero at those frequencies.
• Zeros away from the unit circle: attenuation is not perfect (notch is shallow), but they
still shape the spectrum. Practical designs
• IIR bandpass: Poles are placed near the unit circle around the passband frequency; zeros
often go on the unit circle at DC and Nyquist.
• FIR bandpass: All poles are at the origin, and zeros are carefully placed on the unit circle
to define the stopbands.
Figure: Poles close to the unit circle produce long-lived oscillations in the time domain, which
correspond to sharp, narrowband resonances in the frequency domain.
Time–frequency trade-off
This relationship reflects the time–frequency uncertainty principle:
Long impulse response ⇔ Narrow spectral lobe (sharp resonance),
Short impulse response (fast decay) ⇔ Broad spectral lobe.
3
2.3 Bandstop Filter:
A bandstop filter can be constructed by subtracting the bandpass response from an all-pass
response:
Hbs (z) = 1 − Hbp (z). (3)
Example
Design a two-pole bandpass filter that has the center of its passband at Ω = π/2, zero √
in its
frequency response characteristic at Ω = 0 and Ω = π, and a magnitude response of 1/ 2 at
Ω = 4π/9.
Solution. Clearly, the filter must have poles at
p1,2 = re±jπ/2 = ±jr,
and zeros at z = 1 and z = −1. Consequently, the system function is (see previous lecture
section 2.2)
(z − 1)(z + 1) z2 − 1
H(z) = G =G 2 .
(z − jr)(z + jr) z + r2
The gain factor is determined by evaluating the frequency response H(Ω) of the filter at
Ω = π/2. Thus we have
π
2 1 − r2
H 2
=G = 1, G= .
1 − r2 2
The value of r is determined by evaluating H(Ω) at Ω = 4π/9. Thus we have
2
1 − r2
4π 2 2 − 2 cos(8π/9)
= 21 .
H 9 = ·
2 1 + r4 + 2r2 cos(8π/9)
Figure: Magnitude and phase response of this two pole BP filter.
4
Or, equivalently,
1.94(1 − r2 )2 = 1 − 1.88r2 + r4 .
The value r2 = 0.7 satisfies this equation. Therefore, the system function for the desired
filter is
1 − z −2
H(z) = 0.15 .
1 + 0.7z −2
Lowpass-to-Highpass Filter Transformation
Consider a prototype lowpass filter with impulse response hlp (n) and frequency response Hlp (Ω).
Using the frequency-translation property of the Fourier transform, this prototype can be con-
verted into either a bandpass or a highpass filter. In particular, a simple frequency transfor-
mation exists for converting a lowpass filter into a highpass filter, and vice versa.
If hlp (n) denotes the impulse response of a lowpass filter with frequency response Hlp (Ω),
then a highpass filter can be obtained by translating Hlp (Ω) by π radians, i.e.,
Hhp (Ω) = Hlp (Ω − π),
where Hhp (Ω) is the frequency response of the highpass filter. Since a translation of π radians in
frequency corresponds to multiplying the impulse response hlp (n) by ejπn , the impulse response
of the highpass filter is given by
hhp (n) = ejπn hlp (n) = (−1)n hlp (n).
Conversely, the lowpass impulse response can be recovered from the highpass one as
hlp (n) = (−1)n hhp (n).
If the lowpass filter is described by the difference equation
N
X M
X
y(n) = − ak y(n − k) + bk x(n − k),
k=1 k=0
its frequency response is PM
k=0 bk e−jΩk
Hlp (Ω) = P N
.
1+ k=1 ak e−jΩk
The corresponding highpass filter is described by the frequency response
PM k −jΩk
k=0 (−1) bk e
Hhp (Ω) = ,
1+ N
P k −jΩk
k=1 (−1) ak e
which corresponds to the difference equation
N
X M
X
k
y(n) = − (−1) ak y(n − k) + (−1)k bk x(n − k).
k=1 k=0
5
Example: Lowpass-to-Highpass Transformation
Problem. Convert the lowpass filter described by the difference equation
y(n) = 0.9y(n − 1) + 0.1x(n)
into a highpass filter.
Solution. Applying the lowpass-to-highpass transformation, the difference equation be-
comes
y(n) = −0.9y(n − 1) + 0.1x(n).
The corresponding frequency response is
0.1
Hhp (Ω) = .
1 + 0.9e−jΩ
3 All pass filter
An all-pass filter is a system whose magnitude response is constant for all frequencies. In other
words, the filter does not attenuate or amplify any frequency components; it only alters the
phase of the input signal. Mathematically, we define:
|H(Ω)| = 1, 0 ≤ Ω ≤ π.
The simplest example of an all-pass filter is a pure delay system, with system function
H(z) = z −k .
This filter delays the input signal by k samples. The magnitude of the frequency response
is constant:
|H(Ω)| = |e−jΩk | = 1.
The only effect is a phase shift of −Ωk. Thus, this is a trivial all-pass system with a perfectly
linear phase response.
A General All-Pass Filter
A more interesting all-pass filter has the system function
aN + aN −1 z −1 + · · · + a1 z −N +1 + z −N
H(z) = ,
1 + a1 z −1 + · · · + aN z −N
where all coefficients {ak } are real, and a0 = 1.
This can also be expressed compactly as
PN −N +k
k=0 ak z
H(z) = P N
, a0 = 1.
−k
k=0 ak z
Let us define the polynomial
N
X
A(z) = ak z −k , a0 = 1.
k=0
6
Then, the system function can be rewritten as
A(z −1 )
H(z) = z −N .
A(z)
To verify that this is indeed an all-pass filter, consider the squared magnitude:
|H(Ω)|2 = H(z) H(z −1 ) z=ejΩ
.
Substituting z = ejΩ , we obtain
|H(Ω)|2 = 1.
Thus, the magnitude response is constant for all Ω, and the filter only affects the phase of
the signal.
A key structural property of all-pass filters is the reciprocal relation between poles and
zeros:
- If z0 is a pole of H(z), then z10 is a zero of H(z).
- Conversely, if z0 is a zero of H(z), then z10 is a pole of H(z).
This means that the Poles inside the unit circle have corresponding zeros outside the unit
circle. Similarly, zeros inside the unit circle have corresponding poles outside the unit circle.
Thus, we can say that poles and zeros are symmetric with respect to the unit circle. The figure
below illustrates typical pole–zero patterns for a single-pole, single-zero filter and a two-pole,
two-zero filter.
To Summarize
• All-pass filters preserve the signal’s magnitude spectrum.
• They only introduce a phase shift, which can be linear (simple delay) or nonlinear (general
case).
• These filters are very useful in applications where phase equalization or phase manipula-
tion is required, without affecting the spectral magnitude of the signal.
• The pole–zero symmetry ensures that the magnitude response is constant (|H(Ω)| = 1)
while the phase response is shaped by the relative locations of the poles and zeros.
7
Phase Response and Group Delay of All-Pass Systems
The most general form of an all-pass system with real coefficients, expressed in factored form
in terms of poles and zeros, is
NR Nc
Y z −1 − αk Y (z −1 − βk )(z −1 − βk∗ )
Hap (z) = · .
k=1
1 − αk z −1 k=1
(1 − βk z −1 )(1 − βk∗ z −1 )
where α are real poles and β are complex poles.
Consider a first-order all-pass system (one pole, one zero) with transfer function
z −1 − p
Hap (z) = .
1 − pz −1
For a pole situated at p = rejθ , the frequency response
e−jΩ − rejθ
Hap (Ω) = .
1 − rejθ e−jΩ
When the pole is real, the phase of the all-pass system is given by
−1 r sin(Ω − θ)
ϕap (Ω) = −Ω − 2 tan .
1 − r cos(Ω − θ)
The group delay is defined as
d
τg (Ω) = − ϕap (Ω).
dΩ
For the first-order all-pass system, this simplifies to
1 − r2
τg (Ω) = .
1 + r2 − 2r cos(Ω − θ)
• For a causal and stable sysstem, we have r < 1, which guarantees
τg (Ω) ≥ 0.
• For higher-order all-pass systems, the group delay is the sum of the contributions of each
pole–zero pair:
X 1 − rk2
τg (Ω) = .
k
1 + rk2 − 2rk cos(Ω − θk )
Thus, the group delay of an all-pass system is always nonnegative and quantifies the
frequency-dependent delay experienced by different frequency components.
8
4 Notch Filters
A notch filter (or band-reject with a very narrow stop-band) contains one or more deep notches
(ideally perfect nulls) in its frequency response. Notch filters are useful whenever a specific fre-
quency component must be eliminated; a common example is removal of power-line interference
(e.g., 60Hz and its harmonics) from measurement signals.
To create a null at a frequency Ω0 , we simply place a pair of complex-conjugate zeros on
the unit circle at angle ±Ω0 :
z1,2 = e±jΩ0 .
Thus, the system function for an FIR notch filter with these two zeros (and an overall gain b0 )
is simply
H(z) = b0 1 − ejΩ0 z −1 1 − e−jΩ0 z −1
= b0 1 − 2 cos Ω0 z −1 + z −2 .
When evaluating the frequency response on the unit circle z = ejΩ , the numerator vanishes at
Ω = Ω0 , hence a null at that frequency.
Figure: Frequency response of a notch filter with a notch at π/4.
Narrowing the notch: Adding poles
The problem with the FIR notch filter is that the notch has a relatively large bandwidth, which
means that other frequency components around the desired null are severely attenuated. To
reduce the bandwidth of the null, we can introduce a pair of complex-conjugate poles near the
zeros but with radius r < 1:
p1,2 = re±jΩ0 , 0 < r < 1.
Placing poles at these locations introduces a resonance near the notch. The resulting notch
filter has system function
1 − 2 cos Ω0 z −1 + z −2
H(z) = b0 . (4)
1 − 2r cos Ω0 z −1 + r2 z −2
Why this produces a narrow notch
On the unit circle z = ejΩ , the numerator still vanishes at Ω = Ω0 (zero on unit circle), giving
the null. The denominator is close to zero when Ω is near Ω0 if r is close to 1, creating a sharp
resonance around the notch that confines the attenuation to a narrow frequency band. Thus:
• r close to 1 ⇒ narrower notch (higher Q, more selective).
9
• smaller r ⇒ wider notch (less selective).
Frequency Response
Evaluate H(z) at z = ejΩ to obtain the frequency response:
1 − 2 cos Ω0 e−jΩ + e−j2Ω
H(eΩ ) = b0 .
1 − 2r cos Ω0 e−jΩ + r2 e−j2Ω
Using the numerator simplification above, the magnitude of the numerator is
1 − 2 cos Ω0 e−jΩ + e−j2Ω = 2 cos Ω − cos Ω0 .
The denominator does not simplify as cleanly to a single trigonometric factor, but its behaviour
near Ω = Ω0 is dominated by the factor 1 − 2r cos Ω0 e−jΩ + r2 e−j2Ω — which becomes small
when r is close to 1 and Ω is near Ω0 . Consequently the full magnitude is
2 cos Ω − cos Ω0
H(ejΩ ) = b0 .
1 − 2r cos Ω0 e−jΩ + r2 e−j2Ω
Choice of the gain factor b0
The scalar b0 is typically chosen to normalize the pass-band gain (for example, to make
|H(ejΩ )| = 1 at Ω = 0 or at some other reference frequency). For unity gain at Ω = 0
one may set
1 − 2r cos Ω0 + r2 (1 − r)2 + 2r(1 − cos Ω0 )
b0 = = ,
1 − 2 cos Ω0 + 1 2(1 − cos Ω0 )
10
provided the denominator is nonzero. (In many practical designs b0 is simply set to 1 and the
pass-band ripple is tolerated or corrected separately.)
Summary
1. Place zeros on the unit circle at e±jΩ0 to obtain a perfect null at Ω0 (the unwanted tone).
2. Place poles at re±jΩ0 with r < 1 but close to 1 to reduce the notch bandwidth.
3. Set b0 to normalize the pass-band gain.
Reference material
1. Richard G Lyons, Understanding Digital Signal Processing, Prentice Hall.
2. John Proakis and Dimitris Manolakis, Digital Signal Processing, Pearson.
11