0% found this document useful (0 votes)
77 views7 pages

Sin, Cos, Exp Insingle Figure

The document discusses drawing sine, cosine, and exponential curves in MATLAB. It also discusses drawing unit step, impulse, and ramp signals. It provides the equations for these signals. It includes the MATLAB code used to generate plots of these different signals in separate figures for comparison.

Uploaded by

Honey Kaushik
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views7 pages

Sin, Cos, Exp Insingle Figure

The document discusses drawing sine, cosine, and exponential curves in MATLAB. It also discusses drawing unit step, impulse, and ramp signals. It provides the equations for these signals. It includes the MATLAB code used to generate plots of these different signals in separate figures for comparison.

Uploaded by

Honey Kaushik
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

sine cosine and exponential curve 2.

1.5

amplitude-->

0.5

-0.5

-1 0

0.5

1.5 w-->

2.5

3.5

AIM: 1. TO DRAW SINE, COSINE AND EXPONENTIAL CURVE IN 1 FIGURE USING DIFFERENT COLORS USING MATLAB 2. TO DRAW UNIT STEP, IMPULSE, RAMP SIGNALS IN DIFFERENT FIGURES

THEORY

Sine Function: A function f(x)=sin(x) is a periodic function with a period of 2, it will form a periodic wave after 2. The f(x) will lie between -1 to +1.

Cosine Function: A function f(x)=cos(x) is a periodic function with a period of 2, it will form a periodic wave after 2.

Exponential Function: A function f(x)=ex is defined as:

0<f(x)1; 1f(x)<;

for -x0 for 0x

Unit impulse Function: Unit impulse is a signal that is 0 everywhere except at n=0 where it is 1. In discrete time domain the unit impulse signal is defined as: (n) =1; = 0; n=0 elsewhere

Unit Step Function: The integral of the impulse function is a unit step signal. In discrete time unit step signal is defined as:

U(n) =1; = 0;

n>=0 n<0

Unit ramp function: The integral of the step function is a unit ramp signal. It is defined as: R(n)=kt; n>=0 =0; n<0

MATLAB CODE FOR SINE, COSINE AND EXPONENTIAL CURVES.

clc; clear all; close all; w=0:0.01:pi; a=sin(w); b=cos(w); c=exp(w); plot(w ,a, 'r' ,w ,b, 'g', w,(c/10),'b'); title('sine cosine and exponential curve'); xlabel('w-->'); ylabel('amplitude-->');

MATLAB CODE FOR UNIT STEP SIGNAL

clc clear all close all w=-50:1:50; y=ones(1,51); x=zeros(1,50); z=[x ,y]; figure; stem(w ,z); ylabel('amplitude-->'); xlabel('n-->'); title('UNIT STEP SIGNAL');

UNIT STEP SIGNAL 1

0.9

0.8

0.7

0.6

amplitude-->

0.5

0.4

0.3

0.2

0.1

0 -50

-40

-30

-20

-10

0 n-->

10

20

30

40

50

MATLAB CODE FOR UNIT IMPULSE SIGNAL

clc clear all close all w=-50:1:50; x=[zeros(1,50),ones(1,1),zeros(1,50)]; figure; stem(w ,x); ylabel('amplitude-->'); xlabel('n-->'); title('UNIT IMPULSE SIGNAL');

UNIT IMPULSE SIGNAL 1

0.9

0.8

0.7

0.6

amplitude-->

0.5

0.4

0.3

0.2

0.1

0 -50

-40

-30

-20

-10

0 n-->

10

20

30

40

50

MATLAB CODE FOR UNIT RAMP SIGNAL

clc clear all close all w=-50:1:50; figure; stem(w ,w); ylabel('amplitude-->'); xlabel('n-->');
title('UNIT RAMP SIGNAL');

UNIT RAMP SIGNAL 50

40

30

20

10

amplitude-->

-10

-20

-30

-40

-50 -50

-40

-30

-20

-10

0 n-->

10

20

30

40

50

You might also like