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

SNS Lab File

1) The document describes experiments in MATLAB to generate and manipulate signals. It includes generating sine, cosine, exponential, ramp and unit-step signals. 2) The experiments also demonstrate adding, subtracting, multiplying and dividing two signals (sine and cosine waves). 3) The results show the waveforms generated for each individual signal type as well as the combined signals after each operation.

Uploaded by

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

SNS Lab File

1) The document describes experiments in MATLAB to generate and manipulate signals. It includes generating sine, cosine, exponential, ramp and unit-step signals. 2) The experiments also demonstrate adding, subtracting, multiplying and dividing two signals (sine and cosine waves). 3) The results show the waveforms generated for each individual signal type as well as the combined signals after each operation.

Uploaded by

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

DELHI TECHNOLOGICAL UNIVERSITY

1
SIGNALS AND
SYSTEMS LAB

Submitted to: N
Jayanthi Submitted
by: Saiyam Soni

COE
Department 2K18/EC/147

Batch E1,
ECE

TABLE OF CONTENTS
S.NO. TOPIC DONE ON CHECKED ON SIGNATURE

2
EXPERIMENT 1

Aim: Write a MATLAB program to generate sine, cosine, exponential, unit-step and ramp signal
waveforms

Theory:

1. Sine signal; Can be expressed as y(t)= Asin(ωt+φ) where,

A= Amplitude

ω=frequency in radians/second

φ=phase angle in radians

3
When Sine wave starts from zero and covers positive values, reaches zero, and again covers
negative values, reaches zero, it is said to have completed one cycle or single cycle. The upper part
of sine wave is called positive cycle and the lower part is called negative cycle in a single cycle.
For different values of time, the Signal gives the values of quantity at that time. Therefore, the
signal is a function of time.

2. Cosine signal: A cosine wave is a signal waveform with a shape identical to that of a sine wave ,
except each point on the cosine wave occurs exactly 1/4 cycle earlier than the corresponding point
on the sine wave. A cosine wave and its corresponding sine wave have the same frequency, but
the cosine wave leads the sine wave by 90 degrees of phase.

3. Exponential signal: Can be represented as y(t)=Ceat where

C and a=constants

e=mathematical constant=2.71828

If a is positive, as t increases, y(t) also increases exponentially.

4
4. Ramp signal: Can be represented as

5. Unit-step function: It is also known as Heaviside unit function and is represented as

Code:

1. Sine signal:

t=0:0.1:2*pi;

y=sin(t);

plot(y);

title('sine function');

xlabel('t');

ylabel('y=sin(t)');

2. Cosine signal:

5
t=0:0.1:2*pi;

y=cos(t);

plot(y);

title('cos function');

xlabel('t');

ylabel('y=cos(t)');

3. Exponential signal:

t=0:0.1:10;

y=exp(t);

plot(y);

title('exponential function');

xlabel('t');

ylabel('y=exp(t)');

4. Ramp signal:

t=0:10;

y=t;

plot(y);

title('Ramp function');

xlabel('t');

ylabel('y=t');

5. Unit-step signal:

T=10;

6
a=[];

for t=1:10

if t>=0 && (t<=T/2)

y=1;

else

y=0;

end

a=[a y];

end

plot(a);

title(‘Unit-step function’);

xlabel('t');

ylabel('y(t)');

or

T=10;

a=[];

for t=1:10

if t>=0 && (t<=T/2)

y=1;

else

y=0;

end

a=[a y];

7
end

stem(a);

title(‘Unit-step function’);

xlabel('t');

ylabel('y(t)');

Output:

1. Sine signal:

2. Cosine signal:

3. Exponential signal:

8
4. Ramp signal:

5. Unit-step signal:

9
Result: We were able to generate sine, cosine, exponential, ramp and unit-step signal
waveforms.

EXPERIMENT 2

Aim: Write a MATLAB program to generate signals and perform different operations such as
addition, subtraction, multiplication and division on them

Theory: Consider two signals x(t) and y(t).

Addition of both the signals results in z(t)=x(t)+y(t)

Subtraction of both the signals results in z(t)=x(t)-y(t)

Multiplication of both the signals results in z(t)=x(t)*y(t)

Division of both the signals results in z(t)=x(t)/y(t)

10
Code:

t=0:0.1:10;

y1=sin(t);

y2=cos(t);

a=y1+y2;

b=y1-y2;

c=y1.*y2;

d=y1./y2;

subplot(3,2,1);

plot(y1);

title('sine function');

xlabel('t');

ylabel('y1=sint');

subplot(3,2,2);

plot(y2);

title('cos function');

xlabel('t');

ylabel('y2=cost');

subplot(3,2,3);

plot(a);

title('Addition');

xlabel('t');

ylabel('a=y1+y2');

subplot(3,2,4);

plot(b);

11
title('Subtraction');

xlabel('t');

ylabel('b=y1-y2');

subplot(3,2,5);

plot(c);

title('multiplication');

xlabel('t');

ylabel('c=y1.*y2');

subplot(3,2,6);

plot(d);

title('Division');

xlabel('t');

ylabel('d=y1./y2');

12
Output:

Result: We were able to generate two signals and perform operations such as addition,
subtraction, multiplication and division on them.

13

You might also like