0% found this document useful (0 votes)
27 views

Maximum Phase System

This document contains MATLAB code that analyzes the frequency response of a filter with 4 poles. It calculates the impulse response, magnitude and phase response, energy, running energy, and group delay. The code generates 5 figures - the impulse response, magnitude and phase response on the same plot, running energy, and group delay.

Uploaded by

apeejay00
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Maximum Phase System

This document contains MATLAB code that analyzes the frequency response of a filter with 4 poles. It calculates the impulse response, magnitude and phase response, energy, running energy, and group delay. The code generates 5 figures - the impulse response, magnitude and phase response on the same plot, running energy, and group delay.

Uploaded by

apeejay00
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

%Maximum phase system clc clear all close all n=0:10; x=[1,zeros(1,10)]; a1=.9*exp(j*.5*pi); a2=conj(a1); a3=.9*exp(j*.

7*pi); a4=conj(a3); a1=(1/a1) a2=(1/a2); a3=(1/a3); a4=(1/a4); %Impulse Response a=[a1 a2 a3 a4]; num=poly(a); h=filter(num,1,x); stem(n,h) title('Impulse Response') xlabel('Samples') ylabel('Amplitute') %Magnitude and Phase Response w=-pi:(pi/100):pi; fr=freqz(num,1,w); mag=abs(fr); ph=angle(fr); figure; subplot(2,1,1); plot(w,mag) title('Magnitude Response') xlabel('Frequency') ylabel('Magnitude') subplot(2,1,2) plot(w,ph) title('Phase Response') xlabel('Frequency') ylabel('Phase')

%Energy E=sum(h.*h) %Running Energy sq_h=h.*h; for i=2:length(sq_h) sq_h(i)=sq_h(i)+sq_h(i-1); end; figure stem(n,sq_h) title('Running Energy') xlabel('samples') ylabel('Frequency') %Group Delay re_fr=real(fr); im_fr=imag(fr); n1=0:(length(num)-1); temp=-j*n1.*num; fr_der=freqz(temp,1,w); re_fr_der=real(fr_der); im_fr_der=imag(fr_der); gd=((re_fr_der.*im_fr)-(im_fr_der.*re_fr))./(mag.*mag); figure plot(w,gd); title('Group Delay') xlabel('Frequency') ylabel('Group Delay')

IMPULSE RESPONSE

MAGNITUDE AND PHASE RESPONSE

ENERGY = 13.7262

RUNNING ENERGY

GROUP DELAY

You might also like