Maximum Phase System
Maximum Phase System
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
ENERGY = 13.7262
RUNNING ENERGY
GROUP DELAY