Dsp Tools Like Matlab and Gnu Octave

Only available on StudyMode
  • Topic: Dirac delta function, Laplace transform, Fourier transform
  • Pages : 5 (544 words )
  • Download(s) : 29
  • Published : November 30, 2008
Open Document
Text Preview
Submitted To
The Department of Electronics and
Computer Engineering

Submitted By
Dhruba Adhikari

Familiarization with Basic CT/DT functions

Objective
The basic objective of this lab was to be familiar with MATLAB, one of the most famous tools used in Signal Analysis and Processing.

Theory

Impulse Signal
The impulse function, also known as Dirac delta function or Dirac impulse, is defined by | |

Ramp and Step Signals
The step signal is zero for negative input and one for positive. Thus, it is defined by

Whereas, provided a width parameter, if a step signal is modeled than its a ramp signal characterized by following mathematical relation. Hence, a step signal is that ramp which has width parameter zero. | |

Rectangular Signal
A Rectangular signal is defined by
Exercise
1. Plot the basic signal using matlab.
a. Impulse Signal

N =15;
y =[zeros(1,(N–1)/2) 1 zeros(1,(N–1)/2)]
x =[-( N - 1 ) /2 ) : ( N – 1 ) /2 ]
stem(x,y)

Discussion:
An assumed infinity of 15 points was taken and the impulse signal of having infinite magnitude at a single time instant was generated.

b. Unit Step Signal
N=15
y=[zeros(1,(N-1)/2) 1 ones(1,(N-1)/2)]
x=[-(N-1)/2:(N-1)/2]
stem(x,y)

Discussion:
Plotted such that magnitude at the negative axis is zero and that at the positive axis is unity.

c. Ramp Signal
N=15
y=[zeros(1,(N-1)/2) ,0 , 1: (N-1)/2]
x=[-(N-1)/2:(N-1)/2]
stem(x,y)

Discussion
y=0 for x0
d. Rectangular Signal
N=15
y=[zeros(1,(N-1)/3) ones(1,N -(N-1)/3*2) zeros(1,(N-1)/3)] x=[-(N-1)/2:(N-1)/2]
stem(x,y)

2. Plot the following continuous time signals.

a. x(t)=Ceat

N= 25
C= 1
a= 1
t= [0:0.1:N]
y= C*exp(a*t)
plot(t,y)

| | | | | |

b. Plot the same signal taking 'a' as pure imaginary.

Oscillating outputs where observed when a was made imaginary. Its due to the sinosoidal component present in the relation, which can be explained clearly by writingh the Euler's relation below.

c. Plot the signal: x(t)=Cerk (Cos(w*k +θ ) + j*Sin(w*k +θ ))

r=0; N=10;
t = [-N:0.1:N];
c = 2; w = 10; theta = 5;
i = 1;
for k=-N:0.1:N
x(i) = abs(c) * exp(r * k)* (cos(w*k+theta) + j*sin(w*k+theta)); i=i+1;
end
plot(t, x);
title('C=2, w=10, Theta=5 and r=0'); xlabel('t'); ylabel('x(t)');

Oscillation

Damped Oscillation

Oscillation with rising magnitude

3. Plot the DT exponential function on: x(n)=an , a=|a|ejθ
A=1; % magnitude |a|
n = [-N:0.1:N];
theta = 5;
i = 1;
for k=-N:0.1:N
a=A*exp(j*theta);
x(i) = power(a,n(i));
i=i+1;
end
stem(n, x); title(''); xlabel('n'); ylabel('x(n)');

Hence, a Sinusoidal signal was plotted using discrete calculations.

-----------------------
both +VE
Exponentially rising

C +VE
a -VE
Exponentially decaying

C -VE
a +VE
Exponentially decaying

Both -VE
Exponentially rising

C = -1
a = -1+i

C = +1
a = -1+i
tracking img