0% found this document useful (0 votes)
17 views

Lab Report Digital Filters

Uploaded by

Muhammad Muneeb
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Lab Report Digital Filters

Uploaded by

Muhammad Muneeb
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab Report: Introduction to Digital Filters in MATLAB for Signal Processing

Introduction
In signal processing, Infinite Impulse Response (IIR) filters are a class of digital filters
characterized by the feedback loop in their structure. Unlike Finite Impulse Response (FIR)
filters, IIR filters have feedback, allowing them to have an infinite impulse response.

In biomedical engineering, IIR filters, specifically Chebyshev Type II and Elliptic filters, play
vital roles in signal processing tasks. Chebyshev Type II filters are designed to achieve a
steeper roll-off in the stopband with a higher level of ripple in the passband. This
characteristic is particularly useful in applications where a more aggressive attenuation of
specific frequencies is required, such as in filtering out unwanted noise from biomedical
signals. Elliptic filters provide an optimal balance between the steepness of roll-off in both
the passband and stopband, making them suitable for applications where precise control
over the frequency response is critical. In biomedical contexts, these filters find applications
in tasks like electrocardiography (ECG) and electroencephalography (EEG) signal
processing, ensuring accurate and reliable extraction of physiological information while
effectively mitigating unwanted interference and noise.

Objective
The objective of this lab is to use Chebyshev Type II and Elliptic filters to remove noise
added to a signal and analyze their effectiveness using MATLAB.

MATLAB Code
The following MATLAB code was used to implement the Chebyshev Type II and Elliptic
filters, and to process the noisy signal to remove unwanted noise:

% Load the noisy signal from the CSV file


noisy_signal = csvread('C:\Users\M.Adnan Munir\Downloads\noisy_signal (2).csv');

% Sampling frequency (assume or modify as per requirement)


fs = 1000; % Hz (example value)

% Define filter parameters


order = 4; % Filter order
cutoff_freq = 50; % Hz (example cutoff frequency)

% Design Chebyshev Type II filter


[cheb_b, cheb_a] = cheby2(order, 20, cutoff_freq / (fs / 2), 'low');

% Design Elliptic filter


[ellip_b, ellip_a] = ellip(order, 1, 20, cutoff_freq / (fs / 2), 'low');

% Apply filters to the noisy signal


filtered_signal_cheb = filtfilt(cheb_b, cheb_a, noisy_signal);
filtered_signal_ellip = filtfilt(ellip_b, ellip_a, noisy_signal);

% Plot the original noisy signal and the filtered signals separately
figure;

% Original noisy signal


subplot(3, 1, 1);
plot(noisy_signal, 'r');
title('Original Noisy Signal');
xlabel('Samples');
ylabel('Amplitude');
grid on;

% Chebyshev Type II filtered signal


subplot(3, 1, 2);
plot(filtered_signal_cheb, 'b');
title('Filtered Signal (Chebyshev Type II)');
xlabel('Samples');
ylabel('Amplitude');
grid on;

% Elliptic filtered signal


subplot(3, 1, 3);
plot(filtered_signal_ellip, 'g');
title('Filtered Signal (Elliptic)');
xlabel('Samples');
ylabel('Amplitude');
grid on;

Results
The results obtained from the MATLAB simulation are displayed below. The original noisy
signal and the filtered signals (using Chebyshev Type II and Elliptic filters) are shown.

Refer to the attached figures or screenshots for visual results showcasing the effectiveness
of the filters in removing noise.

Conclusion
The lab demonstrated the effectiveness of Chebyshev Type II and Elliptic filters in reducing
noise from a signal. The Chebyshev Type II filter provided a steep roll-off in the stopband,
while the Elliptic filter balanced the response between the passband and stopband. Both
filters were successfully applied to the noisy signal using MATLAB.

You might also like