NEE3208 Signal Processing: FIR Filter Design for Noise Removal Report
VerifiedAdded on 2023/05/28
|18
|3101
|78
Report
AI Summary
This report details the design and implementation of a Finite Impulse Response (FIR) low pass filter in MATLAB to remove white noise from a signal. The assignment involves designing the kernel filter h(n) by defining its impulse response and using three different kernels, evaluating the transfer function using the Discrete Fourier Transform (DFT), plotting the magnitude of the transfer functions, applying the filter in the frequency domain, and obtaining the Inverse DFT to get the filtered signal y(n). The report discusses the windowing method, specifically the Kaiser window, and analyzes the main lobe, side lobe, and peak values. Different kernels are analyzed, and filters are applied in both the frequency and time domains to obtain filtered signals, with a focus on achieving an ideal low pass filter response for reducing white noise while considering the trade-offs between filter order, complexity, and ripple behavior. Desklib provides access to this and other solved assignments for students.

STUDENT NAME
STUDENT ID NUMBER
INSTITUTIONAL AFFILIATION
LOCATION
DATE OF SUBMISSION
STUDENT ID NUMBER
INSTITUTIONAL AFFILIATION
LOCATION
DATE OF SUBMISSION
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

ASSIGNMENT 3
INTRODUCTION
Signals are obtained from the physical systems based on voltage values over a given time frame.
Disturbances and noise may affect the signal obtained. These disturbances are experienced from
the effects of the surroundings as well as the processing units [1]-[5]. Filters are used to attenuate
a selected range of frequencies from the continuous time signal. The design of filters is quite
crucial especially when the analog signal is under analysis so as to preserve as much of the
original signal as is possible. There are different types of filters within the transfer function with
a bandwidth of,
H ( f ) =|H ( f )|e−iθ ( f )
A designer is able to choose between the digital filter and the analog filter. A digital filter
has a very high accuracy, linear phase, no drift, easy to simulate and design, computation must
be completed within sampling period, and there is need for high speed ADC and DAC. On the
other hand, the analog filter is considered to be a bit less accurate as a result of the nonlinear
phase and the drift is as a result of the components [6]. The filter is difficult to simulate and
design as well as the limited by the op-amp or transistor gain bandwidth. Its design does not
require digital ICs. To determine the impulse response of the ideal low pass filter given the
signal is in frequency domain.
INTRODUCTION
Signals are obtained from the physical systems based on voltage values over a given time frame.
Disturbances and noise may affect the signal obtained. These disturbances are experienced from
the effects of the surroundings as well as the processing units [1]-[5]. Filters are used to attenuate
a selected range of frequencies from the continuous time signal. The design of filters is quite
crucial especially when the analog signal is under analysis so as to preserve as much of the
original signal as is possible. There are different types of filters within the transfer function with
a bandwidth of,
H ( f ) =|H ( f )|e−iθ ( f )
A designer is able to choose between the digital filter and the analog filter. A digital filter
has a very high accuracy, linear phase, no drift, easy to simulate and design, computation must
be completed within sampling period, and there is need for high speed ADC and DAC. On the
other hand, the analog filter is considered to be a bit less accurate as a result of the nonlinear
phase and the drift is as a result of the components [6]. The filter is difficult to simulate and
design as well as the limited by the op-amp or transistor gain bandwidth. Its design does not
require digital ICs. To determine the impulse response of the ideal low pass filter given the
signal is in frequency domain.

