Digital Filter Design
Frequency Sampling Design Method
1.FIR Filter Design.
Fourier Transform Design Method
FIR Filter Design
Definition: A finite impulse response (FIR) filter is specified by
𝒃𝒊 filter coefficients,
The transfer function of the FIR filter: K+1 filter length
The difference equation
The realization of the FIR filter
Fourier Transform Design Method
Frequency response of ideal LPF:
𝑰𝒏𝒗𝒆𝒓𝒔𝒆 𝒇𝒐𝒖𝒓𝒊𝒆𝒓 𝑻𝒓𝒂𝒏𝒔𝒇𝒐𝒓𝒎
Impulse response of ideal LPF:
• The desired impulse response ℎ(𝑛) of ideal LPF is infinite and symmetrical about 𝑛 = 0.
• After truncating 2M+1 major components using the coefficient symmetry:
Symmetric
• To obtain causal FIR filter, h(n) is delayed by M samples.
Where,
Ideal Impulse Responses for Standard FIR Filters
Example FIR Low Pass Filter Design
a. Design a 3-tap FIR LPF with cut-off frequency of 800 Hz and a sampling rate of 8,000 Hz using the Fourier transform method.
b. Determine the transfer function and difference equation of the designed FIR system.
π π 3π
c. Compute and plot the magnitude frequency response for Ω = 0, 4 , 2 , and π radians.
4
Solution
Normalized cut-off frequency
3-tap filter 2𝑀 + 1 = 3 𝑀=1 ℎ 𝑛 𝑓𝑜𝑟 𝑛 𝑓𝑟𝑜𝑚 − 𝑀 𝑡𝑜 𝑀 𝑛 = −1, 0, 1,
filter coefficients and
From previous slide table
compute coefficients and
Using symmetry
Delaying h(n) by
M = 1 sample
Example - Contd.
b. The transfer function: Causal FIR filter coefficients
inverse z-transform
difference equation
c. The magnitude frequency response and phase response
Substituting
in 𝐻(𝑧)
Factoring term
Using Euler formula
Magnitude and
phase frequency
response
Linear Phase
If filter has linear phase property (the FIR
coefficients are symmetric about the middle
coefficient, and the FIR filter order is an odd
number), the output will simply be a
delayed version of input.
M=8 samples
delay
Let, 17-tap FIR filter with linear
phase property (M=8).
M=8 samples
delay
Nonlinear Phase
Input:
Linear phase filter output:
90 degree Non-linear phase filter output:
Input:
Linear phase filter output:
90 degrees phase delay filter output:
Distorted!
FIR Filtering With Window Method
• window functions are used to remedy the
undesirable Gibbs oscillations.
• The window function, which is symmetrical
and can gradually weight the designed FIR
coefficients down to zeros at both ends for
the range −𝑀 ≤ 𝑛 ≤ 𝑀.
• Applying the window sequence
𝑤 𝑛 to the filter coefficients gives
Problem: Example: Window Method
Design a 5-tap FIR band pass filter with a lower cut-off frequency of 2,000 Hz, an upper cut-off
frequency of 2,400 Hz, and a sampling rate of 8,000 Hz using the Hamming window method.
Determine the transfer function.
Solution:
normalized cut-off
frequencies
𝑴=𝟐
5-tap FIR 2M + 1 = 5 then M=2
𝑆𝑦𝑚𝑚𝑒𝑡𝑟𝑦
Example: Window Method –contd
Hamming
window
function 𝑆𝑦𝑚𝑚𝑒𝑡𝑟𝑦
Windowed
impulse
response
By delaying ℎ𝑤 (𝑛)by M = 2 samples,
The transfer function
FIR Filter Length Estimation
Given the required stop-band attenuation and pass-band ripple specifications the appropriate window can be selected.
Problem: Example: FIR Filter Length Estimation
Design a BPF with Use Hamming window
Solution:
Choose nearest higher odd N = 25
Application: Noise Reduction
We can design a digital filter to remove frequency components (noise) other than the desired frequency range.
Application: Noise Reduction –contd.
Frequency Sampling Design Method
Simple to design
The key feature of frequency sampling is that the filter coefficients can be calculated based on the specified magnitudes of the
desired filter frequency response uniformly in the frequency domain.
𝐻𝑘 are obtained from sampled desired
frequency response at equally spaced instants
Filter length = 2M+1 in frequency domain
Magnitude response in the range [0, 𝜋]
Calculate FIR filter coefficients:
Use the symmetry:
Example: Frequency Sampling Design Method
Problem:
Design a linear phase low-pass FIR filter with 7 taps and a cut-off frequency of Ω𝑐 = 0.3𝜋 radians
using the frequency sampling method.
Solution: Sampled
frequencies
𝑁 = 2𝑀 + 1 = 7 ⟶ 𝑀 = 3,
Hk at the specified frequencies
By
Symmetry
Coefficient Quantization Effect
• Obtaining filter coefficients with infinite precision is impossible.
• Filter coefficients are usually truncated or rounded off for the application.
FIR filter transfer function with
infinite precision coefficients:
FIR filter transfer function
with quantized precision
Error of the magnitude K=tap
frequency response
B=Number of Bits
K=tap
Example 25-Tap FIR filter, 8 bit code (sign + 7 bits for fraction Error is bounded by (less than)
−𝐵
𝐾 + 1 25
Let infinite precision coeff. = 0.00759455135346 𝐾+1 2 = = 7 = 0.0977
2𝐵 2
0.00759455135346 × 27 = 0.9721 ≅ 1 (rounded up to the integer)
Quantized coeff. = 1 27 = 0.0078125