EE112 HW 4 (1)

.pdf

School

San Jose State University *

*We aren’t endorsed by this school

Course

112

Subject

Electrical Engineering

Date

May 8, 2024

Type

pdf

Pages

10

Uploaded by UltraBookLeopard16 on coursehero.com

Rohan Pradhan EE 112 Section 2 19 March 2024 Homework #4 1. Code: % Define the signal x3[n] n = 0 : 20 ; x3 = 7 * (heaviside(n - 1 ) - heaviside(n - 9 )); % Multiply x3[n] by 3 to get x[n] x = 3 * x3; % Plot the signal x[n] subplot( 3 , 1 , 1 ); stem(n, x); xlabel( 'n' ); ylabel( 'Amplitude' ); title( 'Signal x[n]' ); % Compute the frequency spectrum of x[n] [H, w] = freqz(x); % Plot the magnitude of the frequency spectrum subplot( 3 , 1 , 2 ); plot(w, abs (H)); xlabel( 'Frequency (radians/sample)' ); ylabel( 'Magnitude' ); title( 'Magnitude Spectrum' ); % Plot the phase of the frequency spectrum subplot( 3 , 1 , 3 ); plot(w, angle (H)); xlabel( 'Frequency (radians/sample)' ); ylabel( 'Phase (radians)' );
title( 'Phase Spectrum' ); Plots: There are phase jumps in the plot sue to the discontinuous portion of x[n] 2. a.
b. 3. a.
b. c. 4. a. % Given parameters a = 0.95 ; w_hat = - pi : 0.01 : pi ; % Calculate |V(e^(jw_hat))|^2 V_mag_squared = 1 ./ abs ( 1 - a * exp ( -1 j * w_hat)).^ 2 ; % Plotting
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help