Professional Documents
Culture Documents
Expt.No.
Date:
Aim:
To know and understand how to generate various signals and sequences in Matlab tool.
Softwares Required:
Matlab R2015a
Hardware Required:
A personnel Computer.
Procedures:
1.
2.
3.
4.
Theory:
Generation of Sequences:
The Unit Delta (Impulse) function: is often called the discrete time impulse or the unit
impulse. It is denoted by [n].
The Unit step function: The unit step, denoted by u(n), is defined by
Exercise 4:
%Generation of a sinusoidal sequence
n=0:40; %length of sequence
f=0.1; %Frequency
phase = 0;
A=1.5; %Amplitude
x=A*sin (2*pi*f*n-phase);
stem(n,x);
title ('Sinusoidal Sequence')
xlabel ('Time index n');
ylabel ('Amplitude')
axis ([0 40 -2 2]);
grid;
Exercise 5:
%Periodic waveform:
fs = 10000;
t = 0:1/fs:1.5;
x1 = sawtooth(2*pi*50*t);
x2 = square(2*pi*50*t);
subplot(211),plot(t,x1), axis([0 0.2 -1.2 1.2])
xlabel('Time (sec)');
ylabel('Amplitude');
title('Sawtooth Periodic Wave');
subplot(212)
plot(t,x2)
axis([0 0.2 -1.2 1.2]);
xlabel('Time (sec)');
ylabel('Amplitude');
title('Square Periodic Wave');
Exercise 6:
%Aperodic waveform
fs = 10000;
t = -1:1/fs:1;
x1 = tripuls(t,20e-3);
x2 = rectpuls(t,20e-3);
subplot(211)
plot(t,x1)
axis([-0.1 0.1 -0.2 1.2])
xlabel('Time (sec)');
ylabel('Amplitude');
Exponential function:
Generation of signals:
The sinusoidal Function:
Result: