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

Lowpass and highpass filter project

This project examines Low Pass Filters (LPF) and High Pass Filters (HPF), which are vital in signal processing and communication systems. The methodology includes designing and implementing these filters using MATLAB to process signals, particularly focusing on noise reduction and frequency shaping. The document details the technical approach, code implementation, and definitions of key concepts related to filter design and signal processing.

Uploaded by

priyamlala22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Lowpass and highpass filter project

This project examines Low Pass Filters (LPF) and High Pass Filters (HPF), which are vital in signal processing and communication systems. The methodology includes designing and implementing these filters using MATLAB to process signals, particularly focusing on noise reduction and frequency shaping. The document details the technical approach, code implementation, and definitions of key concepts related to filter design and signal processing.

Uploaded by

priyamlala22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

MINIPROJECT

TOPIC -LOWPASS FILTER AND HIGH PASS FILTER


OVERVIEW OF PROJECT
This project explores the fundamental concepts of Low Pass Filters (LPF)
and High Pass Filters (HPF), which are essential components in signal
processing and communication systems.

Low Pass Filter (LPF):


Allows signals with frequencies lower than a
specified cutoff frequency to pass through.
Attenuates or blocks signals with frequencies
higher than the cutoff frequency.
Common applications include audio processing,
noise reduction, and smoothing signals.
High Pass Filter (HPF):
Allows signals with frequencies higher than
a specified cutoff frequency to pass
through.
Attenuates or blocks signals with frequencies
lower than the cutoff frequency.
Used in removing unwanted low-frequency
noise, sharpening edges in images, and
differentiating signals.

Both filters play a crucial role in shaping the frequency spectrum of signals,
with applications across electronics, communication systems, and digital
signal processing.
Methodology
Research
1.Youtube channel click here

Project scope
1.Signal Processing.
2.Image Processing
3.Audio Processing
4.Communicatioin System
Technical Approach
SOFTWARE USED
MATLAB

CODE:
% Low-pass and High-pass Filter Implementation in MATLAB

% Generate a noisy signal (a sine wave with noise)


Fs = 1000; % Sampling frequency (Hz)
t = 0:1/Fs:1-1/Fs; % Time vector (1 second)
f = 50; % Frequency of the sine wave (Hz)

% Original signal (sine wave)


x = sin(2*pi*f*t);
% Add Gaussian noise to the signal
noisy_signal = x + 0.5*randn(size(t));

% Design parameters
cutoff_low = 100; % Low-pass filter cutoff frequency (Hz)
cutoff_high = 100; % High-pass filter cutoff frequency (Hz)
normalized_cutoff_low = cutoff_low / (Fs/2); % Normalized cutoff frequency (low-pass)
normalized_cutoff_high = cutoff_high / (Fs/2); % Normalized cutoff frequency (high-pass)
filter_order = 50; % Filter order

% Low-pass filter design using fir1


low_pass_filter = fir1(filter_order, normalized_cutoff_low, 'low');

% High-pass filter design using fir1


high_pass_filter = fir1(filter_order, normalized_cutoff_high, 'high');

% Apply low-pass filter to the noisy signal


filtered_signal_low = filter(low_pass_filter, 1, noisy_signal);

% Apply high-pass filter to the noisy signal


filtered_signal_high = filter(high_pass_filter, 1, noisy_signal);
% Plot the original, noisy, low-pass filtered, and high-pass filtered signals
figure;
subplot(4, 1, 1);
plot(t, x);
title('Original Signal (50 Hz Sine Wave)');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(4, 1, 2);
plot(t, noisy_signal);
title('Noisy Signal');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(4, 1, 3);
plot(t, filtered_signal_low);
title('Filtered Signal (Low-pass Filter)');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(4, 1, 4);
plot(t, filtered_signal_high);
title('Filtered Signal (High-pass Filter)');
xlabel('Time (s)');
ylabel('Amplitude');
RESULT
DISCUSSION 1. Sampling Frequency (Fs)
Definition: The rate at which samples of a continuous signal are taken to convert it
into a discrete signal.
Units: Hertz (Hz), which represents samples per second.
In the Code: Fs = 1000; indicates that the signal is sampled at 1000 Hz.
2. Time Vector (t)
Definition: A vector that represents time instances at which the samples of the
signal are taken.
In the Code: t = 0:1/Fs:1-1/Fs; generates a time vector starting from 0 seconds to just
under 1 second, with increments of 1/Fs1/Fs1/Fs.
3. Frequency (f)
Definition: The rate at which a periodic signal (like a sine wave) oscillates.
Units: Hertz (Hz).
In the Code: f = 50; specifies that the frequency of the sine wave is 50 Hz.
4. Original Signal (x)
Definition: The clean sine wave signal generated based on the specified frequency.
In the Code: x = sin(2*pi*f*t); creates a sine wave signal using the sine function. The
expression 2*pi*f converts the frequency to angular frequency (radians per second).
5. Gaussian Noise
Definition: A statistical noise that has a probability density function equal to that of
the normal distribution (Gaussian distribution). It is often used to simulate real-
world noise in signals.
In the Code: noisy_signal = x + 0.5*randn(size(t)); adds Gaussian noise to the original
sine wave. The randn function generates random numbers from a normal
distribution.
6. Cutoff Frequency
Definition: The frequency at which the filter begins to attenuate the input signal.
In the Code:
cutoff_low = 100; specifies the cutoff frequency for the low-pass filter.
cutoff_high = 100; specifies the cutoff frequency for the high-pass filter.
7. Normalized Cutoff Frequency
Definition: The cutoff frequency expressed as a fraction of the Nyquist frequency
(half the sampling frequency).
In the Code:
normalized_cutoff_low = cutoff_low / (Fs/2); calculates the normalized cutoff
frequency for the low-pass filter.
normalized_cutoff_high = cutoff_high / (Fs/2); does the same for the high-pass
filter.
8. Filter Order
Definition: The order of a filter defines its complexity. A higher order generally
results in a steeper roll-off and more selectivity.
In the Code: filter_order = 50; sets the filter order to 50.
9. Low-pass Filter Design (fir1)
Definition: A finite impulse response (FIR) filter designed using the fir1 function in
MATLAB.
In the Code: low_pass_filter = fir1(filter_order, normalized_cutoff_low, 'low'); creates
a low-pass filter using the specified order and normalized cutoff frequency.
10. High-pass Filter Design (fir1)
Definition: Similar to the low-pass filter, but it allows high frequencies to pass while attenuating low
frequencies.
In the Code: high_pass_filter = fir1(filter_order, normalized_cutoff_high, 'high'); creates a high-pass filter.
11. Filter Function
Definition: A function used to apply a filter to a signal.
In the Code:
filtered_signal_low = filter(low_pass_filter, 1, noisy_signal); applies the low-pass filter to the noisy signal.
filtered_signal_high = filter(high_pass_filter, 1, noisy_signal); applies the high-pass filter to the noisy signal.
12. Plotting
Definition: The process of visualizing data using graphs or charts.
In the Code:
figure; creates a new figure window for plotting.
subplot(4, 1, x); divides the figure into a grid and selects the x-th subplot for plotting.
plot(t, x); plots the specified signal against the time vector.
title, xlabel, and ylabel functions add titles and labels to the plots.
13. Sine Wave
Definition: A smooth periodic oscillation that is a fundamental waveform in trigonometry and signal processing.
In the Code: x = sin(2*pi*f*t); generates the sine wave that serves as the original signal.
THANK YOU

You might also like