0% found this document useful (0 votes)
15 views6 pages

Matlab Code - Basic Signals

The document describes various signal types in signal processing, including unit impulse, unit ramp, unit step, and exponential signals, along with their definitions and MATLAB code examples for visualization. Each signal type is defined mathematically, and the corresponding code snippets demonstrate how to generate and plot these signals. Additionally, it mentions the ramp signal's area under the curve being unity.

Uploaded by

cactusvernal123
Copyright
© All Rights Reserved
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)
15 views6 pages

Matlab Code - Basic Signals

The document describes various signal types in signal processing, including unit impulse, unit ramp, unit step, and exponential signals, along with their definitions and MATLAB code examples for visualization. Each signal type is defined mathematically, and the corresponding code snippets demonstrate how to generate and plot these signals. Additionally, it mentions the ramp signal's area under the curve being unity.

Uploaded by

cactusvernal123
Copyright
© All Rights Reserved
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

1.

UNIT IMPULSE SIGNAL


The unit impulse function, δ(t), also known as the Dirac delta function, is defined as:

δ(t) = 0 for t≠0;

= undefined for t = 0

Code:
clc
t = -2:1:2;
y = [zeros(1,2), ones(1,1),
zeros(1,2)];
stem(t,y);
ylabel('d(n)');
xlabel('unit impulse');

Result:
2. UNIT RAMP SIGNAL
The ramp functions with unity slope i.e. having magnitude of one always, is called unit ramp function

Code:
n=input('Enter n values');
t=0:1:n-1;
stem(t,t);
ylabel('Amplitude');
xlabel('unit ramp');

Result:

3. UNIT STEP SIGNAL


The unit step function is defined as

Code:
n=input('Enter n values');
t=0:1:n-1;
y1=ones(1,n);
stem(t,y1);
ylabel('Amplitude');
xlabel('unit step');

Result:

4. EXPONENTIAL SIGNAL
Exponential signal is in the form of x(t) = eαt
Code:
clc, clear, close all;
n=input('Enter length of
exponential seq');
t=0:1:n-1;
a=input('Enter a value');
y2=exp(a*t);
stem(t,y2);
xlabel('Exponential fun');
ylabel('Amplitude');

Result:

5. RAMP SIGNAL
Ramp signal is denoted by r(t), and it is defined as r(t) = {t0t⩾0t<0
∫u(t)=∫1=t=r(t)
u(t)=dr(t)dt
Area under unit ramp is unity.

Code:

Result:

You might also like