h ( t ) =I { H ( f ) }
¿ ∫
−∞
∞
H ( f ) e j 2 πft df
¿ ∫
− fu
fu
e− j 2 πf t0
e j 2 πft df
¿ ∫
−∞
∞
e j 2 πf (t −t0) df
¿ 2 f u
sin2 π f u ( t−t0 )
2 π f u ( t−t0 )
Further, when performing impulse response on a signal, the FIR and IIR filters are used. The
finite impulse response, FIR, can be computed faster using the linear phase. There is no feedback
loop involved in the filter as it only has a feed-forward only architecture. Some of the items to
consider for the design are the windowing, the equirriple design is required as well as the
frequency selection. The filter uses the weighted least squares as well as the parks-Mcclellan
method to design the filter [7]. On the other hand, the infinite impulse response presents a slower
response when connecting to the feedback path, with a non-linear phase as well as it has a
feedback loop that is used to control the filter characteristics. The IIR filters focus on the bilinear
transformation and the impulse invariant are used to develop the design of an IIR filter. The FIR
filter is of the form,
y ( n )= ∑
i=0
M−1
h ( i ) x ( n−i )
The transfer function is given as,
¿ ∫
−∞
∞
H ( f ) e j 2 πft df
¿ ∫
− fu
fu
e− j 2 πf t0
e j 2 πft df
¿ ∫
−∞
∞
e j 2 πf (t −t0) df
¿ 2 f u
sin2 π f u ( t−t0 )
2 π f u ( t−t0 )
Further, when performing impulse response on a signal, the FIR and IIR filters are used. The
finite impulse response, FIR, can be computed faster using the linear phase. There is no feedback
loop involved in the filter as it only has a feed-forward only architecture. Some of the items to
consider for the design are the windowing, the equirriple design is required as well as the
frequency selection. The filter uses the weighted least squares as well as the parks-Mcclellan
method to design the filter [7]. On the other hand, the infinite impulse response presents a slower
response when connecting to the feedback path, with a non-linear phase as well as it has a
feedback loop that is used to control the filter characteristics. The IIR filters focus on the bilinear
transformation and the impulse invariant are used to develop the design of an IIR filter. The FIR
filter is of the form,
y ( n )= ∑
i=0
M−1
h ( i ) x ( n−i )
The transfer function is given as,
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

