diff options
author | prashantsinalkar | 2017-10-10 12:38:01 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:38:01 +0530 |
commit | f35ea80659b6a49d1bb2ce1d7d002583f3f40947 (patch) | |
tree | eb72842d800ac1233e9d890e020eac5fd41b0b1b /62 | |
parent | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (diff) | |
download | Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.gz Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.bz2 Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.zip |
updated the code
Diffstat (limited to '62')
-rwxr-xr-x | 62/CH5/EX5.30/ex_5_30.sce | 94 | ||||
-rwxr-xr-x | 62/CH6/EX6.49/ex_6_49.sce | 110 | ||||
-rwxr-xr-x | 62/CH6/EX6.50/ex_6_50.sce | 8 |
3 files changed, 106 insertions, 106 deletions
diff --git a/62/CH5/EX5.30/ex_5_30.sce b/62/CH5/EX5.30/ex_5_30.sce index 681a89836..0be672bd6 100755 --- a/62/CH5/EX5.30/ex_5_30.sce +++ b/62/CH5/EX5.30/ex_5_30.sce @@ -1,47 +1,47 @@ -clear;
-clc;
-close;
-dt=.1;
-t=-10:dt:10;
-u=[zeros(1,find(t==0)) ones(1,length(t)-find(t==0))];
-a=gca();
-plot(t,u);
-poly1=a.children.children;
-poly1.thickness=3;
-poly1.foreground=2;
-xtitle('u(t)','t')
-u1=1/2;//even part
-figure
-a=gca()
-plot(t,u1);
-poly1=a.children.children;
-poly1.thickness=3;
-poly1.foreground=2;
-xtitle('even part of u(t)','t')
-h=find(t==0);
-u2=[-ones(1,h) ones(1,length(t)-h)];//odd part
-figure
-a=gca()
-plot(t,u2);
-poly1=a.children.children;
-poly1.thickness=3;
-poly1.foreground=2;
-xtitle('odd part of u(t)','t')
-//u(t)=u1(t)+u2(t)
-//.: U[w]=U1[w]+U2[w] i.e U[w]=%pi*delta(w)+1/(%i*w)
-w=-10:0.1:10;
-for i=1:length(w)
- if w(i)==0 then
- delta(i)=1;
- else
- delta(i)=0;
- end
-end
-Uw=ones(1,length(w))./(%i*w)+%pi*delta';
-figure
-a=gca()
-plot2d(w,abs(Uw));
-poly1=a.children.children;
-poly1.thickness=3;
-poly1.foreground=2;
-xtitle('U(w)','w')
\ No newline at end of file +clear; +clc; +close; +dt=.1; +t=-10:dt:10; +u=[zeros(1,find(t==0)) ones(1,length(t)-find(t==0))]; +a=gca(); +plot(t,u); +poly1=a.children.children; +poly1.thickness=3; +poly1.foreground=2; +xtitle('u(t)','t'); +u1=1/2;//even part +figure; +a=gca(); +plot(t,u1*ones(1,length(t))); +poly1=a.children.children; +poly1.thickness=3; +poly1.foreground=2; +xtitle('even part of u(t)','t'); +h=find(t==0); +u2=[-ones(1,h) ones(1,length(t)-h)];//odd part +figure; +a=gca(); +plot(t,u2); +poly1=a.children.children; +poly1.thickness=3; +poly1.foreground=2; +xtitle('odd part of u(t)','t'); +//u(t)=u1(t)+u2(t) +//.: U[w]=U1[w]+U2[w] i.e U[w]=%pi*delta(w)+1/(%i*w) +w=-10:0.1:10; +for i=1:length(w) + if w(i)==0 then + delta(i)=1; + else + delta(i)=0; + end +end +Uw=ones(1,length(w))./(%i*w)+%pi*delta'; +figure; +a=gca(); +plot2d(w,abs(Uw)); +poly1=a.children.children; +poly1.thickness=3; +poly1.foreground=2; +xtitle('U(w)','w');
\ No newline at end of file diff --git a/62/CH6/EX6.49/ex_6_49.sce b/62/CH6/EX6.49/ex_6_49.sce index b77ac4ead..0b630bc79 100755 --- a/62/CH6/EX6.49/ex_6_49.sce +++ b/62/CH6/EX6.49/ex_6_49.sce @@ -1,56 +1,56 @@ -close;
-clc;
-clear;
-n=0:10;
-N=8;
-for i=1:length(n)
- if n(i)==0 then
- delta(i)=1;
- else
- delta(i)=0;
- end
-end
-x=delta';
-subplot(2,1,1)
-plot2d3(n,x);
-a=gca();
-plot(n,x,'r.')
-poly1=a.children.children;
-poly1.thickness=3;
-poly1.foreground=2;
-xtitle('x[n]','n')
-X=dft(x,-1);
-Y=X(1:find(n==N)-1);
-subplot(2,1,2)
-plot2d3(n,[Y' 0 0 0]);
-a=gca();
-plot(n,[Y' 0 0 0],'r.')
-poly1=a.children.children;
-poly1.thickness=3;
-poly1.foreground=2;
-xtitle('X[k]','k')
-for i=1:length(n)
- if n(i)>=0 & n(i)<N then
- x(i)=1;
- else
- x(i)=0;
- end
-
-end
-figure
-subplot(2,1,1)
-plot2d3(n,x);
-plot(n,x,'r.')
-a=gca();
-poly1=a.children.children;
-poly1.thickness=3;
-poly1.foreground=2;
-xtitle('x[n]','n')
-subplot(2,1,2)
-plot2d3(n,round(dft(x,-1)));
-plot(n,round(dft(x,-1)),'r.')
-a=gca();
-poly1=a.children.children;
-poly1.thickness=3;
-poly1.foreground=2;
+close; +clc; +clear; +n=0:10; +N=8; +for i=1:length(n) + if n(i)==0 then + delta(i)=1; + else + delta(i)=0; + end +end +x=delta'; +subplot(2,1,1) +plot2d3(n,x); +a=gca(); +plot(n,x,'r.') +poly1=a.children.children; +poly1.thickness=3; +poly1.foreground=2; +xtitle('x[n]','n') +X=fft(x,-1); +Y=X(1:find(n==N)-1); +subplot(2,1,2) +plot2d3(n,[Y 0 0 0]); +a=gca(); +plot(n,[Y 0 0 0],'r.') +poly1=a.children.children; +poly1.thickness=3; +poly1.foreground=2; +xtitle('X[k]','k') +for i=1:length(n) + if n(i)>=0 & n(i)<N then + x(i)=1; + else + x(i)=0; + end + +end +figure +subplot(2,1,1) +plot2d3(n,x); +plot(n,x,'r.') +a=gca(); +poly1=a.children.children; +poly1.thickness=3; +poly1.foreground=2; +xtitle('x[n]','n') +subplot(2,1,2) +plot2d3(n,round(fft(x,-1))); +plot(n,round(fft(x,-1)),'r.') +a=gca(); +poly1=a.children.children; +poly1.thickness=3; +poly1.foreground=2; xtitle('X[k]','k')
\ No newline at end of file diff --git a/62/CH6/EX6.50/ex_6_50.sce b/62/CH6/EX6.50/ex_6_50.sce index 7234437d9..643fec265 100755 --- a/62/CH6/EX6.50/ex_6_50.sce +++ b/62/CH6/EX6.50/ex_6_50.sce @@ -36,10 +36,10 @@ poly1=a.children.children; poly1.thickness=3; poly1.foreground=2; clear y; -X=dft(x,-1); -H=dft(h,-1); +X=fft(x,-1); +H=fft(h,-1); Y=H.*X; -y=dft(Y,1); +y=fft(Y,1); subplot(4,1,4) plot2d3(n,y); xtitle('y[n]','n') @@ -50,4 +50,4 @@ a.y_location="right"; poly1=a.children.children; poly1.thickness=3; poly1.foreground=2; -plot(n,x,'r.') +plot(n,x,'r.')
\ No newline at end of file |