MTLB9
MTLB9
122EC0339
MATLAB CODE:
clc;close all;clear all;
fc=400;
Fs=1000;
%using butterworth filter to find the tf coefficients for a given fc
[b,a]= butter(2,(fc/(Fs/2)),"high")
H_z=tf(b,a,1);%transfer function
% Convolve the input signal with h(n) to get the output signal
y= conv (x, h_n, 'same');
% Calculate the frequency domain representation of the input, filter, and output
Xf=fft(x);
Hf=fft(h_n, length (Xf));
Yf=fft(y);
122EC0339
subplot (2, 1, 2);
plot (frequencies, abs(Yf));
title('Output Signal Frequency Domain Representation (Y(f))');
xlabel('Frequency (Hz)');
ylabel('|Y(f)|');
xlim([0 500])
MATLAB RESULTS:
122EC0339
DISCUSSION ON RESULTS:
The output signal clearly showcased the filtering ac on of the high-pass
filter. The lower-frequency component (10 Hz) was significantly
a enuated, while the higher-frequency component (450 Hz) was
preserved. This demonstrates that the filter effec vely passes signals
above the cutoff frequency while suppressing lower-frequency content,
in line with high-pass filter expecta ons. The magnitude of the filter's
frequency response was plo ed, providing a visual representa on of its
behaviour across the frequency spectrum. The plot confirmed that the
filter's magnitude response increases with frequency, which aligns with
the characteris cs of a high-pass filter. The impulse response of the filter
revealed its response to an impulse input. It allowed us to observe how
the filter behaves in the me domain, emphasizing the filter's transient
response and its effect on the input signal over me.
CONCLUSION:
In this experiment, we successfully designed a high-pass filter using
specified transfer func on coefficients and leveraged MATLAB to analyze
its performance. The results demonstrated that the filter effec vely
a enuates low-frequency components while preserving high-frequency
signals, as evident in the me and frequency domain representa ons.
The magnitude of the filter's frequency response validated its high-pass
characteris cs. This experiment illustrates the prac cal applica on of
high-pass filters in signal processing, where they are essen al for noise
reduc on, signal separa on, and various other applica ons requiring the
isola on of higher-frequency content.
NAME-AKSHAR DASH
ROLL.NO-122EC0339
122EC0339