Академический Документы
Профессиональный Документы
Культура Документы
OBJECTIVE:
RESOURCE REQUIRED:
THEORY:
A continuous -time signal x(t) is a continuous function of an independent variable t, that is time.
A discrete-time signal y(n) is a function of an independent variable n, that is an integer.
a. x(t) = δ(t + 2)
Source Code:
t=-10:0.01:10
for i=1:length(t)
if(t(i)==-2)
d(i)=1
else
d(i)=0
end
end
plot(t,d)
Output:
b. x(t) = δ(t + 2) - δ(t -2)
Source Code:
dt=0.01
t=-10:dt:10
x=1.*(t==-2) + 0.*(t~=0) + (-1).*(t==2)
plot(t,x)
Output:
c. x(t) = t u(t)
Source Code:
dt=0.1
t=-10:dt:10
if(t<0)
u=0
else
u=1
end
x=t*u
plot(t,x)
Output:
d. x (t) = u (t) – u(t - 5)
Source Code:
dt=0.01
t=-10:dt:10
y=1.*(t>=0) + 0.*(t<0)
x=0.*(t<5) + 1.*(t>=5)
plot(t,y-x)
Output:
e. x (t) = r (t +1) – r (t) + r (t - 2)
Source Code:
dt=0.01
t=-10:dt:10
y1=(t+1).*(t>=-1) + 0.*(t<-1)
y2=t.*(t>=0) + 0.*(t<0)
y3=(t-2).*(t>=2) + 0.*(t<2)
y=y1-y2+y3
plot(t,y)
Output:
f. x (t) = exp(-t) sin(2πt) + exp(-t/2) cos(5 πt)
Source Code:
dt=0.01
t=-10:dt:10
y1=exp(-t).* sin(2*pi*t)
y2=exp(-t/2).* cos(5*pi*t)
y=y1+y2
plot(t,y)
Output:
For DT signals, n = -5 to 5 samples
g. x[n] = r[-n]
Source Code:
dn=1
n=-5:dn:5
x=(-n) .* (n<=0)
stem(n,x)
Output:
h. x[n] = exp(n-1)
Source Code:
dn=1
n=-5:dn:5
x=exp(n-1)
stem(n,x)
Output:
i. x [n] = [n - 1] δ[n - 2]
Source Code:
dn=1
n=-5:dn:5
x1=1.*(n==2) + 0.*(n~=2)
x2=(n-1).*x1
stem(n,x2)
Output:
Output:
k. x [n] = r [n + 2] – r [n - 2]
Source Code:
dn=1
n=-5:dn:5
x1=(n+2).*(n>=-2) + 0.*(n<-2)
x2=(n-2).*(n>=2) + 0.*(n<2)
x3=x1-x2
stem(n,x3)
Output:
a=3
dn=1
n=-5:dn:5
x=(a.^n) .* (cos(2*pi*n))
stem(n,x)
Output:
Output:
LEARNING OUTCOME: We studied and plotted different kind of continuous time signals and
discrete time signals using matlab.