H ( z ) = Y ( z )
X ( z ) =
∑
k=0
M
bk z−k
1+∑
k=1
N
ak z−k
For the fir filter, there is no feedback. The length is given as order M,
y ( n )= ∑
k=0
M−1
bk x ( n−k )= ∑
k=0
M −1
h ( k ) x ( n−k )
To determine the exact linear phase response of the fir filter, to determine the impulse response
of the ideal low pass filter,
h ( t )=I {H ( f ) }
¿ ∫
−∞
∞
H ( f ) e j 2 πft df
¿ ∫
− fu
fu
e− j 2 πf t0
e j 2 πft df
¿ ∫
−∞
∞
e j 2 πf (t −t0) df
¿ 2 f u
sin2 π f u ( t−t0 )
2 π f u ( t−t0 )
The low pass filter allows the low frequency components of a signal given below for the cutoff
frequency and denies all other frequency components above the cut off frequency. The filter
satisfies
H LP ( e jw ) = { 10 ≤ ω ≤ ωc
0 , ωc ≤ ω ≤ π
The impulse response of the ideal low pass filter is given as,
hLP [n]= sin ( ωc n )
πn
Windowing
X ( z ) =
∑
k=0
M
bk z−k
1+∑
k=1
N
ak z−k
For the fir filter, there is no feedback. The length is given as order M,
y ( n )= ∑
k=0
M−1
bk x ( n−k )= ∑
k=0
M −1
h ( k ) x ( n−k )
To determine the exact linear phase response of the fir filter, to determine the impulse response
of the ideal low pass filter,
h ( t )=I {H ( f ) }
¿ ∫
−∞
∞
H ( f ) e j 2 πft df
¿ ∫
− fu
fu
e− j 2 πf t0
e j 2 πft df
¿ ∫
−∞
∞
e j 2 πf (t −t0) df
¿ 2 f u
sin2 π f u ( t−t0 )
2 π f u ( t−t0 )
The low pass filter allows the low frequency components of a signal given below for the cutoff
frequency and denies all other frequency components above the cut off frequency. The filter
satisfies
H LP ( e jw ) = { 10 ≤ ω ≤ ωc
0 , ωc ≤ ω ≤ π
The impulse response of the ideal low pass filter is given as,
hLP [n]= sin ( ωc n )
πn
Windowing
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Digital filters
The digital filters are not easy to realize and the impulse responses may take a long time
to become non-causal. The amplitude response is obtained from the digital filters and it is not
equal to the constant over a band of frequencies. When designing the FIR, it is important to
consider that the FIR may not be infinite at any section. There are a number of filter responses
obtained using different topologies and the designs depend on the application needed from the
simple frequency cutoff to controlling the behavior for the low pass filter and the band pass
filter. For the FIR digital filter design uses the following approaches for the FIR filter design,
(i) Windowed Fourier series approach
(ii) Frequency sampling approach
(iii) Computer based optimization methods
The transfer function is given as,
H ( z )=∑
n=0
N −1
h ( n ) z−n
The length of the impulse response is given as N and all the poles are obtained about z=0. It is
allowed to place the zeros at any point on the z-plane.
ln( H ( z ))=ln( K )+∑
i=1
n1
ln ( 1−α i z−1 )+∑
i=1
n2
ln (1−βi z−1 )
N2( z )=∏
i=1
n2
(1− βi z−1 )
N1( z )=∏
i =1
n1
(1− αi z−1 )
The digital filters are not easy to realize and the impulse responses may take a long time
to become non-causal. The amplitude response is obtained from the digital filters and it is not
equal to the constant over a band of frequencies. When designing the FIR, it is important to
consider that the FIR may not be infinite at any section. There are a number of filter responses
obtained using different topologies and the designs depend on the application needed from the
simple frequency cutoff to controlling the behavior for the low pass filter and the band pass
filter. For the FIR digital filter design uses the following approaches for the FIR filter design,
(i) Windowed Fourier series approach
(ii) Frequency sampling approach
(iii) Computer based optimization methods
The transfer function is given as,
H ( z )=∑
n=0
N −1
h ( n ) z−n
The length of the impulse response is given as N and all the poles are obtained about z=0. It is
allowed to place the zeros at any point on the z-plane.
ln( H ( z ))=ln( K )+∑
i=1
n1
ln ( 1−α i z−1 )+∑
i=1
n2
ln (1−βi z−1 )
N2( z )=∏
i=1
n2
(1− βi z−1 )
N1( z )=∏
i =1
n1
(1− αi z−1 )

The non-recursive form of the finite impulse response is given as,
y ( n )=h ( 0 ) x ( n ) +h ( 1 ) x ( n−1 )+ …+h ( N ) x ( n−N )
where N is the order of the filter.
The filter is stable and it provides for the linear phase although when there are many coefficients
are not good for the system or filter performance. The filter impulse response has a finite
duration given such that,
Using the discrete Fourier Transform function on MATLAB to find the transfer function, the
window size is obtained as given in the different kernels. The smoother the window, the peak
side lobes are observed to decrease while the main lobe width increases. There is no need to
increase the window length so as to achieve the same transition bandwidth. The following
illustration demonstrates the low pass FIR filter using window design method,
y ( n )=h ( 0 ) x ( n ) +h ( 1 ) x ( n−1 )+ …+h ( N ) x ( n−N )
where N is the order of the filter.
The filter is stable and it provides for the linear phase although when there are many coefficients
are not good for the system or filter performance. The filter impulse response has a finite
duration given such that,
Using the discrete Fourier Transform function on MATLAB to find the transfer function, the
window size is obtained as given in the different kernels. The smoother the window, the peak
side lobes are observed to decrease while the main lobe width increases. There is no need to
increase the window length so as to achieve the same transition bandwidth. The following
illustration demonstrates the low pass FIR filter using window design method,
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Based on the standards from the published data using a window function,
LAB EXERCISE
PART 1
Designing the kernel filter h(n) for the impulse response.
The design of the FIR filter can be expanded using the Fourier series such that,
h ( e jω )= ∑
n=−∞
∞
h ( n ) e− jwn
LAB EXERCISE
PART 1
Designing the kernel filter h(n) for the impulse response.
The design of the FIR filter can be expanded using the Fourier series such that,
h ( e jω )= ∑
n=−∞
∞
h ( n ) e− jwn
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

& such that,
h ( n ) = 1
2 π ∫
− π
π
H (e jω) e jωn dω
The filter impulse response follows a weighting sequence called a window such that uses the
Fourier Coefficients , h(n), to control the convergence of the series.
^h ( e jω ) = 1
2 π ∫
−π
π
H ( e jθ ) e j ( ω−θ ) dθ
Using the windowing design the low pass filter is given as,
Hd ( ω )= { 1 ,if |ωc|≤ ωc
0 , if ωC <|ωc|< π
The kernel impulse response is obtained as,
hd ( n )= ωc
π
sin ωc n
ωc n
A spectrum convolution is obtained,
H ( ω ) = 1
2 π ∫
− π
π
H d ( λ ) W ( ω−λ ) dλ .. spectrum convolution
It uses the periodic continuous convolution to determine the frequency response based on the
window of the Fourier Transform. Using the Kaiser window,
h ( n ) = 1
2 π ∫
− π
π
H (e jω) e jωn dω
The filter impulse response follows a weighting sequence called a window such that uses the
Fourier Coefficients , h(n), to control the convergence of the series.
^h ( e jω ) = 1
2 π ∫
−π
π
H ( e jθ ) e j ( ω−θ ) dθ
Using the windowing design the low pass filter is given as,
Hd ( ω )= { 1 ,if |ωc|≤ ωc
0 , if ωC <|ωc|< π
The kernel impulse response is obtained as,
hd ( n )= ωc
π
sin ωc n
ωc n
A spectrum convolution is obtained,
H ( ω ) = 1
2 π ∫
− π
π
H d ( λ ) W ( ω−λ ) dλ .. spectrum convolution
It uses the periodic continuous convolution to determine the frequency response based on the
window of the Fourier Transform. Using the Kaiser window,

Implementing the solution on MATLAB,
For Kernel 1,
%% PART I
windowsize=5;
b=(1/windowsize)*ones(1,windowsize);
a=4;
figure(3)
y=filter(b,a,assign2);
plot(t,assign2)
hold on
plot(t,y)
legend('Input Data','Filtered Data')
grid on
0 5 10 15
105
-20000
-15000
-10000
-5000
0
5000
Input Data
Filtered Data
For kernel 2,
windowsize=3;
b=(1/windowsize)*ones(1,windowsize);
a=4;
figure(3)
y=filter(b,a,assign2);
plot(t,assign2)
hold on
plot(t,y)
legend('Input Data','Filtered Data')
grid on
For Kernel 1,
%% PART I
windowsize=5;
b=(1/windowsize)*ones(1,windowsize);
a=4;
figure(3)
y=filter(b,a,assign2);
plot(t,assign2)
hold on
plot(t,y)
legend('Input Data','Filtered Data')
grid on
0 5 10 15
105
-20000
-15000
-10000
-5000
0
5000
Input Data
Filtered Data
For kernel 2,
windowsize=3;
b=(1/windowsize)*ones(1,windowsize);
a=4;
figure(3)
y=filter(b,a,assign2);
plot(t,assign2)
hold on
plot(t,y)
legend('Input Data','Filtered Data')
grid on
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

0 5 10 15
105
-20000
-15000
-10000
-5000
0
5000
Input Data
Filtered Data
For kernel 3,
windowsize=7;
b=(1/windowsize)*ones(1,windowsize);
a=4;
figure(3)
y=filter(b,a,assign2);
plot(t,assign2)
hold on
plot(t,y)
legend('Input Data','Filtered Data')
grid on
105
-20000
-15000
-10000
-5000
0
5000
Input Data
Filtered Data
For kernel 3,
windowsize=7;
b=(1/windowsize)*ones(1,windowsize);
a=4;
figure(3)
y=filter(b,a,assign2);
plot(t,assign2)
hold on
plot(t,y)
legend('Input Data','Filtered Data')
grid on
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

0 5 10 15
105
-20000
-15000
-10000
-5000
0
5000
Input Data
Filtered Data
Using the absolute data version of the assign2.mat values
0 5 10 15
105
0
2000
4000
6000
8000
10000
12000
14000
16000
105
-20000
-15000
-10000
-5000
0
5000
Input Data
Filtered Data
Using the absolute data version of the assign2.mat values
0 5 10 15
105
0
2000
4000
6000
8000
10000
12000
14000
16000

PART II
To evaluate the transfer function using the DFT,
%% PART II
figure(6)
h=fft(y);
t2=1:length(h);
plot(t2,h);
grid on
hold on
h2=fft(y1);
t2=1:length(h2);
plot(t2,h2);
hold on
h3=fft(y2);
t2=1:length(h3);
plot(t2,h3);
grid on
legend('window size=7','window size=3','window size=2')
0 5 10 15
105
-1
0
1
2
3
4
5
6 107
window size=7
window size=3
window size=2
To evaluate the transfer function using the DFT,
%% PART II
figure(6)
h=fft(y);
t2=1:length(h);
plot(t2,h);
grid on
hold on
h2=fft(y1);
t2=1:length(h2);
plot(t2,h2);
hold on
h3=fft(y2);
t2=1:length(h3);
plot(t2,h3);
grid on
legend('window size=7','window size=3','window size=2')
0 5 10 15
105
-1
0
1
2
3
4
5
6 107
window size=7
window size=3
window size=2
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 18
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.