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

Sns Lab Manual

The document is a lab manual that includes various sections such as lab rubrics, a list of experiments, and lab assessment records. It features detailed MATLAB programming tasks for generating and analyzing different types of signals, convolution of signals, and discussions on signal processing concepts like sampling and impulse response. Additionally, it poses post-lab questions to encourage critical thinking about the applications and implications of the experiments conducted.

Uploaded by

rayemma6868
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Sns Lab Manual

The document is a lab manual that includes various sections such as lab rubrics, a list of experiments, and lab assessment records. It features detailed MATLAB programming tasks for generating and analyzing different types of signals, convolution of signals, and discussions on signal processing concepts like sampling and impulse response. Additionally, it poses post-lab questions to encourage critical thinking about the applications and implications of the experiments conducted.

Uploaded by

rayemma6868
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Lab Manual Contents

1. Lab Rubrics with Marks Distribution

2. List of Experiments

3. Lab Assessment Record

4. Detailed Experiment
POSTLAB:

Q 1: what is signal? Compare continuous & discrete signals. Which one is more convenient? Give your
analysis.

Q 2: Write program in Matlab to generate the following signals:

1. Exponentially damped sinusoidal waveform

x=-10:0.5:exp(pi/2)
y= sin(x)
plot(x,y);
figure;
stem(x,y);

2. Saw tooth waveform

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.

Q 2: what is sampling of signals? Analyze the frequency of a signal when it is:

a) Down sampled

b) Up sampled

Also discuss the application of each case.


LAB # 03
Convolution
AIM: To write a MATLAB program to convolve:
Continuous time signals
Discrete time signals
THEORY:
Convolution is usually defined via the convolution integral for continuous time functions or the
convolution sum for discrete-time functions. The convolution of two continuous time functions h(t) and
x(t) written as:

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

(a) Convolution of Continuous Time Signals:

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]=');

y=conv(x,h); subplot(3,1,1) p=a:(a+length(x)-1) stem(p,x)


grid on
xlabel('Time')

ylabel('Amplitude') title('INPUT x(n)') subplot(3,1,2)


q=b:(b+length(h)-1) stem(q,h) A
m
grid on plit
xlabel('Time'); ud
e
ylabel('Amplitude'); title('IMPULSE RESPONSE h(n)'); subplot(3,1,3);
n=a+b:length(y)+a+b-1; stem(n,y);
grid on; disp(y) xlabel('Time'); ylabel('Amplitude');
title('LINEAR CONVOLUTION');
SAMPLE :
Enter the starting point of x[n]=-1
Enter the starting point of h[n]=0
Enter the co-efficients of x[n]=[2 -1 1]
Enter the co-efficients of h[n]=[3 2 1]
Tasks:
The time constant of the circuit is RC 2.5 10 sec -3 = ´ and the impulse response of the system is

The input to the system is a pulse waveform with an amplitude of 4 Volts, a


period of 0.02 seconds, and a duty cycle of 50%. For each set of signals, plot x (t), h (t) and y (t)

X(t)

Y(t)
H(t)

Q2: perform convolution on following discrete time signals using MATLAB:


(1) x(n) = { 1,2,4 }, h(n) = {1,1,1,1,1}

(2) x (n) = { 1,2,3,4,5 }, h(n) = {1}

(3) x (n) = { 1,2,0,2,1},h(n) = x(n)


POSTLAB:
Q1: What happened if a signal is convolved with itself?

Q2: Give some application of convolution.


Tasks:

Q1: Find the solution of following equations and plot the output using Matlab:

POSTLAB:

Q1: Analyze the function of following commands in your words:

a) dsolve() b) solve() c) strcat()

d) poly val()

e) roots()

f) vectorize()

Q 2: what is the difference between function of “colon operator” and “linspace()”.


Tasks:

1. Analyze the system whose transfer function is


G(s) = s/ (s2 + s + (2π100)2) :
(a) Find the impulse response of the system.

(b) Explain the frequency of the oscillations that you see.

(c) Find the step response of the system.

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 2: what is step response of a system? Discuss step response parameters briefly

Q 3: what happens to the system’s settling when the gain of the system given in task 2, is increased?

You might also like