Assignment Solutions Complex Sinusoids ECE 223 Signals and Systems II Version. Spring 26. Eigenfunctions of LTI systems. Which of the following signals are eigenfunctions of LTI systems? a. x[n] =cos( 2π n) No. 5 b. x[n] =5Yes. c. x(t) =e.3t cos(2πn) No. d. x(t) =e.3t Yes. e. x(t) =e.3t u(t) No. f. x(t) =e j.3t Yes. g. x[n] =e.3n u[n] No. h. x[n] =( ) n Yes. i. x(t) = sin(.3t) No. 2. Periodic Signals. Which of the following signals are periodic? For each of the periodic signals, solve for the fundamental period. a. x[n] =cos( 2π n) Yes, N =5. 5 b. x[n] =cos(π 8 n) Yes, N =3. 3 c. x[n] =cos(π 2 n) Yes, N =32. 64 d. x(t) =e.3t cos(2πt) No. e. x(t) =e.3t No. f. x(t) =e.3t u(t) No. g. x(t) = cos(.3t)u(t) No.
h. x(t) =e j.3t Yes, T = 2π..3 i. x[n] =e.3n u[n] No. j. x[n] =e j.3n u[n] No. k. x[n] =e j.3n No. l. x[n] =e j.3πn Yes, N = 2. m. x(t) = sin(.3t) Yes, T = 2π..3 n. x[n] =cos(.3n) No. 3. Complex Sinusoids. Use Euler s identity to express each of the following signals as a sum of complex sinusoids. a. x[n] =3+2cos(.πn)+4sin(.2πn) x[n] =3+e j.πn +e j.πn 2je j.2πn +2je j.2πn. b. x(t) = 3 + 2 cos(53t) + 4 cos(7t) x(t) =3+e j53t +e j53t +2e j7t +2e j7t. 4. LTI System Processing with Complex Sinusoids. Suppose the impulse response of a system is given by h(t) =e.3t u(t). a. What is the transfer function H(s) of this system? H(s) = s +.3 b. Plot the magnitude and phase response (Bode plot) of this system with MATLAB. Magnitude (db) 3 2 Phase (degrees) 2 4 6 8 3 2 Frequency (rad/sec) 2
c. What steady-state output of this system when the input signal x(t) =e j2πt is applied? y(t) =e j2πt H(s) s=j2π =.53e j(2πt.58) d. What is the fundamental period of the input signal? T =ms. e. Plot the real and imaginary parts of the output signal with MATLAB..5 Real (unitless).5.2.4.6.8. Imaginary (unitless).5.5.2.4.6.8. Time (s) f. What is the steady-state output of this system when the input signal x(t) =3+2cos(53t) + 4 cos(7t) is applied? y(t) = 3H() + 2 H(j53) cos (53t + H(j53)) + 4 H(j7) cos (7t + H(j7)) =3+.38 cos (53t.552) +.37 cos (7t.56) g. Plot the output signal with MATLAB. 3
Input 8 6 4 2..2.3.4.5 3.5 Output 3 2.95..2.3.4.5 Time (s) h. Is the output signal a scaled version of the input signal, y(t) =αx(t)? Why or why not? No, because the input signal is not an eigenfunction (complex exponential or sinusoid). function [] = LTISystems() sys = tf(,[.3]); % Create a MATLAB representation of the system % Bode Plot omega = logspace(log(.3)-2,log(.3)+2); [magnitude,phase,omega] = bode(sys,omega); magnitude = squeeze(magnitude); phase = squeeze(phase); FigureSet(,5); subplot(2,,); h = loglog(omega,magnitude, r ); set(h, LineWidth,.5); xlim([ omega(end)]); ylim([.5*min(magnitude) 2*max(magnitude)]); ylabel( Magnitude (db) ); subplot(2,,2); h = semilogx(omega,phase, r ); set(h, LineWidth,.5); xlim([ omega(end)]); ylim([min(phase)- max(phase)+]); ylabel( Phase (degrees) ); xlabel( Frequency (rad/sec) ); AxisSet; print( LtiSystems-BodePlot, -depsc ); % Response to a Complex Sinusoid t = :.:.; omega = 2*pi; 4
x = exp(j*omega*t); H = /(+.3*j*omega); y = H*x; fprintf( Frequency:%5.3f rad/s Magnitude:%5.3f Angle:%5.3f\n,omega,abs(H),angle(H)); FigureSet(,5); subplot(2,,); h = plot(t,real(y)); set(h, LineWidth,.); xlim([t() t(end)]); ylim([min(real(y)) max(real(y))]); ylabel( Real (unitless) ); subplot(2,,2); h = plot(t,imag(y)); set(h, LineWidth,.); xlim([t() t(end)]); ylim([min(imag(y)) max(imag(y))]); ylabel( Imaginary (unitless) ); xlabel( Time (s) ); AxisSet; print( LtiSystems-ComplexSinusoidResponse, -depsc ); % Response to a Linear Combination of Real Sinusoids t = linspace(,5*2*pi/53,) ; % Include 5 periods of the lowest non-zero frequency omega = [ 53 7]; % Vector of frequencies amplitude = [3 2 4]; % Vector of amplitudes H =./(+j*omega); x = zeros(length(t),); y = zeros(length(t),); for c=:length(omega) HMagnitude = abs(h(c)); HPhase = angle(h(c)); x = x + amplitude(c) *cos(omega(c)*t ); y = y + amplitude(c)*hmagnitude*cos(omega(c)*t+hphase); fprintf( Output Frequency:%5.3f Amplitude:%5.3f Phase:%5.3f\n,omega(c),amplitude(c)*HMagnitude,HPhase); end FigureSet(,5); subplot(2,,); h = plot(t,x, b ); set(h, LineWidth,.); xlim([t() t(end)]); ylim([min(x) max(x)]); ylabel( Input ); subplot(2,,2); h = plot(t,y, b ); set(h, LineWidth,.); xlim([t() t(end)]); ylim([min(y) max(y)]); ylabel( Output ); xlabel( Time (s) ); AxisSet; print( LtiSystems-SinusoidsResponse, -depsc ); 5. Discrete-Time Harmonics. a. Plot the real and imaginary parts of e jk 2π 7 n for k =,,...,4. 5
Re. Im. 5 5 5 5 Re. Im. 5 5 5 5 Re. 2 Im. 2 5 5 5 5 Re. 3 Im. 3 5 5 5 5 Re. 4 Im. 4 5 5 5 5 Re. 5 Im. 5 5 5 5 5 Re. 6 Im. 6 5 5 5 5 Re. 7 Im. 7 5 5 5 5 Re. 8 Im. 8 5 5 5 5 Re. 9 Im. 9 5 5 5 5 Re. 5 5 Im. 5 5 Re. 5 5 Im. 5 5 Re. 2 5 5 Im. 2 5 5 Re. 3 5 5 Im. 3 5 5 Re. 4 5 5 Im. 4 5 5 b. Which harmonics are the same? k = {, 7, 4}, {, 8}, {2, 9}, {3, }, {4, }, {5, 2}, {6, 3} c. Repeat for e jk 2π 7 t for k =,,...,4 6
Re. Im. 5 5 5 5 Re. Im. 5 5 5 5 Re. 2 Im. 2 5 5 5 5 Re. 3 Im. 3 5 5 5 5 Re. 4 Im. 4 5 5 5 5 Re. 5 Im. 5 5 5 5 5 Re. 6 Im. 6 5 5 5 5 Re. 7 Im. 7 5 5 5 5 Re. 8 Im. 8 5 5 5 5 Re. 9 Im. 9 5 5 5 5 Re. 5 5 Im. 5 5 Re. 5 5 Im. 5 5 Re. 2 5 5 Im. 2 5 5 Re. 3 5 5 Im. 3 5 5 Re. 4 5 5 Im. 4 5 5 d. Which harmonics are the same? None. Continuous-time complex sinusoidal harmonics are all distinct from one another. function [] = ComplexSinusoidHarmonics N = 7; % Fundamental period 7
K = 4; % Highest harmonic n = -2*N:2*N; FigureSet(,7,9); for c=:k x = exp(j*c*2*pi/n*n); hold on; subplot(k+,2,2*c+); h = stem(n,real(x)); set(h, Marker,. ); xlim([n()-.5 n(end)+.5]); ylim([-.5.5]); ylabel(sprintf( Re. %d,c)); subplot(k+,2,2*c+2); h = stem(n,imag(x)); set(h, Marker,. ); xlim([n()-.5 n(end)+.5]); ylim([-.5.5]); ylabel(sprintf( Im. %d,c)); end hold off; AxisSet(6); print( ComplexSinusoidHarmonics-DiscreteTime, -depsc ); t = linspace(-2*n,2*n,); FigureSet(2,7,9); for c=:k x = exp(j*c*2*pi/n*t); hold on; subplot(k+,2,2*c+); plot(t,real(x)); xlim([t() t(end)]); ylim([-.5.5]); ylabel(sprintf( Re. %d,c)); subplot(k+,2,2*c+2); plot(t,imag(x)); xlim([t() t(end)]); ylim([-.5.5]); ylabel(sprintf( Im. %d,c)); end hold off; AxisSet(6); print( ComplexSinusoidHarmonics-ContinuousTime, -depsc ); 8