diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /135/CH10/EX10.1/EX1.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '135/CH10/EX10.1/EX1.sce')
-rwxr-xr-x | 135/CH10/EX10.1/EX1.sce | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/135/CH10/EX10.1/EX1.sce b/135/CH10/EX10.1/EX1.sce new file mode 100755 index 000000000..8c59bb156 --- /dev/null +++ b/135/CH10/EX10.1/EX1.sce @@ -0,0 +1,43 @@ +// Example 10.1: Asymptotic magnitude and phase response curves
+clc, clear
+w=[0:70];
+// Asymptotic magnitude response curve
+for i=1:length(w)
+ a(i)=32;
+ if w(i)<10 then
+ b(i)=0;
+ c(i)=0;
+ elseif w(i)<50
+ b(i)=14*(w(i)-10)/40;
+ c(i)=0;
+ else
+ b(i)=20*log10(w(i)/10);
+ c(i)=-20*log10(w(i)/50);
+ end
+end
+A=a+b+c;
+plot2d(w,A,rect=[0,0,70,50]);
+xtitle("Asymptotic magnitude response curve","ω(rad/sec)","20 log |A(jω)| in dB");
+// Asymptotic phase response curve
+scf(1);
+w=[1:600];
+for i=1:length(w)
+ if w(i)<1 then
+ theta1(i)=0;
+ elseif w(i)<5
+ theta1(i)=31.45*(w(i)-1)/4;
+ theta2(i)=0;
+ elseif w(i)<100
+ theta1(i)=45*log10(w(i)/10);
+ theta2(i)=-45*log10(w(i)/50);
+ elseif w(i)<500
+ theta1(i)=90;
+ theta2(i)=-58.55-31.45*(w(i)-100)/400;
+ else
+ theta1(i)=90;
+ theta2(i)=-90;
+ end
+end
+theta=theta1+theta2;
+plot(w,theta);
+xtitle("Asymptotic phase curve response","ω(rad/sec)","θ(ω)")
\ No newline at end of file |