Sns Lab Manual
Sns Lab Manual
2. List of Experiments
4. Detailed Experiment
POSTLAB:
Q 1: what is signal? Compare continuous & discrete signals. Which one is more convenient? Give your
analysis.
x=-10:0.5:exp(pi/2)
y= sin(x)
plot(x,y);
figure;
stem(x,y);
x_sawtooth = -10:0.01:exp(pi/2);
y_sawtooth = sawtooth(2 * pi * 0.1 * x_sawtooth);
plot(x_sawtooth, y_sawtooth);
title('Sawtooth Wave');
xlabel('Time');
ylabel('Amplitude');
3. Triangular pulse
x_triangular = -10:0.01:exp(pi/2);
y_triangular = sawtooth(2 * pi * 0.1 * x_triangular, 0.5);
stem(x_triangular, y_triangular);
title('Triangular Pulse Wave');
xlabel('Time');
ylabel('Amplitude');
Up Sampling:
When up sampling, we have a case such as x (n) →x (n/3), for
n such that n/3 ∈ Z. This will space out the existing samples to
every third point in time, as shown in the illustration.
For x[1/2n]:
>>x= [2 3 5 4 6 4];
>>n=(1/2)n;
>>stem(n,x);
Tasks:
Q: Applying following operations on Unit step sequence, Unit ramp sequence & Exponential
sequence
using Matlab and also plot the signals:
∙ x[-n]
∙ x[-n+4]
∙ x[-n-4]
∙ x[n-4]
∙ x[5n]
∙ x[n/4]
Solution:
n=-5:5;
x=-5:5;
a=-n;
b=-n+4;
c=-n-4;
d=n-4;
e=5*n;
f=n/4;
subplot(4,3,2)
stem(n,x)
subplot(4,3,4)
stem(a,x)
subplot(4,3,5)
stem(b,x)
subplot(4,3,6)
stem(c,x)
subplot(4,3,7)
stem(d,x)
subplot(4,3,8)
stem(e,x)
subplot(4,3,9)
stem(f,x)
POSTLAB:
Q1: Today the world is going to be digitized; still analog signals & systems are not discarded. Give
your comments.
a) Down sampled
b) Up sampled
The convolution integral exists if h(t) and x(t) are absolutely integrable. The convolution of two discrete-
time functions h[n] and x[n] written h[n]* x[n]can be found using the convolution sum
ALGORITHM:
∙ Define the input signals
∙ Using ‘conv’ function to convolve the inputs
∙ Using ‘sub plot’ function to plot the signals
MATLAB CODE:
tint=0;
tfinal=10;
tstep=.01;
t=tint:tstep:tfinal;
x=1*((t>=0)&(t<=1));
subplot(3,1,1),
plot(t,x)
axis([0 4 0 2]) h=1*((t>=0)&(t<=1));
subplot(3,1,2),
plot(t,h) axis([0 4 0 2])
t2=2*tint:tstep:2*tfinal;
y=conv(x,h)*tstep;
subplot(3,1,3),
plot(t2,y)
axis([0 4 0 2])
(b) Convolution of Discrete Signals
ALGORITHM:-
∙ Get the starting point of input signals
∙ Get the coefficients of input signals
∙ Using ‘conv’ function to convolve the inputs
∙ Using ‘stem’ function plot the signals
MATLAB CODE :
clc;
clear all;
close all;
a=input('Enter the starting point of x[n]='); b=input('Enter the
starting point of h[n]='); x=input('Enter the co-efficients of
x[n]='); h=input('Enter the co-efficients of
h[n]=');
X(t)
Y(t)
H(t)
Q1: Find the solution of following equations and plot the output using Matlab:
POSTLAB:
d) poly val()
e) roots()
f) vectorize()
2. Consider the system of Figure 5.4. Let H(s) = 1, having general T(s)= G(s)/(1+G(s)*H(s)),
Find the step response of the system described by the figure when:
(a) G(s) = 0.125/(s2 + s)
(b) G(s) = 0.25/(s2 + s)
(c) G(s) = 0.5/(s2 + s)
(d) G(s) = 1/(s2 + s)
e)What effect does the increased gain have on the system's performance?
(Please address both the system's rise time and the amount of overshoot in the system's output.)
1)
2)
3)
4)
POSTLAB:
Q 1: what is impulse response of a system? Give a brief account on the importance of impulse response
of an LTI system.
Q 3: what happens to the system’s settling when the gain of the system given in task 2, is increased?