EE 450 Project 2

.pdf

School

Grossmont College *

*We aren’t endorsed by this school

Course

450

Subject

Electrical Engineering

Date

May 25, 2024

Type

pdf

Pages

10

Uploaded by queenhabibi715

EE-450 Project #2 Frequency-Domain Analysis of Discrete-Time Systems 1. Use MATLAB to find the DTFT of and plot its magnitude and phase for . You need to use “ freqz ” function in MATLAB (do not forget to use “ unwrap function!) 2. Find the impulse response of the following system and plot its frequency response (both magnitude and phase). . 3. Find the output of the system to given in part 1 using two different methods: a. Find it directly using “ filter ” function (initial conditions are zero). b. Find it by using the frequency response method (DFTF and IDTFT). You can use invfreqz ” to find the inverse DTFT. 4. Plot the outputs obtained from both methods and the error between them all in one window. What does the error signal show? x [ n ] = (0.5) n u [ n ] p w £ £ 0 ] 2 [ ] 1 [ 2 ] [ ] 3 [ 01 . 0 ] 2 [ 03 . 0 ] 1 [ 6 . 0 ] [ - - - + = - - - + - + n x n x n x n y n y n y n y ] [ n x Name: Wael Alkinan RedID: 824130548
EE-450 Project #2 Frequency-Domain Analysis of Discrete-Time Systems (1). Use MATLAB to find the DTFT of and plot its magnitude and phase for . You need to use “freqz” function in MATLAB (do not forget to use “unwrap” function!) % Define the signal x[n] n = 0:50; % Define the range of n x = (0.5).^n .* heaviside(n); % Compute the signal values % Compute the DTFT of x[n] w = linspace(0, pi, 1000); % Define the range of w X = freqz(x, 1, w); % Compute the DTFT magX = abs(X); % Compute the magnitude of the DTFT phaseX = unwrap(angle(X)); % Compute the phase of the DTFT % The signal x[n] has no denominator coefficients, we can set them to 1. figure(1) % Plot the magnitude and phase of the DTFT subplot(2,1,1); plot(w, magX); xlabel( 'Frequency (rad/sample)' ); ylabel( 'Magnitude' ); title( 'Magnitude of DTFT of x[n]' ); grid minor subplot(2,1,2); plot(w, phaseX); xlabel( 'Frequency (rad/sample)' ); ylabel( 'Phase (rad)' ); title( 'Phase of DTFT of x[n]' ); grid minor 1
(2). Find the impulse response of the following system and plot its frequency response (both magnitude and phase). To find the impulse response of the system, we can set the input x[n] to be the impulse function, which is 1 for n = 0 and 0 otherwise. Then the output of the system will be the impulse response h[n]. When the difference equation becomes: 2
To solve for h[n], we can use the z-transform. Taking the z-transform of both sides of the equation yields: Solving for H(z), we get: To find h[n], we can use the inverse z-transform. We can use partial fraction decomposition to express H(z) in terms of simpler fractions, and then look up the corresponding inverse z-transforms in a table. The partial fraction decomposition is: Taking Inverse Z-transform and using table, we have: To plot the frequency response of the system, we can take the Fourier transform of the impulse response. The magnitude and phase of the frequency response can be computed using the abs and angle functions in MATLAB, respectively. Here's the MATLAB code to compute and plot the frequency response: 3
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