0% found this document useful (0 votes)
198 views3 pages

Experiment 1: Matlab Code

The document describes an experiment to design and analyze standard test signals like unit impulse, unit step, and unit ramp signals using Scilab/Matlab code. It provides the Matlab code used to generate plots of each signal type and displays the output figures, including a unit impulse signal shown as a spike at time 5, a unit step signal that increases at time 0, and a ramp signal that increases linearly over time from 0 to 50. The conclusion states that various signals were demonstrated and how to perform them in MATLAB was learned.

Uploaded by

Siddharth Rathod
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)
198 views3 pages

Experiment 1: Matlab Code

The document describes an experiment to design and analyze standard test signals like unit impulse, unit step, and unit ramp signals using Scilab/Matlab code. It provides the Matlab code used to generate plots of each signal type and displays the output figures, including a unit impulse signal shown as a spike at time 5, a unit step signal that increases at time 0, and a ramp signal that increases linearly over time from 0 to 50. The conclusion states that various signals were demonstrated and how to perform them in MATLAB was learned.

Uploaded by

Siddharth Rathod
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
You are on page 1/ 3

Experiment 1

Aim: Design Scilab/Matlab code for standard test signals like Unit Impulse, Unit Step and Unit
Ramp Signals and analyze it.

Apparatus: Matlab

a. Unit Impulse:

Matlab Code:
>> n=-2:0.5:2;
>> x=zeros(1,9);
>> x(1,5)=1;
>> stem(n,x);
>> title('Impulse Signal');
>> ylabel('Amplitude');
>> xlabel('Time');

Output:

Figure 1: Unit Impulse Signal.


b. Unit Step Signal:
Matlab code:
t=-5:0.001:5;
>> y = heaviside(t);
>> plot(t,y);
>> title('Step Response');
>> xlabel('Time');
>> ylabel('Amplitude');

Output:

Figure 2 Unit Step Signal


c. Ramp Signal:
Matlab Code:
>>t=0:1:50;
>>for n=0:50;
x(n+1)=n;
end
>>plot(t,x);
>> title('Ramp Signal');
>> xlabel('Time');
>> ylabel('Amplitude');

Output:

Figure 3 Ramp Signal

Conclusion: We got intimated with various signals and learn how to perform them in
MATLAB.

You might also like