Professional Documents
Culture Documents
Group-1 Assignment Report
Group-1 Assignment Report
U4EIE18029)
K.Gowtham (BL.EN.U4EIE18019)
Jagan M (BL.EN.U4EIE18018)
Course : Signal Processing Lab
Course code : 15EIE381
Date : 24 April 2021
--------------------------
clc;
clear;
close all;
%signal 1
fs1 = 27000; %sampling frequency - taken as per Nyquist sampling theorm
n1 = (-1/900)*fs1:1:(1/900)*fs1;
t1 = (-1/10000):(1/180000):(1/10000);
ts1 = 1/fs1;
figure(1)
xt1 = 4*sin(2*pi*9000*t1);
subplot(2,1,1);
plot(t1,xt1); %continous plot
xlabel('time')
ylabel('amplitude')
title('input signal - x1(t)')
legend('continous time plot')
grid on;
xn1 = 4*sin(2*pi*9000*n1*ts1);
subplot(2,1,2);
stem(n1,xn1); %discrete plot
xlabel('n - discrete time')
ylabel('amplitude')
title('input signal - x1(t)')
legend('discrete time plot')
grid on;
%signal 2
fs2 = 15000; %sampling frequency
n2 = (-1/500)*fs2:1:(1/500)*fs2;
figure(2)
xt2 = 4*sin(2*pi*5000*t1);
subplot(2,1,1);
plot(t1,xt2); %continous plot
xlabel('time')
ylabel('amplitude')
title('input signal - x2(t)')
legend('continous time plot')
grid on;
xn2 = 4*sin(2*pi*5000*n2*ts1);
subplot(2,1,2);
stem(n2,xn2); %discrete plot
xlabel('n - discrete time')
ylabel('amplitude')
title('input signal - x2(t)')
legend('discrete time plot')
grid on;
%signal 3
fs3 = 12000; %sampling frequency
n3 = (-1/400)*fs3:1:(1/400)*fs3;
figure(3)
xt3 = 3*sin(2*pi*2000*t1);
subplot(2,1,1);
plot(t1,xt3); %continous plot
xlabel('time')
ylabel('amplitude')
title('input signal - x3(t)')
legend('continous time plot')
grid on;
xn3 = 3*sin(2*pi*2000*n3*ts1);
subplot(2,1,2);
stem(n3,xn3); %discrete plot
xlabel('n - discrete time')
ylabel('amplitude')
title('input signal - x3(t)')
legend('discrete time plot')
grid on;
filter_output = filter(h_filter,1,input_fir)
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
%output of the fir filt`er designed above
%plotting the input and output responses of the filter
Y = fft(filter_output);
N1=length(xn1)-1;
k=0:length(Y)-1;
figure(5)
subplot(2,1,2) %output
stem(k*fs1/N1,abs(Y));
xlabel('Frequency(Hz)');
ylabel('Magnitude');
title('Filter Output Response');
grid;
subplot(2,1,1) %input
input_fft = fft(input_fir);
k1=0:length(input_fft)-1;
subplot(2,1,1)
stem(k1*fs1/N1,abs(input_fft));
xlabel('Frequency(Hz)');
ylabel('Magnitude');
title('Filter Input Response');
grid on;
Outputs:
Figure windows: Depicts input signal in time domain in continuous as well as
in discrete domain, Filter input and Filter output responses, Frequency response
of the FIR Filter Designed, Y(k) – Magnitude Response.
Command Window: Input and output of delay element that has been designed.
Input Signal:
Frequency response of the FIR Filter Design:
Input and Output of the FIR Filter:
xn3 =
Columns 1 through 7
Columns 8 through 14
Columns 15 through 21
Columns 22 through 28
Columns 29 through 35
Columns 36 through 42
Columns 50 through 56
Columns 57 through 61
delay_output =
Columns 1 through 7
Columns 8 through 14
Columns 15 through 21
Columns 29 through 35
Columns 36 through 42
Columns 43 through 49
Columns 50 through 56
Columns 57 through 61