Experiment No. 2 AIM:-Write A MATLAB Program To Generate Standard Discrete Time Signals and
Experiment No. 2 AIM:-Write A MATLAB Program To Generate Standard Discrete Time Signals and
Experiment No. 2 AIM:-Write A MATLAB Program To Generate Standard Discrete Time Signals and
AIM:- Write a MATLAB program to generate standard discrete time signals and
plot them.
4. Exponential signal.
5. Sinusoidal signal.
THEORY:-
4. Exponential signal
5. Sinusoidal signal
Its amplitude is 1 at n=0 and for all other values of n its amplitude is 0.
0 for n≠ 0;
or δ(n)={1}
A discrete time unit step signal is denoted by u (n). Its value is unity (1) for all
positive values of n. that means its value is 1 for n >= 0. While for other values of
n, its value is 0.
U(n)={ 1 for n>= 0;
0 for n<=0
X(n)= an
Here ‘a’ is some real constant. If ‘a’ is the complex number then X(n0) is written
as,
X(n)=r ejѳ
Sinusoidal waveform:-
A discrete time sinusoidal waveform is denoted by,
X(n)=Asin ωn
PROGRAM:-
x=[0 0 0 1 0 0 0 0]
n=-3:1:4
subplot(3,2,1)
stem(n,x)
xlabel('Sample')
ylabel('Amplitude')
title('Unit impulse function')
x1=[0 0 0 0 1 1 1 1]
n=-4:1:3
subplot(3,2,2)
stem(n,x1)
xlabel('Sample')
ylabel('Amplitude')
title('Unit step function')
x2=[0 0 0 0 1 2 3 4]
n=-4:1:3
subplot(3,2,3)
stem(n,x2)
xlabel('Sample')
ylabel('Amplitude')
title('Unit ramp function')
n=-10:1:10
x3=exp((-0.1+0.3j)*n)
subplot(3,2,4)
stem(n,abs(x3))
xlabel('Time')
ylabel('Voltage')
title('Exponential function')
n=0:.1:pi
x4=sin(2*pi*n)
subplot(3,2,5)
stem(n,x4)
xlabel('Time')
ylabel('Voltage')
title('Sinusoidal function')
n=0:.1:pi
x5=cos(2*pi*n)
subplot(3,2,6)
stem(n,x5)
xlabel('Time')
ylabel('Voltage')
title('Cosine function')
OUTPUT:-
RESULT: -