diff options
Diffstat (limited to '692/CH7')
-rwxr-xr-x | 692/CH7/EX7.1/P7_1.sce | 30 | ||||
-rwxr-xr-x | 692/CH7/EX7.2/P7_2.sce | 23 | ||||
-rwxr-xr-x | 692/CH7/EX7.6/P7_6.sce | 28 |
3 files changed, 81 insertions, 0 deletions
diff --git a/692/CH7/EX7.1/P7_1.sce b/692/CH7/EX7.1/P7_1.sce new file mode 100755 index 000000000..1b08daf96 --- /dev/null +++ b/692/CH7/EX7.1/P7_1.sce @@ -0,0 +1,30 @@ +//EXAMPLE 7.1 +//PROGRAM REQUIRES MAXIMA SCILAB TOOLBOX + +clc; +clear; +syms K a z w; + +hzden = (1-a*(z^-1)); //0<|a|<1; +Hz = K/hzden; +disp('|H(e^(jw))|^2 = K^2/((1+a)^2 - 2*cos(w)') ; +// considering a>0 +disp('(at w = %pi),K^2/(1+a)^2 < |H|^2 < K^2/(1-a)^2,(at w = 0)'); +//considering a<0 +disp(' (at w = 0),K^2/(1+a)^2 < |H|^2 < K^2/(1-a)^2,(at w = %pi)'); +disp('if K = +/-(1-a), observe....'); +disp('|H(e^(jw))| <= 1 Hence a Bounded real function.'); +//w=0:%pi; +//[a,b]=freq(hznum,hzden,w); +disp(abs(Hz)) + + + + + + + + + + + diff --git a/692/CH7/EX7.2/P7_2.sce b/692/CH7/EX7.2/P7_2.sce new file mode 100755 index 000000000..b8463c98a --- /dev/null +++ b/692/CH7/EX7.2/P7_2.sce @@ -0,0 +1,23 @@ +//EXAMPLE 7.2 +//|H(e^(jw))|^2 = 4*((1.09 + 0.6*cosw)*(1.16-0.8*cosw))/((1.04-0.2*cosw)*(1.25+cosw)) +//REPLACING cosw = (z + z(^-1))/2 +clc; +clear; +z=%z; +H1=4*((1.09 + (0.3)*(z+1/z))*(1.16 - (0.4)*(z+1/z))); +H2=((1.04 - (0.2)*(z+1/z))*(1.25 + (0.5)*(z+1/z))); +H=H1/H2; +disp(H,'The transfer function is, H = ') +elts1=factors(numer(H)); +disp(elts1,'The factors of numerator are :'); +elts2=factors(denom(H)); +disp(elts2,'The factors of denominator are :'); +disp('The Four posible stable transfer function with same square magnitude function are :'); +h1=2*((1+(0.3)/z)*(1- (0.4)/z))/((1-(0.2)/z)*(1+(0.5)/z)); +disp(h1,'stable transfer function,h1 = '); +h2=2*((1+(0.3)/z)*((0.4)- (1)/z))/((1-(0.2)/z)*(1+(0.5)/z)); +disp(h2,'stable transfer function,h2s = '); +h3=2*(((0.3)+1/z)*((1)- (0.4)/z))/((1-(0.2)/z)*(1+(0.5)/z)); +disp(h3,'stable transfer function,h3 = '); +h4=2*(((0.3)+1/z)*((0.4)- (1)/z))/((1-(0.2)/z)*(1+(0.5)/z)); +disp(h4,'stable transfer function,h4 = ');
\ No newline at end of file diff --git a/692/CH7/EX7.6/P7_6.sce b/692/CH7/EX7.6/P7_6.sce new file mode 100755 index 000000000..a5187026a --- /dev/null +++ b/692/CH7/EX7.6/P7_6.sce @@ -0,0 +1,28 @@ +//EXAMPLE 7.6 +//FIR Trasnfer functions with different Phase. +clc; +clear; +z = %z; +W = 0:(1/400):1; +z = exp(%i*2*%pi*W); +for i=1:401 + H1z(i)= -1+ 2/z(i) - 3/(z(i)^2) + 6/(z(i)^3) -3/(z(i)^4) +2/(z(i)^5) -1/z(i)^(6); +end +H1z_phase = phasemag(H1z); + +clf(); +figure(0); +plot2d(W/(2*%pi),H1z_phase,1); +xtitle('phase response','W/(2*%pi)','H2z_phase in degrees'); + +for i=1:401 + H2z(i)= +1 - 2/z(i) + 3/(z(i)^2) - 6/(z(i)^3) + 3/(z(i)^4) - 2/(z(i)^5) + 1/z(i)^(6); +end +H2z_phase = phasemag(H2z); + +plot2d(W/(2*%pi),H2z_phase,2); +xtitle('phase response','W/(2*%pi)','H2z_phase in degrees'); + + + + |