======================STATE_VARIABLE_ANALOG======================================= Complex_Poles 1/(a*s^2 +b*s +c) = 1/(s^2 +(wo/Q)*s +wo^2) Quadratic formula a*x^2 +b*x +c = 0 roots (-b +/-sqrt(b^2-4ac))/2a 1/(a*s^2 +b*s +c) =1/(( s +alpha +jwo )*( s +alpha -jwo )) IMAGINARY ^ /|\ | X | ^ | | jw0 ______|_v_____\ REAL | / | X | <-> alpha ---------------------------------------------------------------------------- high_pass = (s^2 )/(s^2 +(wo/Q)*s +wo^2) band_pass = ( +(wo/Q)*s )/(s^2 +(wo/Q)*s +wo^2) low_pass = ( wo^2)/(s^2 +(wo/Q)*s +wo^2) all_pass = (s^2 -(wo/Q)*s +wo^2)/(s^2 +(wo/Q)*s +wo^2) band_rej = (s^2 +wo^2)/(s^2 +(wo/Q)*s +wo^2) ---------------------------------------------------------------------------- ___ _____| b2|_____________________ | |___| ___ | | ____| b1|__________ | | | |___| | | ___ .. | | . V_V U(z) ___ / _ \ y(t)| _____ | y(t) _____ y(t) / _ \ _\| k |_\/ \ \_____|_| 1/z |_|_____| 1/z |____\/ \ \___\ Y(z) /|___| /\ /_ / |_____| | |_____|| /\ /_ / / \___/ | | \___/ ^ ^ _____ | | | |___| -a2 |_________| | | |_____| _____ | |_____________| -a1 |____________| |_____| Y(z)/U(z) =K (1+ z*b1 + z*b2) /( z^2 +a2*z +a1) ---------------------------------------------------------------------------- ___ _____| b2|_____________________ | |___| ___ | | ____| b1|__________ | | | |___| | | ___ .. | | . V_V U(S) ___ / _ \ y(t)| _____ | y(t) _____ y(t) / _ \ _\| k |_\/ \ \_____|_| 1/s |_|_____| 1/s |____\/ \ \___\ Y(S) /|___| /\ /_ / |_____| | |_____|| /\ /_ / / \___/ | | \___/ ^ ^ _____ | | | |___| -a2 |_________| | | |_____| _____ | |_____________| -a1 |____________| |_____| Y(S)/U(S) =K*(1+ s*b1 + s*b2)/( s^2 +a2*s +a1) ---------------------------------------------------------------------------- ____ ___||___ ____||_____|Y(S)| | || | | || | |____| | |\ C | | |\ C | ____ Rk R | |-\ | R | |-\ | |U(S)|__/\ /\______/\ /\_|_| \___|_/\ /\_|_| \____| |____| \/ | \/ | / | \/ | / | | ____|+/ | ____|+/ | | _|_ |/ | _|_ |/ | K =Rsum/(Rsum+Rk) | /// | /// | Rsum | | | a2 =Rsum/(Rsum+Ra2) | Ra2 | | _/\ /\_|___________/\ /\_| | a1 =Rsum/(Rsum+Ra1) _|_ \/ | \/ Ra1 | /// |______________________/\ /\_____| s=1 when Xc = R \/ ---------------------------------------------------------------------------- ___ .. . U(S) ___ / _ \ y(t) _____ y(t) _____ y(t) _\| k |_\/ \ \_____| 1/s |_____| 1/s |_______\ Y(S) /|___| /\ /_ / |_____| | |_____| | / \___/ | | ^ ^ _____ | | | |___| -a2 |_______| | | |_____| _____ | |_____________| -a1 |__________| |_____| Y(S)/U(S) =K/( s^2 +a2*s +a1) ---------------------------------------------------------------------------- _|_ Z(S)= 1/s*C ___ | _ _ _ /*\/ \/ \ Z(S) =s*L ___ | () () | ___ | |__| |__| | |___| |___| ---------------------------------------------------------------------------- SciLab_Templates Cut and paste into a SciLab command window to run plots of gain_dB and Phase_deg Low_Pass_Q10 =================SciLab_Template========================= w0=2*%pi*10 // Freq = 10Hz Q=10 // Q = 10 freqmax=100 freqstep=.005 freqmin=.1 dBmax=20 dBmin=-60 Phmax=20 Phmin=-180 s=poly(0,'s') // define s as a poly symbol h=syslin('c', w0^2/(s^2+ w0*s/Q +w0^2)) // trans func'c'= cont [frq,rf]=repfreq(h,freqmin,freqmax,freqstep); // create complex frq response [db,phi]=dbphi(rf); // extact db phase vectors subplot(211) // 2X1 window first plot xgrid(); plot2d(frq,db,logflag="ln",rect=[freqmin,dBmin,freqmax,dBmax]) xtitle("Gain_vs_Freq","Freq_Hz","Gain_DB"); subplot(212) // 2X1 window second plot xgrid(); plot2d(frq,phi,logflag="ln",rect=[freqmin,Phmin,freqmax,Phmax]) xtitle("Phase_vs_Freq","Freq_Hz","Phase_deg"); High_Pass_Q10 =================SciLab_Template========================= w0=2*%pi*10 // Freq = 10Hz Q=10 // Q = 10 freqmax=100 freqstep=.005 freqmin=.1 dBmax=20 dBmin=-60 Phmax=180 Phmin=-20 s=poly(0,'s') // define s as a poly symbol h=syslin('c', s^2/(s^2+ w0*s/Q +w0^2)) // transfer funct 'c'= cont [frq,rf]=repfreq(h,freqmin,freqmax,freqstep); // create complex frq response [db,phi]=dbphi(rf); // extact db phase vectors subplot(211) // 2X1 window first plot xgrid(); plot2d(frq,db,logflag="ln",rect=[freqmin,dBmin,freqmax,dBmax]) xtitle("Gain_vs_Freq","Freq_Hz","Gain_DB"); subplot(212) // 2X1 window second plot xgrid(); plot2d(frq,phi,logflag="ln",rect=[freqmin,Phmin,freqmax,Phmax]) xtitle("Phase_vs_Freq","Freq_Hz","Phase_deg"); Band_Pass_Q10 =================SciLab_Template========================= w0=2*%pi*10 // Freq = 10Hz Q=10 // Q = 10 freqmax=100 freqstep=.005 freqmin=.1 dBmax=10 dBmin=-60 Phmax=100 Phmin=-100 s=poly(0,'s') // define s as a poly symbol h=syslin('c', (w0*s/Q)/(s^2+ w0*s/Q +w0^2)) // transfer funct 'c'= cont [frq,rf]=repfreq(h,freqmin,freqmax,freqstep); // create complex frq response [db,phi]=dbphi(rf); // extact db phase vectors subplot(211) // 2X1 window first plot xgrid(); plot2d(frq,db,logflag="ln",rect=[freqmin,dBmin,freqmax,dBmax]) xtitle("Gain_vs_Freq","Freq_Hz","Gain_DB"); subplot(212) // 2X1 window second plot xgrid(); plot2d(frq,phi,logflag="ln",rect=[freqmin,Phmin,freqmax,Phmax]) xtitle("Phase_vs_Freq","Freq_Hz","Phase_deg") Band_Reject_Q10 =================SciLab_Template========================= w0=2*%pi*10 // Freq = 10Hz Q=10 // Q = 10 freqmax=100 freqstep=.005 freqmin=.1 dBmax=10 dBmin=-60 Phmax=100 Phmin=-100 s=poly(0,'s') // define s as a poly symbol h=syslin('c', (s^2 +w0^2)/(s^2+ w0*s/Q +w0^2)) // transfer funct 'c'= cont time, [frq,rf]=repfreq(h,freqmin,freqmax,freqstep); // create complex frq response [db,phi]=dbphi(rf); // extact db phase vectors subplot(211) // 2X1 window first plot xgrid(); plot2d(frq,db,logflag="ln",rect=[freqmin,dBmin,freqmax,dBmax]) xtitle("Gain_vs_Freq","Freq_Hz","Gain_DB"); a=get("current_axes"); t=a.title; t.font_size=3; subplot(212) // 2X1 window second plot xgrid(); plot2d(frq,phi,logflag="ln",rect=[freqmin,Phmin,freqmax,Phmax]) xtitle("Phase_vs_Freq","Freq_Hz","Phase_deg") a=get("current_axes"); t=a.title; t.font_size=3; All_Pass =================SciLab_Template========================= w01=2*%pi*30 Q=.27 freqmax=10000 freqstep=.005 freqmin=.1 Phmax=20 Phmin=-180 s=poly(0,'s') // define s as a poly symbol h1=syslin('c',(s^2-s*w01/Q +w01^2)/(s^2+s*w01/Q+w01^2)) [frq1,rf1]=repfreq(h1,freqmin,freqmax,freqstep); // create complex frq response [db1,phi1]=dbphi(rf1); // extact db phase vectors xstring(0.01,1.1,["Q= .27 f1=30Hz"]) xgrid(); plot2d(frq1,phi1,logflag="ln") xtitle("Two_Pole_All_Pass_Phase_deg","Freq_Hz","Phase_deg"); a=get("current_axes"); t=a.title; t.font_size=5; t=a.x_label; t.font_size=3; t=a.y_label; t.font_size=3; Four_Pole_All_Pass =================SciLab_Template========================= w01=2*%pi*30 w02=2*%pi*3000 Q=.27 freqmax=1000000 freqstep=.005 freqmin=.1 Phmax=20 Phmin=-180 s=poly(0,'s') h1=syslin('c',(s^2-s*w01/Q +w01^2)*(s^2-s*w02/Q+w02^2)/((s^2+s*w01/Q+w01^2)*(s^2+s*w02/Q+w02^2))) [frq1,rf1]=repfreq(h1,freqmin,freqmax,freqstep); [db1,phi1]=dbphi(rf1); xstring(0.01,1.1,["Q= .27 f1=30Hz f2=3kHz"]) xgrid(); plot2d(frq1,phi1,logflag="ln") xtitle("Four_Pole_All_Pass_Phase_deg","Freq_Hz","Phase_deg"); a=get("current_axes"); t=a.title; t.font_size=5; t=a.x_label; t.font_size=3; t=a.y_label; t.font_size=3; Audio_Phase_Shifter =================SciLab_Template========================= w01=2*%pi*30 w02=2*%pi*3000 w03=2*%pi*120 w04=2*%pi*12000 Q=.27 freqmax=1000000 freqstep=.005 freqmin=.1 Phmax=20 Phmin=-180 s=poly(0,'s') h1=syslin('c',(s^2-s*w01/Q +w01^2)*(s^2-s*w02/Q+w02^2)/((s^2+s*w01/Q+w01^2)*(s^2+s*w02/Q+w02^2))) h2=syslin('c',(s^2-s*w03/Q +w03^2)*(s^2-s*w04/Q+w04^2)/((s^2+s*w03/Q+w03^2)*(s^2+s*w04/Q+w04^2))) [frq1,rf1]=repfreq(h1,freqmin,freqmax,freqstep); [db1,phi1]=dbphi(rf1); [frq2,rf2]=repfreq(h2,freqmin,freqmax,freqstep); [db2,phi2]=dbphi(rf2); xstring(0.01,1.1,["Phase_deg "]) xstring(.8,1.1,["Phase_less_90_deg "]) xgrid(); plot2d(frq1,phi1,logflag="ln") plot2d(frq2,phi2,logflag="ln") xtitle("90deg_Phase_Shifter_Phase_vs_Freq","Freq_Hz","Phase_deg"); a=get("current_axes"); t=a.title; t.font_size=5; t=a.x_label; t.font_size=3; t=a.y_label; t.font_size=3;