Bangladesh University of Business & Technology: Department of Electrical & Electronic Engineering
Bangladesh University of Business & Technology: Department of Electrical & Electronic Engineering
Bangladesh University of Business & Technology: Department of Electrical & Electronic Engineering
December 6, 2020
Project Report
On
Submitted To
Submitted By
Name ID Intake/Section
Md. Abu Zardar 17182108059 23/2
Md. Ahsanul Habib Sharker 17182108070 23/2
Md. Abdul Wadud 17182108073 23/2
Karimul Wadud Nayem 17182108063 23/2
Md. Abu Naser 17182108065 23/2
Md. Abdur Rakib 17182108006 23/1
Sourav Pal 17182108038 23/1
Dedicated to
Our Parents
and
Honorable Teacher
ACKNOWLEDGEMENT
I express my gratitude and sincere thanks to my teacher Md. Sahabul Hossain, Department of
Electrical and Electronics Engineering for his gracious efforts and keen pursuit, which has
remained as a valuable asset for the successful of our project report. His dynamism and diligent
enthusiasm have been highly instrumental in keeping my spirits high. His flawless and forthright
suggestions blended with an innate intelligent application have crowned my task with success. I
truly appreciate and value his esteemed guidance and encouragement from the beginning to the
end of this thesis. I am indebted to him for having helped me shape the problem and providing
insights towards the solution.
At last but not the least I am highly thankful to the THE ALMIGHTY, who has given me the
courage and wisdom throughout this whole journey.
Table of Contents
Chapter 1 Introduction 1
1.1 Description
1.2 Objective
2.1 Description
2.2 Motivation
5.1 Description
5.2 Function
8.1 Description
8.2 Future Plan
Chapter 9 Conclusion 28
Reference 29
ABSTRACT
In digital control system, interference, which is mixed in the input signal, has a great influence
on the performance of the system. Therefore, processing of input signal has to be done to get
useful signal. Finite impulse response (FIR) filter plays an important role in the processing of
digital signal. Designing the FIR filter by MATLAB can simplify the complicated computation
in simulation and improve the performance. By using the methods of window function,
frequency sampling and convex optimization techniques, the design of FIR filter has been
processed by MATLAB.
In the view of the designed program of MATLAB and we can get the amplitude-frequency
characterization. By using the FIR digital filters which have been designed to process the input
signal based on the MATLAB function, the filtering effect of different digital filters is analyzed
by comparing the signal’s amplitude-frequency diagrams which have been generated. The
experimental results show that the FIR filters designed in this paper are effective.
Page |1
CHAPTER 1
INTRODUCTION
1.1 Description
1.2 Objective
➢ Describe the general approach to filter design and the design equation for FIR filters.
➢ Derive the impulse responses of ideal high-pass linear phase filters.
➢ Describe and demonstrate the sampling method of linear phase FIR filter design.
➢ Describe and demonstrate the window design method for linear phase FIR filters.
➢ Demonstrate the tools in MATLAB for optimized FIR filter design using the
algorithm.
Page |2
CHAPTER 2
BACKGROUND
2.1 Description
In Digital Signal Processing (DSP), an essential part is Filter. For different purposes Different
types of filters are used i.e.
FIR filters are employed in filtering problems where linear phase characteristics within the pass
band of the filter are required. If this is not required, either an IIR or an FIR filter may be
employed. An IIR filter has lesser number of side lobes in the stop band that an FIR filter with
the same number of parameters. For this reason, if some phase distortion is tolerable, an IIR
filter is preferable. Also, the implementation of an IIR involves fewer parameters, less memory
requirements and lower computational complexity.
2.2 Motivation
The purpose of this project is to provide some details about the implementations on the FIR filter
and some additional aspects of the process. FIR filter is one that is described by the differential
equation and by the transfer function. The project is concerned with the problem of designing an
FIR filter that meets the specifications for a limited deviation from the ideal response in certain
frequency bands. The window design technique does not produce optimal filters (in the sense
that the design specifications are most efficiently met in the calculation), but the method is
simple to use and produces reasonably good filters. The window method is effective and widely
used among all the manual design methods.
Page |4
CHAPTER 3
LITERATURE REVIEW
The term ‘filter’ is frequently used in signal processing. A filter is a frequency selective device
that removes unwanted information from the original message signal. Unwanted signals can be
noise or other undesired information. Digital filters are more versatile when compared to the
analog filters in their characteristics such as programming flexibility, ability to handle both low
as well as high frequency signals accurately. Also the hardware requirement is relatively simple
and compact. In real world signals are analog in nature. A simple signal flow block diagram that
explains how the signal is processed to acquire desired output signal is shown in figure
Analog to digital conversion is an engineering process that enables digital processor to interact
with real world signals. The input to the processor should be properly sampled and quantized.
Sampling and quantization restrict the amount of information a digital signal contain. In the
figure an interface is provided between analog signal and the digital signal processor called
analog to digital converter (ADC). The output from ADC is input to the processor. In
applications output from the processor is to be given to user in analog form such as speech
communications, for this an interface is provided from digital domain to the analog domain. This
Page |5
interface is called digital to analog converter (DAC). Thus the signal is provided in analog for to
the user as shown in figure. The processor in figure1.1 can be anywhere from a large
programmable digital computer to a small microprocessor which contains digital filters. The
digital filters are two types based which is FIR and IIR. FIR filters have same time delay for all
frequencies (linear phase), relatively insensitive to quantization and are always stable. FIR filters
can be designed in different ways, for example window method, frequency sampling method,
weighted least squares method, mini and max method and equiripple method. Out of these
methods, the window technique is most conventional method for designing FIR filters
The term FIR abbreviation is “Finite Impulse Response” and it is one of two main types of
digital filters used in DSP applications. Filters are signal conditioners and function of each filter
is, it allows an AC components and blocks DC components. The best example of the filter is a
phone line, which acts as a filter. Because, it limits frequencies to a rage significantly smaller
than the range of human beings can hear frequencies
A finite impulse response filter of length M with input x(n) and output y(n) is described by the
difference equation
𝑀−1
= ∑ 𝑏𝑘 𝑥(𝑛 − 𝑘)
𝑘=0
where bk is the set of filter coefficients. The transfer function of this filter in domain can be
represented as
𝑀−1
𝐻(𝑧) = ∑ ℎ(𝑘) 𝑧 −𝑘
𝑘=0
A window in filter design provides trade off between resolution that is the width of the peak and
spectral leakage that is the amplitude of the tails of desired impulse response. The desired
frequency response specification for linear phase filter is the Fourier transform of the desired
impulse response, and this can be represented as
𝜋
1
ℎ𝑑 (𝑛) = ∫ 𝐻𝑑 (𝜔) 𝑒 𝑗𝜔𝑛 𝑑𝜔
2𝜋 −𝜋
where Hd(w) is the desired frequency response and hd(n) is the corresponding impulse response.
As hd(n) is infinite duration, the sample response must be truncated. Truncation is 10 performed
by multiplying desired sample response with a window function in time domain which gives
sample response of filter represented as
where w(n) is a window function. Various types of windows were used when designing the FIR
filters.
Page |7
A high pass filter is an electronic filter that passes high frequency signals but attenuates (reduces
the amplitude of) signals with frequencies lower than the cut-off frequency. A high pass filter is
a circuit whose amplitude response increases with frequency above the cut-off frequency
The magnitude response of an ideal HP filters can be written as:
=1 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
The Hanning window is a raised cosine window and can be used to reduce the side lobes while
preserving a good frequency resolution compared to the rectangular window. It is commonly
used as general purpose window for the analysis of continuous signals. The Hanning window is
defined as
2𝜋𝑛
𝑤(𝑛) = 0.5 − 0.5𝑐𝑜𝑠( )
𝑀−1
The frequency response for Hanning window is shown in figure and figure shows the frequency
response of a high pass FIR filter designed using Hanning window.
CHAPTER 4
PROPOSED METHOD
This report proposes a hanning window method for a class of Finite Impulse Response(FIR) of
high pass filter characteristics by step cutoff in the frequency domain and having small number
of taps. In this project, we design a high pass FIR filter using hanning window method. Our filter
will passes all signal which frequency is higher than cutoff frequency of 1500 Hz. If the signal
frequency is lower than 1500 Hz, our filter will not passes that signal.
P a g e | 10
CHAPTER 5
METHODOLOGY
5.1 Description
The course of the project began with the study of digital filters and the techniques of digital filter
design. The window method of digital filter design was chosen. A study of the hanning windows
was carried out and a quantitative window functions was done. Using these windows the filter
was designed based on the specifications of operating bandwidth, cutoff frequency, transition
width from passband to the stopband and the degree of suppression in the stopband. For
obtaining the magnitude and phase spectra of the window functions and the filters a MATLAB
program that generates the Discrete Fourier Transform (DFT) was developed. The graphs were
plotted using an application program called plot. Finally, a filter specific to observation of a
celestial radio source using the RRI telescope was designed and applied for actual observations.
5.2 Function
ceil: Here the rounds each element of (3.1/df) to the nearest integer greater than or equal to that
element.
mod: Its returns the remainder after division of N by 2, where N is the dividend and 2 is the
divisor. This function is often called the modulo operation
if else: if expression executes a group of statements when the expression is true. An expression
is true when its result is nonempty and contains only nonzero elements (logical or real numeric).
Otherwise, the expression is false.
freqz: freqz determines the transfer function from the (real or complex) numerator and
denominator polynomial specify, and returns the complex frequency response H(𝑒 𝑗𝜔 ) of a digital
filter. The frequency response is evaluated at sample points determined by the syntax that you
use.
plot and stem: The main point of difference between the two is that plot displays the
continuous values for the curve and stem displays the discrete values of the points on the curve.
P a g e | 11
fliplr: Return its columns flipped in the left-right direction (that is, about a vertical axis).
yticks: yticks(ticks) sets the y-axis tick values, which are the locations along the y-axis where
the tick marks appear. Specify ticks as a vector of increasing values;
filter: The filter function filters a data sequence using a digital filter which works for both real
and complex inputs. The filter is a direct form II transposed implementation of the standard
difference equation.
scatter: linspace is similar to the colon operator, “:”, but gives direct control over the number
of points and always includes the endpoints. “lin” in the name “linspace” refers to generating
linearly spaced values.
P a g e | 12
CHAPTER 6
SIMULATION
ylabel("Magnitude (dB)")
axis([0 Fs/2 min(mag) max(mag)])
yticks(-fliplr([0:10:max(-mag)]))
set(gca,'FontSize',14,'FontWeight','bold');
yyaxis right
plot(F,ang,'r','LineWidth',2);
xlabel("Frequency (Hz)")
ylabel("Angle (degree)")
set(gca,'YColor',[1 0 0])
axis([0 Fs/2 -180 180])
yticks(-180:30:180)
set(gca,'FontSize',14,'FontWeight','bold');
title("Pole-zero plot");
xlabel("Real part");
ylabel("Imaginary part");
axis equal
axis([-2 2 -2 2])
set(gca,'FontSize',14,'FontWeight','bold');
legend(["Zeroes","Poles","Unit circle"])
grid
% Signal generation
x = A.*(cos(2*pi*f*n + theta));
x = sum(x);
subplot(211);
plot(t,x)
title("Input signal");
xlabel("Time (sec)")
ylabel("Amplitude")
axis([min(t) max(t) min(x) max(x)])
set(gca,'FontSize',12,'FontWeight','bold');
ylabel("Magnitude")
axis([0 Fs/2 min(X) max(X)])
set(gca,'FontSize',12,'FontWeight','bold');
P a g e | 18
CHAPTER 7
RESULT AND DISCUSSION
Here, we generate the high pass signal where frequency range is 0 Hz to 4000 Hz and cutoff
frequency is 1500 Hz.
Here, we generate input signal. The input signal frequency spike at 0 Hz, 500 Hz, 1000 Hz,
1500 Hz, 2000 Hz and 3000 Hz
After the high pass filtering we get 3 spike frequency which are 1500 Hz, 2000 Hz and 3000 Hz.
Other 0 Hz, 500 Hz, 1000 Hz was cut for using high pass filter
Here we generate the load input signal 1. Which frequency range is 0 Hz to 4000 Hz
Here we get load output signal 1. Which output frequency range is 1500 Hz to 4000 Hz after use
high pass filter
Here we generate the load input signal 2. Which frequency range is 0 Hz to 4000 Hz
Here we get load output signal 2. Which output frequency range is 1500 Hz to 4000 Hz after use
high pass filter
CHAPTER 8
SOCIAL ECONOMY IMPACT
8.1 Description
To design a low pass filter using hanning window method is very easy. A common man can
easily design a such filter. The making cost is very low and it consumes a less amount of current.
Due to consuming less amount of current so that it reducing carbon emissions.
Although many optimization methods have been discussed in this thesis for the design of digital
FIR and IIR filters but there is still room to improve the design performance of the digital filters.
Different new heuristic optimization methods can be explored which can reduce the complexity
of the implementation of the algorithms, improves the performance of the design methods,
reduces the design error and increases the convergence speed. Further, the filters designed by the
newly developed algorithms can also be implemented on FPGA.
P a g e | 28
CHAPTER 9
CONCLUSION
The report has described the window method techniques involved in the design of FIR filters.
Every method has its own advantages and disadvantages and is selected depending on the type of
filter to be designed. The window method is basically used for the design of prototype filters like
the high pass other is low pass , band pass etc. They are not very suitable for designing of filters
with any given frequency response. On the other hand, the frequency sampling technique is
suitable for designing of filters with a given magnitude response. The ideal frequency response
of the filter is approximated by placing appropriate frequency samples in the z - plane and then
calculating the filter coefficients using the IFFT algorithm.
In order to reduce these errors the different optimization technique for FIR filter design were
presented wherein the remaining frequency samples are chosen to satisfy an optimization
criterion. An appendix consisting of the filter design methods used by the software package
MATLAB is also presented
P a g e | 29
REFERENCES
Oppenheim, Alan V., Willsky, Alan S., and Young, Ian T.,1983: Signals and Systems, p. 256
(Englewood Cliffs, New Jersey: Prentice-Hall, Inc.) ISBN 0-13-809731-3
Rabiner, Lawrence R., and Gold, Bernard, 1975: Theory and Application of Digital Signal
Processing (Englewood Cliffs, New Jersey: Prentice-Hall, Inc.) ISBN 0-13-914101-4
A. E. Cetin, O.N. Gerek, Y. Yardimci, "Equiripple FIR filter design by the FFT algorithm,"
IEEE Signal Processing Magazine, pp. 60-64, March 1997.
Watkinson, John (1998). The Art of Sound Reproduction. Focal Press. pp. 268, 479. ISBN 0-
240-51512-9. Retrieved March 9, 2010.
RP Photonics Encyclopedia - optical filters, dye, etalons, dielectric, dichroic, Lyot, tuners".
www.rp-photonics.com. Retrieved 2019-05-20.
"High-pass filter dictionary definition | high-pass filter defined". www.yourdictionary.com.
Retrieved 2019-05-20.
Andrews, Keith; posting as ssltech (January 11, 2010). "Re: Running the board for a show this
big?". Recording, Engineering & Production. ProSoundWeb. Archived from the original on 15
July 2011. Retrieved 9 March 2010.
"Operation Manual: MA-5002VZ" (PDF). Macro-Tech Series. Crown Audio. 2007. Archived
from the original (PDF) on January 3, 2010. Retrieved March 9, 2010.
"User Manual: PLX Series Amplifiers" (PDF). QSC Audio. 1999. Archived from the original
(PDF) on February 9, 2010. Retrieved March 9, 2010.
Main, Bruce (February 16, 2010). "Cut 'Em Off At The Pass: Effective Uses Of High-Pass
Filtering". Live Sound International. Framingham, Massachusetts: ProSoundWeb, EH
Publishing.
Paul M. Mather (2004). Computer processing of remotely sensed images: an introduction (3rd
ed.). John Wiley and Sons. p. 181. ISBN 978-0-470-84919-4.
Essenwanger, O. M. (Oskar M.) (1986). Elements of statistical analysis. Elsevier. ISBN
0444424261. OCLC 152410575.
Smith, Julius O. (Julius Orion) (2011). Spectral audio signal processing. Stanford University.
Center for Computer Research in Music and Acoustics., Stanford University. Department of
Music. [Stanford, Calif.?]: W3K. ISBN 9780974560731. OCLC 776892709.