You are on page 1of 6

NATIONAL UNIVERSITY OF MODERN LANGUAGES

Faculty of Engineering & Computer Science


BEL - IV (Afternoon) – Final-Term Examination – Fall 2022
Paper: Signals and Systems Lab Total Marks: 100
Time Allowed: 100 Mins Roll No: _210009________

Question 1
Suppose you are given the following system discrete system with the input x(t) and the system
response h(t) (40 Marks)

x(n) h(n) y(n)=x(n)*h(n)

Where,
x(n)=[ 1 -1.5 2 -0.75 3 -2 0.5]
h(n)=[-1 0 0.5 2.5 1]
a. Find the output of the system y(n) by using the convolution and compare the results by solving the
convolution in Fourier domain. Are the results same in both domain?
b. Plot the magnitude and phase of the system response i.e. h(n)

Answer:
x=[1,2,1,2,1,1];
h=[1,2,-1,1,3];
y=conv(x,h);
subplot(311);stem(x);title('Input Signal');
subplot(312);stem(h);title('Impulse Response');
subplot(313);stem(y);title('output Signal');
_n=-1:3;

y=1:5;
k=0:500;
w=(pi/500)*k;
x=y*exp(-j*pi/500).^(n'*k);
magx=abs(x);
angx=angle(x);
realx=real(x);
imagx=imag(x);
subplot(221);
plot(w/pi,magx);
grid;
xlabel('frequency in pi units')
ylabel('Magnitude')
title('Absolute Value');
subplot(222);
plot(w/pi,imagx);
grid;
xlabel('frequency in pi units')
ylabel('Magnitude')
title('Imaginary value');
subplot(223);
plot(w/pi,realx);
grid;
xlabel('frequency in pi units')
ylabel('Magnitude')
title('real value');
subplot(224);
plot(w/pi,angx);
grid;
xlabel('frequency in pi units')
ylabel('Magnitude')

Question 2
Take two different sounds from the Matlab library (60 Marks)

a. Plot the spectrum (Fourier) of the signals (both sounds)


b. Add random noise in the signals and plot their Fourier transforms
c. Hide the original information of the sound signals by applying various Matlab operations then
recover the actual information.
Answer:

This is the figure:

Code:

[Y,fs]=audioread('C:\Users\student\Desktop\taha.wav');

time=(1/fs)*length(Y);

t=linspace(0,time,length(Y));
plot(t,Y)

load handel
sound(y,Fs);
time=(1/Fs)*length(y);

t=linspace(0,time,length(y));
plot(t,y)

this figure:

Code:

[Y,fs]=audioread('C:\Users\student\Desktop\taha.wav');

time=(1/fs)*length(Y);

t=linspace(0,time,length(Y));
plot(t,Y)

load handel
sound(y,Fs);

time=(1/Fs)*length(y);

t=linspace(0,time,length(y));
plot(t,y)

load gong.mat;
sound(y);
figure:

You might also like