Rakibul DSP - 8 Final
Rakibul DSP - 8 Final
LAB REPORT
Experiment Name : Design of Digital FIR filter and its application signal
separation
Experiment : Open Ended Lab
Course Name : Digital Signal Processing
Sessional Course Code : EEE-3604
Submitted To
Engr. Md. Abdul Kader
Assistant Professor
Department of EEE,
Submitted By IIUC
Objective:
Filter Description:
The steps provided outline how to design a lowpass FIR filter in MATLAB.
- Choosing the desired filter order (the length of the filter impulse response). A higher order
results in narrower transition widths and higher stopband attenuation but increases computational
complexity.
- Selecting a suitable window function to shape the filter's frequency response. Common
window functions include Hamming, Bartlett, Blackman, and more. The choice of window
affects the side lobe characteristics of the filter.
- MATLAB provides functions like `firce qrip` and `figure` for designing FIR filter
coefficients. These functions take inputs such as filter order, passband frequency, stopband
frequency, and window function to generate a vector of filter coefficients. Alternatively, we can
design filter coefficients manually using mathematical expressions.
hd=sin(wc*(n-(M-1)./2))./(pi*(n-(M-1)./2))
4. Implement the
Filter:
- Once we have the filter coefficients, apply the filter to your input signal using the `filter`
function in MATLAB. This function takes the filter coefficients and the input signal as inputs
and produces the filtered output signal.
Problem:
Generate a signal which has four frequency components of frequency f1, f2, f3 and f4 (in Hz)
where; f1=23*L , f2= 12*(M+2) , f3=17*(N+2) and f4=11*|L+M-N| (Take the absolute value of
(L+M-N). [L, M, and N should be taken from your matric ID comparing your ID with the syntax
ET-ALBCMN] Now design a digital FIR filter (using MATLAB) which will remove f1 or f2 or
f3 or f4 frequency (choose f1 if MN is even-even, f2 if MN is even-odd, f3 if MN is odd-even,
else f4 from the signal. You are not allowed to use any in-built functions of FIR filter or, filter
ET-213005 page : 2
design toolbox. After design, you must verify your filter operation by analyzing the following
graphs:
Program:
Here my ID is ET-213005. Compared with ET-ALBCMN, we get the frequencies, f1=23; f2=60;
f3=153; f4=-33 After generating a raw/noisy signal with these frequencies, I have to design a
digital FIR Band Stop filter to remove the f2=60 frequency from the raw signal.
Signal Separation:
ET-213005 page : 4
Result:
Fig. 01: Time domain and frequency domain representation of Noisy and Filtered signal.Analysis:
- The code generates a noisy signal `y_05` by summing four sinusoidal components with
different frequencies.
- It then plots the generated signal in the time domain using `subplot(3, 2, 1)` and labels it as
"Generated Noisy Signal in Time Domain-ET213037."
- In the frequency domain, the code calculates the Fast Fourier Transform (FFT) of the signal
and plots it in `subplot(322)`. This plot shows the frequency components present in the noisy
signal.
ET-213005 page : 5
- The code designs a low-pass FIR filter (`h`) using the `fir_bandstop` function. The filter design
is based on a two cutoff frequency (`cut_off 1 , cut off 2`) and an order (`256`).
- The impulse response of the designed filter is plotted in `subplot(3, 2, 3)` using `stem(h)`. This
plot shows the filter's time-domain characteristics.
- The code also computes and plots the frequency response of the filter in `subplot(3, 2, 4)` using
the `freqz` function. This plot displays how the filter affects different frequencies.
- The original noisy signal (`y_21`) is filtered using the designed FIR filter `h` through
convolution, resulting in the filtered signal `filtered_sig`.
- The filtered signal is then plotted in the time domain using `subplot (325)`. This plot shows the
effect of the filter on the signal.
- In the frequency domain, the code calculates the FFT of the filtered signal and plots it in
`subplot (326)`. This plot displays the frequency components of the filtered signal.
Application :
1. Noise Reduction in Audio: It can be applied to clean up noisy audio recordings, reducing
unwanted background noise to enhance audio quality.
2. Feature Extraction in Data Analysis: In data analysis, it can help identify and extract
important patterns or features from noisy data, aiding in decision-making and insights.
3. Biomedical Signal Processing: In biomedical applications, it helps clean up heart and brain
signals by removing unwanted noise and keeping important data
Discussion:
The goal of this MATLAB project is to clean up a noisy signal by using a band-stop filter. Similar to a
tool, the filter can be modified to eliminate unnecessary components of the signal while retaining the
crucial ones. I select the band stop filter, the cutoff frequency, and the signal's "windows" based on my
analysis of the signal. It follows that the signal in the subplot (3,2,6) is free of the f2 frequency
component.
Real-world applications include improving the audio quality of noisy recordings and extracting crucial
information from jumbled signals. It's a method of using signal processing techniques to improve the
utility and comprehension of signals.