Documente Academic
Documente Profesional
Documente Cultură
1. For the following signals, (i) determine analytically which are periodic (if periodic, give the period)
and (ii) sketch the signals. (Scale your time axis so that a sufficient amount of the signal is being
plotted.).
a) x(t) = 4 cos(5πt)
b) x(t) = 4 cos(5πt-π/4)
c) x(t) = 4u(t) + 2sin(3t)
d) x(t) = u(t) - 1/2
e) x[n] = 4 cos(πn)
f) x[n] = 4cos(πn-2)
g) x[n] = 2sin(3n)
h) x[n] = u[n]+p4[n]
2. Determine if the following signals are periodic; if periodic, give the period.
-1
x(t)
-2
-3
-4
-5
-6
-2 -1 0 1 2 3 4
Time (sec)
4. 3
2.5
1.5
x(t)
0.5
-0.5
-1
-4 -3 -2 -1 0 1 2 3 4
Time (sec)
-1
x(t
-2
)
-3
T=2 sec
-4
-5
-6
-2 -1 0 1 2 3 4
Time
offset is -2
amplitude is 8/2 = 4
frequency is 2 π / 2 = πrad / sec
shift is 0.35 sec to the left
a)
0 if t < −4
x( t ) = t + 2 if − 4 ≤ t < 3
t − 2 if
3≤ t
b) y(t) = x(t-1) where x(t) is defined in part a)
c)
0 if n<2
x[ n] = 2 n − 4 if 2≤n<4
4 − n if 4≤n
2. Write MATLAB code to plot the signals in Problem 1. Scale your time axis so that a sufficient amount
of the signal is being plotted. Use subplot to give 4 plots per page; label your plots with ’Time (sec)’ on
the x-axis for the continuous time signals and ’n’ for discrete time signals. The y-axis should be labeled
’x(t)’ or ’x[n]’; the title should be the problem number, for example ’a)’.
3. Use MATLAB to plot the following signals. Use the same instructions on plotting as given in
Problem 2.
a) x(t) = 4 cos(5πt-π/4)
b) x[n] = 4 cos(πn) (Use the command stem to plot discrete-time signals.)
c) x[n] = 2sin(3n)
d) x(t) = cos(4t) + 2sin(8t)
e) x(t) = 3cos(4t) + sin(πt)
a) b)
6 6
2.
4 4
x(t)
x(t)
2 2
0 0
-2 -2
-10 -5 0 5 10 -10 -5 0 5 10
Time (sec) Time (sec)
c) d)
2 2
0 0
x[n]
x[n]
-2 -2
-4 -4
-10 -5 0 5 10 -10 -5 0 5 10
n n
% b)
t = t+1;
subplot(222),plot(t,x)
xlabel(’Time (sec)’)
ylabel(’x(t)’)
title(’b)’)
% c)
n1 = -6:1; x1 = zeros(size(n1));
n2 = 2:3; x2 = 2*n2-4;
n3 = 4:8; x3 = 4-n3;
n = [n1 n2 n3];
x = [x1 x2 x3];
subplot(223),stem(n,x)
xlabel(’n’)
ylabel(’x[n]’)
title(’c)’)
% d)
n = n-1;
subplot(224),stem(n,x)
xlabel(’n’)
ylabel(’x[n]’)
title(’d)’),subplot(111)
3.
1 a) 1 b)
4 4
2 2
x[n]
x(t)
0 0
-2 -2
-4 -4
0 0.5 1 1.5 2 0 5 10
Time (sec) Time (sec)
1 c) 1 d)
2 4
1 2
x(t)
x(t)
0 0
-1 -2
-2 -4
0 20 40 60 -2 0 2 4 6
Time (sec) Time (sec)
1 e) 1 f)
4 6
2 4
x(t)
x(t)
0 2
-2 0
-4 -2
0 5 10 15 20 -10 -5 0 5 10
Time (sec) Time (sec)
Here is an M-file that contains the script to plot generate these plots:
% a)
% period is 2/5, so 2 sec is long enough for plot
t = 0:.4/100:2;
x = 4*cos(5*pi*t-pi/4);
subplot(2,2,1),plot(t,x)
xlabel(’Time (sec)’)
ylabel(’x(t)’)
title(’a)’)
% b)
% period is n=2, so plot for n=0 to 10
n=0:10;
x = 4*cos(pi*n);;
subplot(2,2,2),stem(n,x)
xlabel(’Time (sec)’)
ylabel(’x[n]’)
title(’ b)’)
% c)
% not periodic, try plotting for various lengths to see how it looks
n=0:60;
x = 2*sin(3*n);;
subplot(2,2,3),stem(n,x)
xlabel(’Time (sec)’)
ylabel(’x(t)’)
title(’c)’)
% d)
% period is 2pi/4, so plot for 4 cycles
T = 2*pi/4;
t = -T:T/50:3*T;
x = cos(4*t)+2*sin(8*t);
subplot(2,2,4),plot(t,x)
xlabel(’Time (sec)’)
ylabel(’x(t)’)
title(’d)’)
% e)
% not periodic, see how it looks for various lengths
t = 0:.02:20;
x = 3*cos(4*t)+sin(pi*t);
figure(2) % opens new window
subplot(2,2,1),plot(t,x)
xlabel(’Time (sec)’)
ylabel(’x(t)’)
title(’e)’)
subplot(1,1,1)
System Properties:
1. Determine if the following systems are time-invariant, linear, causal, and/or memoryless?
dy
a) + 6y( t ) = 4 x ( t )
dt
dy
b) + 4 ty( t ) = 2 x( t )
dt
c) y[ n] + 2 y[ n − 1] = x[ n + 1]
d) y(t) = sin(x(t))
dy
e) + y 2 ( t ) = x( t )
dt
f) y[ n + 1] + 4 y[ n] = 3x[ n + 1] − x[ n]
dx
g) y( t ) = + x( t )
dt
h) y[ n] = x[2 n]
i) y[ n] = nx[2 n]
dy
j) + sin( t ) y( t ) = 4 x( t )
dt
d2y dy dx
k) + 10 + 4 y( t ) = + 4 x( t )
2 dt dt
dt
2. The response of an LTI system to a step input, x(t) = u(t) is y(t) = (1-e-2t)u(t). What is the response to
an input of x(t) = 4u(t)-4u(t-1)?
dy
1. a) + 6y( t ) = 4 x ( t )
dt
This is an ordinary differential equation with constant coefficients, therefore, it is linear and time-
invariant. It contains memory and it is causal.
dy
b) + 4 ty( t ) = 2 x( t )
dt
This is an ordinary differential equation. The coefficients of 4t and 2 do not depend on y or x, so the
system is linear. However, the coefficient 4t is not constant, so it is time-varying. The system is also
causal and has memory
c)
y[ n] + 2 y[ n − 1] = x[ n + 1]
This is a difference equation with constant coefficients; therefore, it is linear and time-invariant. It is
noncausal since the output depends on future values of x. Specifically, let x[n] = u[n], then y[-1] = 1.
d) y(t) = sin(x(t))
check linearity:
y1 ( t ) = sin( x1 ( t ))
y 2 ( t ) = sin( x 2 ( t ))
Solution to an input of a 1 x1 ( t ) + a 2 x 2 ( t ) is sin(a 1x 1 ( t ) + a 2 x 2 ( t )) .
This is not equal to a1y1 ( t ) + a 2 y 2 ( t ) .
As a counter example, consider x1 ( t ) = π and x 2 ( t ) = π / 2 , a1 = a 2 = 1
the system is causal since the output does not depend on future values of time, and it is memoryless
the system is time-invariant
dy
e) + y 2 ( t ) = x( t )
dt
The coefficient of y means that this is nonlinear; however, it does not depend explicitly on t, so it is time-
invariant. It is causal and has memory.
f) y[ n + 1] + 4 y[ n] = 3x[ n + 1] − x[ n]
has memory since the output relies on values of the input at other the the current index n,
causal? Let x[n] = u[n-2], so x[1] = 0. Then y[1] = x[2] = 1, so not causal.
linear? Let y1 [n] = x1[2n] and y2 [n] = x2[2n]. The response to an input of x[n] = ax1[n]+bx2[n] is
time-invariant: Let y1[n] represent the response to an input of x[n-N], so y1[n] = x[2(n-N)]. This is also
equal to y[n-N], so the system is time-invariant.
i) y[ n] = nx[2 n]
This is similar to part h), except for the n coefficient. Similar to above, it is noncausal, has memory and is
linear. Check time-invariance:
Let y1[n] represent the response to an input of x[n-N], so y1[n] = nx[2(n-N)]. This is not
equal to y[n-N] = (n-N)x[2(n-N)], so the system is time-varying.
dy
j) + sin( t ) y( t ) = 4 x( t )
dt
This is an ordinary differential equation with coefficients sin(t) and 4. Neither depends on y or x, so it is
linear. However, the explicit dependence on t means that it is time-varying. It is causal and has memory.
d2y dy dx
k) + 10 + 4 y( t ) = + 4 x( t )
2 dt dt
dt
This is an ordinary differntial equation with constant coefficients, so it is linear and time-invariant. It is
also causal and has memory.
2. The response to 4u(t) is 4(1-e-2t)u(t). The response to 4u(t-1) is 4(1-e-2(t-1))u(t-1). So the response to
x(t) = 4u(t) - 4u(t-1) is y(t) = 4(1-e-2t)u(t) - 4(1-e-2(t-1))u(t-1).
Solving Difference Equations:
1. Solve the following difference equations using recursion first by hand (for n=0 to n=4), then using
MATLAB (for n=0 to n=30). Plot the output computed by MATLAB on a stem plot.
% b)
a=2; b=[0 2];
n = 0:30;
y0 = 0;
x0 = 0;
x = zeros(size(n));
x(1) = 1;
y=recur(a,b,n,x,x0,y0);
subplot(222),stem(n,y)
title(’1b)’)
xlabel(’n’)
ylabel(’y[n]’)
y(1:5)
% c)
a=[1.2 .32]; b = [1 -1];
y0 = [1 2];
x0 = 0;
x = ones(size(n));
y=recur(a,b,n,x,x0,y0);
subplot(223),stem(n,y)
title(’1c)’)
xlabel(’n’)
ylabel(’y[n]’)
y(1:5)
1a) 9 1b)
x 10
2 1
0.5
1
0
y[n]
y[n]
-0.5
0
-1
-1 -1.5
0 10 20 30 0 10 20 30
n n
1c)
2
1
y[n]
-1
-2
0 10 20 30
n
Differential Equations:
1. Solve the following problems for y(t). Plot your answers (either sketch them by hand or use
MATLAB) for t = 0 to t = 5 sec.
dy
a) + 2 y( t ) = 2 x( t ); x( t ) = u( t ), y(0) = −1
dt
dy
b) − 2 y( t ) = 2 x( t ); x( t ) = u( t ), y(0) = −1
dt
Continuous Time Convolution:
h( t ) = 2e −at u( t )
1 2 t
6. Compute x(t)*v(t)
Discrete-Time Convolution:
1. Find the impulse response for each of the following discrete-time systems:
c) y[n] = 0.24(x[n]+x[n-1]+x[n-2]+x[n-3])
d) x[ n] = u[ n − 1] , v[ n] = 2(0.5) n u[ n]
Complex Exponentials:
1. Simplify the following expressions. Give your answers both in polar and in rectangular form.
a) c = 3e jπ / 4 + 4e − jπ / 2
b) c = ( −1 + 2 j) 5
c) c = 2e jπ / 2 − 3e jπ / 3
2. Use phasor addition to put the following into the form of x( t ) = A cos(ωt + θ)
x(t)
2
-7 -6 -1 5 6
-4 -3 2 3 8 9 time
-2
x(t)
cos(t)
-10 10 time
a) x( t ) = 2 + 4 cos(50t + π / 2) + 12 cos(100t − π / 3)
b) x( t ) = 4 cos(2 π(1000) t ) cos(2 π750000t )
c)
2
1
1 2 4
d)
1
1 2 3
4. For the signals given in Problem 3c) and 3 d), use Matlab to plot the truncated Fourier series for N = 3,
N = 10 and N= 40. (Use subplot to save paper).
5. Find the Fourier series for the following signal. Also, sketch the approximation if a large number of
terms are kept in the series (say N=30).
x(t)
3
… 1 …
-6 -3 -2 0 3 4 6 9 t
Some of the work can be done using MATLAB:
» n=1:15;
» cn=-4*j./n/pi.*sin(pi*n/6).*sin(n*pi/2).*exp(-j*n*pi/3);
» n=-15:-1;
» c_n=-4*j./n/pi.*sin(pi*n/6).*sin(n*pi/2).*exp(-j*n*pi/3);
» cn=[c_n 0 cn];
» n=-15:15;
» subplot(221),stem(n,abs(cn))
» title('|c_n|')
» subplot(222),stem(n,angle(cn))
» title('angle(c_n) in rad')
T=6;
w0 = 2*pi/T;
t = -1.5*T:T/1000:1.5*T;
N = input(’Number of harmonics ’);
c0 = 0;
x = c0*ones(1,length(t)); % dc component
for n=1:N,
cn = -4*j/n/pi*sin(pi*n/6)*sin(n*pi/2)*exp(-j*n*pi/3);
c_n = conj(cn);
x = x + cn*exp(j*n*w0*t) + c_n*exp(-j*n*w0*t);
end
plot(t,x)
title([’ N = ’,num2str(N)])
|c n| angle(c n) in rad
0.8 4
0.6 2
0.4 0
0.2 -2
0 -4
-20 -10 0 10 20 -20 -10 0 10 20
N = 50
4
-2
-4
-10 -5 0 5 10
Some of the work can be done using MATLAB:
» n=-10:10;
» cn=cos(pi/2*n*w0)/5./(1-(n*w0).^2);
» subplot(221),stem(n,abs(cn))
» title('|c_n|')
» subplot(222),stem(n,angle(cn))
» title('angle(c_n) in rad')
will give first plots shown below. To check your answer, you can plot the truncated series and see if it
converges correctly.
T=10;
w0 = 2*pi/T;
t = -1.5:T/1000:1.5*T;
N = input(’Number of harmonics ’);
c0 = 1/5;
x = c0*ones(1,length(t)); % dc component
for n=1:N,
cn = cos(pi/2*n*w0)/5/(1-(n*w0)^2);
c_n = cn;
x = x + cn*exp(j*n*w0*t) + c_n*exp(-j*n*w0*t);
end
plot(t,x)
title([’ N = ’,num2str(N)])
|c n| angle(c n) in rad
0.2 4
0.15 3
0.1 2
0.05 1
0 0
-10 -5 0 5 10 -10 -5 0 5 10
N = 20
1
0.5
-0.5
-20 -10 0 10 20
Time (sec)
% trucated Fourier series for a staircase signal
T = 4;
w0 = 2*pi/T;
t = 0:T/1000:3*T;
N = input(’input N’)
nneg = -N:-1;
npos = 1:N;
c0 = 3/4;
cneg = 1/j/pi./nneg.*(1-.5*(-1).^nneg-.5*exp(-j*nneg*pi/2));
cpos = 1/j/pi./npos.*(1-.5*(-1).^npos-.5*exp(-j*npos*pi/2));
n = [nneg 0 npos];
c_n = [cneg c0 cpos];
x = c_n*exp(j*w0*n’*t);
x = real(x); % strips off negligible imaginary parts
plot(t,x)
xlabel(’Time (sec)’)
title([’x’,num2str(N),’(t)’])
The truncated series is plotted from top to bottom for N = 3, N = 10, and N = 40.
x 3(t)
4
-2
0 2 4 x 10(t)
6 8 10 12
4 Time (sec)
-2
0 2 4 x 40(t)
6 8 10 12
4 Time (sec)
-2
0 2 4 6 8 10 12
Time (sec)
This program uses a loop to compute the Fourier series rather than the large matrix multiplication.
One student had difficulty using the student version of Matlab with the other program (it took too
much memory). This one is less efficient because of the loop, but it uses less memory.
N=3
2
-1
-5 0 N = 10 5 10
2
-1
-5 0 N = 40 5 10
2
0
-5 0 5 10
Time (sec)
Fourier Transform
For each signal, find the Fourier transform, X(ω), and then plot |X(ω)| (note, you may
want to use MATLAB for the plot in 3.)
1. x(t)
2
0 2 t
2. x(t)
3
-4 -2 0 2 4 t
3. x(t)
8
0 4 t
4. x(t) = cos(200t)p4(t)
5. x(t)=e-3tcos(10t)u(t)
6. Find the Fourier transform of the following signals. Sketch |X(ω)| in each case.
a) x(t)
0 2 4 t
b) x(t) = 2e-2tu(t)
c) x(t)=5e-5t u(t)
d) x(t) = e-2tcos(4t)u(t)
7. Match the time responses with the corresponding frequency responses.
2 0.25
0.2
1.5
0.15
x 1(t)
|Xa|
1
0.1
0.5 0.05
0 0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -40 -30 -20 -10 0 10 20 30 40
Time (sec) Frequency (rad/sec)
2 4
1.5 3
|Xb|
x 2(t)
1 2
0.5 1
0
0 -40 -30 -20 -10 0 10 20 30 40
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Frequency (rad/sec)
Time (sec)
1 6
0.8
4
0.6
x 3(t)
|Xc|
0.4
2
0.2
0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -40 -30 -20 -10 0 10 20 30 40
Time (sec) Frequency (rad/sec)
4 4
2 3
|Xd|
x 4(t)
0 2
-2 1
0
-4 -40 -30 -20 -10 0 10 20 30 40
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Frequency (rad/sec)
Time (sec)
4 0.5
2 0.4
0.3
x5(t)
|Xe|
0
0.2
-2 0.1
-4 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -40 -30 -20 -10 0 10 20 30 40
Time (sec) Frequency (rad/sec)
8. Compute the inverse Fourier transform of the following signal.
7. Match the time responses with the corresponding frequency responses.
2 0.25
0.2
1.5
0.15
x 1(t)
|Xa|
1
0.1
0.5 0.05
0 0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -40 -30 -20 -10 0 10 20 30 40
Time (sec) Frequency (rad/sec)
2 4
1.5 3
|Xb|
x 2(t)
1 2
0.5 1
0
0 -40 -30 -20 -10 0 10 20 30 40
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Frequency (rad/sec)
Time (sec)
1 6
0.8
4
0.6
x 3(t)
|Xc|
0.4
2
0.2
0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -40 -30 -20 -10 0 10 20 30 40
Time (sec) Frequency (rad/sec)
4 4
2 3
|Xd|
x 4(t)
0 2
-2 1
-4 0
-40 -30 -20 -10 0 10 20 30 40
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Frequency (rad/sec)
Time (sec)
4 0.5
2 0.4
0.3
x5(t)
|Xe|
0
0.2
-2 0.1
-4 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -40 -30 -20 -10 0 10 20 30 40
Time (sec) Frequency (rad/sec)
Spectrum
1. Determine the fundamental frequency of the following signals, and plot their sinusoidal spectra (both magnitude and
phase) and their exponential spectra.
a) x(t) = 2+3cos(0.2t)+cos(0.25t+π/2)+4cos(0.3t-π)
b) x(t) = 1+10cos(2π(60)t+π/8) + 2cos(2π(300)t-π/4)
2. Find an expression for x(t) and plot the spectrum for each graph.
a b
8 4
6
3
4
2
2
0
x(t)
x(t)
-2 1
-4
0
-6
-8
-1
-10
-12 -2
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
Time (sec) Time (sec)
-1
-2
-0.02 -0.015 -0.01 -0.005 0 0.005 0.01 0.015 0.02
Time (sec)
4. Draw the spectrum for the following signal, and make a rough sketch of x(t).
x ( t ) = 10 cos(200πt ) cos(2000πt )
5. Time signals and their corresponding spectra are shown below. However, they are in random order. Match them up.
5 4
magnitude, a
3
x 1(t)
0
2
-5 1
0
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 -4 -3 -2 -1 0 1 2 3 4
Time (sec) frequency (Hertz)
5
5 4
magnitude, b
3
x 2(t)
0
2
-5 1
0
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 -4 -3 -2 -1 0 1 2 3 4
Time (sec) frequency (Hertz)
5
5 4
magnitude, c
3
x3(t)
0
2
-5 1
5
5
4
magnitude, d
x4(t)
0 3
2
-5
1
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 0
Time (sec) -4 -3 -2 -1 0 1 2 3 4
frequency (Hertz)
5
5
4
magnitude, e
x 5(t)
0 3
2
-5
1
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4
0
Time (sec) -4 -3 -2 -1 0 1 2 3 4
frequency (Hertz)
5. Time signals and their corresponding spectra are shown below. However, they are in random order. Match them up.
5 4
magnitude, a
3
x 1(t)
0
2
-5 1
0
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 -4 -3 -2 -1 0 1 2 3 4
Time (sec) frequency (Hertz)
5
5 4
magnitude, b
3
x 2(t)
0
2
-5 1
0
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 -4 -3 -2 -1 0 1 2 3 4
Time (sec) frequency (Hertz)
5
5 4
magnitude, c
3
x3(t)
0
2
-5 1
5
5
4
magnitude, d
x4(t)
0 3
2
-5
1
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 0
Time (sec) -4 -3 -2 -1 0 1 2 3 4
frequency (Hertz)
5
5
4
magnitude, e
x 5(t)
0 3
2
-5
1
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4
0
Time (sec) -4 -3 -2 -1 0 1 2 3 4
frequency (Hertz)
Sampling and Reconstruction:
1. Draw |Xs(ω)| for the following cases if xs(t)=x(t)p(t) with sampling period T.
n =∞
p( t ) = ∑ δ(t − nT)
n =−∞
|X(ω)|
2
-2 -1 0 1 2 ω
a) T = π/4 sec
b) T = π/2 sec
c) T = 2π/3 sec
In order to examine the effects of aliasing in the time domain, plot x(t) for each of the sampling times for
t=0 to 15 sec. In MATLAB, this is done by defining your time vector with the time increment set to the
desired sampling period. MATLAB then "reconstructs" the signal by connecting the sampled points with
straight lines (this is known as a linear interpolation). Compare your sampled/reconstructed signals with
a signal that is more accurate, one that is created by using a very small sampling period (such as T = 0.05
sec) by plotting them on the same graph.
The output y(t) of the ideal reconstruction can be found by sending the sampled signal xs(t) = x(t)p(t)
through an ideal lowpass filter:
T
-0.5ωs 0.5ωs
Let x(t) = 2 + cos(50πt) and T = 0.01 sec.
The output y(t) of the ideal reconstruction can be found by sending the sampled signal xs(t) = x(t)p(t)
through an ideal lowpass filter:
T
-0.5ωs 0.5ωs
a) Let x(t) = 1 + cos(15πt) and T = 0.1 sec. Draw |Xs(ω)| where xs(t) = x(t)p(t). Determine the
expression for y(t).
b) Let X(ω) = 1/(jω+1) and T = 1 sec. Draw |Xs(ω)| where xs(t) = x(t)p(t). Does aliasing occur? (Justify
your answer.)
DTFT and DFT:
2. Compute by hand calculations the DFT of the signals given in Problem 1 a) and b) and compare your
answers to those found in Problem 1.
3. Use MATLAB to compute the DFT of the signals in Problem 2. In order to increase your accuracy,
pad the signals with zeros (for example. if you want to plot an additional 10 points, then add 10 zeros).
For the signal in part c), compute the DFT for three cases: truncating the signal at N = 5, N = 10 and at N
= 20. In each case, compare your answers to those found in Problem 1 by plotting the magnitude of both
versus frequency.
4. Find the response of the following systems to the input below. Sketch the magnitude of each frequency
response for -π<Ω<π and determine the type of filter.
x[ n] = 2 + 2 cos( nπ / 4) + cos( n2 π / 3 + π / 2)
a) H (Ω) = e − jΩ cos(Ω / 2)
5. Find the DTFT and the DFT of x[n] = [1 -1]. Sketch X(Ω) for -π < Ω < π.
6. The DTFT for an 6 point signal, x[n], is shown below. Indicate on the plot the values of the DFT.
0.8
0.6
|X|
0.4
0.2
0
0 1 2 3 4 5 6 7
Ω
3
angle X
0
0 1 2 3 4 5 6 7
Ω
7. Use the FFT to approximate the Fourier Transform of x(t) = 4e-tu(t). Consider the following cases:
Use MATLAB to compute and plot the approximations of |X(ω)| for each of these cases (use the symbol
’o’ to denote the approximation) along with the actual |X(ω)| for comparison.
8. Consider the continuous-time signal x(t) = 2e-2tu(t). You wish to use the FFT to approximate X(ω).
a) Determine the frequency ωB such that | X(ω)|< 0.02|X(0)|. The frequency content of x(t) is negligible
above this value.
b) Determine an appropriate minimum value for the sampling period T from the information determined
in part a).
c) Using the value of T determined in part b), determine the number of points N of x(t) to be sampled so
that the resolution of the approximation from the FFT is Γ = 0.2 rad/sec.
d) Sketch | X(ω)| and your approximation of it obtained using the FFT. (You do not need to actually
compute the approximation, just estimate how it might look.)
e) Use MATLAB to compute and plot the approximation along with the actual plot of |X(ω)|.
1. a) plot
0.8
0.6
|X|
0.4
0.2
0
-4 -3 -2 -1 0 1 2 3 4
Ω
2
angle X
-2
-4
-4 -3 -2 -1 0 1 2 3 4
Ω
3. The MATLAB code used to generate the plots is given below.
%a)
x = [.25 .25 .25 .25 zeros(1,20)];
X = dft(x);
Omega = 0:pi/100:pi*2;
Xa = .5*exp(-j*3*Omega/2).*(cos(3*Omega/2)+cos(Omega/2));
N = length(x);
k = 0:N-1;
figure(1)
subplot(211),plot(Omega,abs(Xa),2*k*pi/N,abs(X),’o’)
xlabel(’\Omega’)
ylabel(’part a)’)
%b)
x = [1 -2 1 zeros(1,20)];
X = dft(x);
Xa = 2*exp(-j*Omega).*(cos(Omega)-1);
N = length(x);
k = 0:N-1;
subplot(212),plot(Omega,abs(Xa),2*k*pi/N,abs(X),’o’)
xlabel(’\Omega’)
ylabel(’part b)’)
%c)
n = 0:5;
x = 2*(.75).^n;
X = dft(x);
Xa = 2./(1-.75*exp(-j*Omega));
N = length(x);
k = 0:N-1;
figure(2)
subplot(311),plot(Omega,abs(Xa),2*k*pi/N,abs(X),’o’)
xlabel(’\Omega’)
title(’part c)’)
ylabel(’n = 0:5’)
n = 0:10;
x = 2*(.75).^n;
X = dft(x);
N = length(x);
k = 0:N-1;
subplot(312),plot(Omega,abs(Xa),2*k*pi/N,abs(X),’o’)
xlabel(’\Omega’)
ylabel(’n = 0:10’)
n = 0:15;
x = 2*(.75).^n;
X = dft(x);
N = length(x);
k = 0:N-1;
subplot(313),plot(Omega,abs(Xa),2*k*pi/N,abs(X),’o’)
xlabel(’\Omega’)
ylabel(’n = 0:15’)
The DFT (circles) and DTFT (solid line) for parts a) and b) , exact match since x[n] is finite duration.
0.8
0.6
part a)
0.4
0.2
0
0 1 2 3 4 5 6 7
Ω
3
part b)
0
0 1 2 3 4 5 6 7
Ω
The DFT (circles) and the DTFT (solid line) for part c). This is an infinite duration signal that goes to
zero. As more points are taken in the sequence (N gets bigger), the more accurate the DFT for
approximating the DTFT.
part c)
10
n = 0:5
0
0 1 2 3 4 5 6 7
10 Ω
n = 0:10
0
0 1 2 3 4 5 6 7
10 Ω
n = 0:15
0
0 1 2 3 4 5 6 7
Ω
2πk
6. The DFT is a discretized version of the DTFT at the points Ω = for k = 0,...,N-1. In this case,
N
π 2π 4 π 5π
N = 6, so the points are located at Ω = 0, , , π, ,
3 3 3 3
X3
1 o
0.8
0.6
X4
|X|
0.4
X1 X5
0.2
X0
o o X2 o o
o
0
0 1 2 3 4 5 6 7
Ω
3 o o
angle X
0o o o o
0 1 2 3 4 5 6 7
Ω
7. The plot gets more accurate as T gets smaller. The resolution gets smaller as NT gets bigger. Note
that in a signal that is not time-limited but decays, sample for long enough time so that the truncated part
of x(t) is negligible.
% actual X(w)
w = 0:.1:20;
Xa = 4./(j*w+1);
T = 1; N = 10;
t = 0:T:T*(N-1);
x = 4*exp(-t);
[Xi,wi] = contfft(x,T);
T = 1; N = 20;
t = 0:T:T*(N-1);
x = 4*exp(-t);
[Xii,wii] = contfft(x,T);
T = 0.5; N = 20;
t = 0:T:T*(N-1);
x = 4*exp(-t);
[Xiii,wiii] = contfft(x,T);
T = 0.1; N = 100;
t = 0:T:T*(N-1);
x = 4*exp(-t);
[Xiv,wiv] = contfft(x,T);
subplot(221),plot(w,abs(Xa),wi,abs(Xi),’o’)
title(’T=1,N=10’)
subplot(222),plot(w,abs(Xa),wii,abs(Xii),’o’)
title(’T=1,N=20’)
subplot(223),plot(w,abs(Xa),wiii,abs(Xiii),’o’)
title(’T=0.5,N=20’)
subplot(224),plot(w,abs(Xa),wiv,abs(Xiv),’o’)
axis([0 20 0 5])
title(’T=0.1,N=100’)
T=1,N=10 T=1,N=20
8 8
6 6
4 4
2 2
0 0
0 5 10 15 20 0 5 10 15 20
T=0.5,N=20 T=0.1,N=100
6 5
4
4
3
2
2
1
0 0
0 5 10 15 20 0 5 10 15 20
Laplace Transforms
a) x( t ) = 4 sin(100t ) u( t )
b) x( t ) = 4 sin(100t − 10) u( t − 01
.)
c) x( t ) = 2 u( t ) + δ( t − 4) − cos(5t ) u( t )
d) x( t ) = tu( t ) − 2( t − 2) u( t − 2) + ( t − 3) u( t − 3)
e) x( t ) = u( t ) − e −2 t cos(10t ) u(t)
10(s + 1)
a) X(s) =
s 2 + 4s + 3
10(s + 1)
b) X(s) =
s 2 + 4s + 8
2s + 100
c) X(s) =
(s + 1)(s + 8)(s + 10)
10(s + 1) − 2s
d) X(s) = 2 e
s + 4s + 3
20
e) X(s) = 2
s(s + 10s + 16)
10(s + 1)
f) X(s) = 2
(s + 4s + 8)s
10(s + 1)
a) X(s) =
s(s 2 + 4s + 3)
10(s + 1)
b) X(s) =
s(s 2 + 4s + 8)
10(s + 1)
c) X(s) =
s(s 2 + 2s − 3)
4. Give the general form of x(t) (do not solve for the coefficients explicitly).
2s + 100 10(s + 1)
a) X(s) = e) X(s) =
(s + 2)(s + 6)(s + 10) s(s 2 + 4s + 8)
s+1
2s + 100 f) X(s) =
b) X(s) = s(s2 + 4)(s + 8)
s(s + 1)(s + 8)(s − 4)
20(s + 1)
s − 40 g) X(s) =
c) X(s) = (s2 + 16)((s + 4) 2 + 25)(s + 1)
(s + 1)(s + 8)(s + 10)
10(s + 1)
d) X(s) =
s(s 2 + 4s + 3)
Solving Differential Equations:
1. Solve the following differential equations using the Laplace Transform method:
R1 R2 +
+
x(t) y(t)
C1 C2
- -
3. Find the transfer function of the following circuit where R1=R2=1000Ω and C=100µf.
a) + R1 +
x(t) C R2 y(t)
- -
5. Repeat Problem 4 for the system given below. In addition, compare the types of poles of this system
to those in Problem 4 and use this to explain the resulting behavior seen in the step response plots.
&&y + 8y& + 12 y = 12 x
6. Simplify the block diagram to find the transfer function
H1(s)
X(s) + Y(s)
H3(s)
+ -
+
H2(s)
H4(s)
01
. 2
Give the transfer function H(s)=Y(s)/X(s) for H1(s)=2, H2(s)=10/s, H 3 (s) = , H 4 (s) =
s + 20 s+ 4
7. Reduce the block diagram to one block.
X(s) H3(s)
Y(s)
+
+
H1(s)
- +
H4(s)
H2(s)
8. Find the transfer function of the following circuit in terms of R1, R2, C, and L. Now, suppose that
R1=R2=2000Ω, C = 100µf, L = 10mH. Determine the poles of the circuit.
R1 L
+
x(t) +
R2 C y(t)
-
-
Stability:
8s 2 + 2s − 4
e) H ( s) = 5
s + 2s4 − 2s 3 + 3s2 + 2s
10s + 2
a) H (s) =
s + 3s 2 + 4s + K
3
10
b) H (s) =
s + ( K + 2) s + 4
2
K(s − 1)
c) H (s) =
s + ( K + 2)s + 2 − K
2
System Response:
2. Given, the two step responses shown below, the first one is a first order system and the second one is a
second order system. Determine the transfer functions for both systems.
Step Response
1.5
Amplitude
0.5
0
0 2 4 6 8 10 12
Time (sec.)
Step Response
1.5
Amplitude
0.5
0
0 5 10 15 20 25 30 35 40 45
Time (sec.)
3. Plot the pole positions for each of the following systems, determine the values for ζ and ωn for the
stable second order systems with complex poles.
1
e) H (s) =
1 s + 4s + 3
2
a) H (s) =
s+ 4 1
1 f) H (s) =
b) H (s) = s 2 + 4s + 2
s + 10 1
1 g) H (s) =
c) H (s) = s 2 − 4s + 16
s− 2
1
d) H (s) =
s + 4s + 16
2
4. Give the general form of the response of the systems in Problem 3 to a step input.
5. Determine the steady-state response of the systems in Problem 3 a), d), and f) to an input of
x(t) = 2cos(4t-20o)u(t).
6. Given the following system:
10
H (s) =
s + 10s + 100
2
x(t) = cos(10t)u(t)
2.
Step Response
1.5
Amplitude
0.5
0
0 2 4 6 8 10 12
Time (sec.)
Step Response
1.5
Amplitude
0
0 5 10 15 20 25 30 35 40 45
Time (sec.)
k
First order system (top plot) has general form H (s) = . The time-constant is the time that the
s+a
response is equal to 2(1-e-1 ) = 63% of 2 = 1.26, so τ ≈ 2 sec. a=1/τ = 0.5. The steady-state value (due to
a unit step input) is H(0) = k/a = k/0.5. From the plot 2 = k/0.5 so k = 1.
1
Final answer: H (s) =
s + 0.5
k
Second order system (bottom plot) has general form H (s) = or
s + 2ζω n s + ω n 2
2
k
H (s) = where the real part of the pole is at -ζωn is the real part of the pole (it governs
(s + ζω n ) 2 + ω d 2
the envelope of decay) and ωd is the imaginary part of the pole (it governs the frequency of the
oscillations, ωd = 2π/T).
From the plot, T ≈ 12 sec, so ωd = 2π/13. The time constant of the envelope of decay is about τ ≈ 7 sec,
k
so ζωn=1/7. k is found from the steady-state value 1 = H (0) = . Solving fo k yields k ≈
(ζω n ) 2 + ω d 2
0.254.
0.254
Final answer: H (s) =
s + 0.286s + 0.254
2
Feedback Control:
1
1. Consider an open loop controller for a plant of the form: G p (s) =
s+1
R(s) Y(s)
Gc(s) Gp(s)
a) Design an open loop controller Gc(s) so that the output has a steady-state value of 10 and the time
constant is τ=0.5 sec for a reference input of r(t) = 10u(t).
b) Now suppose that the plant has changed from the nominal that you used for the design. The new plant
1
is G p (s) = . Apply the controller that you designed in part a) to the new plant. Find the steady-
s + 0.5
state value of y(t) and the time constant of the new system.
2. Consider the same plant as given in Problem 1, but this time design a feedback controller for it using a
proportional controller, Gc(s) = Kp. Let r(t) = 10u(t).
a) Select Kp to satisfy the specification that the closed loop system have a time constant at τ = 0.5 sec.
b) Find the corresponding value of ess.
c) Sketch the closed loop step response.
d) Sketch the closed loop step response if Kp = 4.
e) Verify your plots in parts c) and d) by using MATLAB to compute and plot the step responses of the
two closed loop systems (remember to enter the numerator (numcl) and denominator (dencl) of the closed
loop system into MATLAB; also use step(10*numcl,dencl) to get response to 10u(t)).
1
f) Suppose that the plant has now changed from the nominal to G p (s) = . Use MATLAB to
s + 0.5
compute and plot the step responses for the two new closed loop systems: (i) using the new plant and the
controller designed in part a); and (ii) the using the new plant and the controller given in part d).
3. Consider the plant of Problem 2 and the proportional controller of KP=4. Show how you can modify
the reference input so that the output has a steady-state value of yss(t) = 10. What is the resulting steady-
state value of y(t) when this modification is applied to the new plant in part f)?
4. Consider the same plant and feedback configuration given in Problem 2, this time use a PI controller:
1 K (s + K I / K P )
G c (s) = K P + K I = P . Let KI/KP = 1.
s s
a) Pick KP such that the closed loop time constant is τ=0.5 sec.
b) What is ess if r(t) = 10u(t)?
c) Sketch the closed loop response for y(t) if r(t) = 10u(t).
d) Verify your plot in part c) by using MATLAB to compute and plot the closed loop step response.
1
e) Redo part d), except use the modified plant G p (s) = in place of the nominal plant.
s + 0.5
5. Use the results of Problems 1-4 to compare the results of open loop control, Proportional control and
PI control in terms of accuracy, speed of response and robustness.
6. A feedback controller will be designed for a plant given below. Select a controller Gc(s) = KP so that
the closed loop system has a time constant of no more than 5 sec. and steady-state error to a unit step
input of no more than 0.05.
7. Two feedback controllers are designed for a plant given below. Let r(t) be a unit step input. Compare
the controllers in terms of speed of response, accuracy and relative stability for the closed loop system.
Be as specific as you can in your comparison.
4( s + 2 )
i) G c (s) =
s
ii) G c (s) = 2
8. Suppose a plant transfer function is given by Gp below. A proportional controller is used in a feedback
loop. Determine the range of Kp for stability. Determine the steady-state error to a unit step input if Kp =
10.
1
G p (s) =
s + 5s 2 + 6s
3
e) The plots below are the closed loop step responses for the controllers defined in a) and d) (with the
nominal plant). Top plot is for KP = 1 and the bottom plot is for KP = 4.
Step Response
6
Amplitude
0
0 0.5 1 1.5 2 2.5 3
Time (sec.)
Step Response
6
Amplitude
0
0 0.2 0.4 0.6 0.8 1 1.2
Time (sec.)
G cG p ’ KP
f) The actual closed loop system is represented by G cl ’(s) = =
1 + G cG p ’ 1 + K P + 0.5
where GP’ represents the actual plot. The closed loop step responses are shown for KP=1 (top plot) and
KP=4 (bottom plot).
Step Response
8
6
Amplitude
0
0 0.5 1 1.5 2 2.5 3 3.5 4
Time (sec.)
Step Response
10
Amplitude
0
0 0.5 1 1.5
Time (sec.)
f) The following plots show the closed loop step response for the nominal plant with the PI compensator
(top plot) and the actual plant with the PI compensator (bottom plot).
Step Response
10
Amplitude
0
0 0.5 1 1.5 2 2.5 3
Time (sec.)
Step Response
15
Amplitude
10
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
Time (sec.)
5. Comparison of closed loop results:
For nominal behavior, the open loop, the P with larger value of KP (especially with the open loop
adjustment in r(t)) and the PI all work well. All can be made faster by proper choice of the controller
parameters.
You can get a measure of robustness by noting how sensitive the controller is to the change in the plant.
For example, how close is the behavior of the closed loop system with the actual plant to that of the
closed loop system with the nominal plant. The open loop controller is very sensitive with very large
changes in τ and ess . The P controller with larger gain is less sensitive than the P with smaller gain (the
percent change in the τ and ess are lower). The PI controller is not sensitive at all with respect to steady-
state error, but is somewhat sensitive to the time constant.
Transfer Functions and System Response:
a) y[ n] + 0.5y[ n − 1] = 2 x[ n]
b) y[ n] + 2 y[ n − 1] − y[ n − 2] = 2 x[ n] − x[ n − 1] + 2 x[ n − 2]
c) y[ n] + y[ n − 2] = 2 x[ n] − x[ n − 1]
d) y[ n] = x[ n] − 2 x[ n − 1] + x[ n − 2]
2. Plot the poles and zeros of the following transfer functions. Determine the stability.
( z − 0.5) z( z − 1)
a) H ( z) = e) H ( z) =
z + 0.75 z − 0.5z − 0.5
2
z2 + 1
( z − 0.5) f) H ( z) =
b) H ( z) = z 2 − 15
. z −1
z − 0.75
( z − 0.5)( z + 0.5)
g) H ( z) =
( z − 0.5) z 2 + z + 0.74
c) H ( z) =
z+2
( z − 0.5)( z + 0.5)
z2 + 1 h) H ( z) =
d) H ( z) = z 2 + z + 4.25
z 2 − 0.25
3. Give the general form of the transient response for each of the transfer functions given in Problem 2.
4. Give the general form of the transient response for each of the transfer functions given below.
( z − 0.5)( z − 0.1)
a) H ( z) =
( z + 0.75) 2
( z − 0.5)( z + 0.5)( z + 1)
b) H ( z) =
( z 2 + z + 0.74)( z − 0.75)
( z − 0.5) 2 ( z + 0.5)( z + 1) 2
c) H ( z) =
( z 2 + z + 0.74) 2 ( z − 0.75)
5. Determine the unit step response for each of the transfer functions given in Problem 2.
6. Given the following system:
b) x[n] = 0.5nu[n]
c) x[n] = [1 4 8 2]
d) x[n] = [0 1 2 3 4]
e) x[n] = 2(0.8)nu[n]
( z − 1)( z + 0.8)
a) X( z) =
( z − 0.5)( z + 0.2)
( z + 0.8)
b) X( z) =
( z − 0.5)( z + 0.2)
z3 + z + 1
c) X( z) =
( z 2 − 0.5z + 0.25)( z − 1)
( z 2 − 1)( z + 0.8)
d) X( z) =
( z − 0.5) 2 ( z + 0.2)
3. Use the Final Value Theorem to determine the final value of x[n] for each of the signals defined in
Problem 2. Compare your answer obtained from the Final Value Theorem to the answer found by taking
lim x[ n]
n→∞
a) &y&+ 2 y& + 4 y = 2v
b) &y&− 4 y = v
c) y[n + 2] + 2 y[n + 1] + 4 y[n] = 2v[n]
+
y(t)
-
a)
− 3 − 1 1
x& = x + v
− 4 − 2 0
y=[ 4 − 1]x
b)
0 1 0
x[n + 1] = x[n] + v[n]
− 1 − 3 1
y[n] = [1 − 1]x[n] + v[n]