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 /1592/CH7/EX7.23/Example_7_23.sce | |
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 '1592/CH7/EX7.23/Example_7_23.sce')
-rwxr-xr-x | 1592/CH7/EX7.23/Example_7_23.sce | 77 |
1 files changed, 41 insertions, 36 deletions
diff --git a/1592/CH7/EX7.23/Example_7_23.sce b/1592/CH7/EX7.23/Example_7_23.sce index b24378108..44dd336f5 100755 --- a/1592/CH7/EX7.23/Example_7_23.sce +++ b/1592/CH7/EX7.23/Example_7_23.sce @@ -1,36 +1,41 @@ -//Scilab Code for Example 7.23 of Signals and systems by
-//P.Ramakrishna Rao
-//Convolution of two signals
-clc;
-clear;
-clear x y n;
-for n=0:10;
- x(n+1)=(0.5)^n*u(n-2);
-end
-c = gca();
-c.y_location = "origin";
-c.x_location = "origin";
-n=0:10;
-plot2d3(n,x,-4);
-title('x(n)')
-xlabel('n')
-for n=0:10;
- y(n+1)=u(n);
-end
-figure(1);
-n=0:10;
-c = gca();
-c.y_location = "origin";
-c.x_location = "origin";
-plot2d3(n,y,-4);
-title('y(k)')
-xlabel('k')
-z=conv(x,y);
-figure(2);
-n=0:20;
-c = gca();
-c.y_location = "origin";
-c.x_location = "origin";
-plot2d3(n,z,-4);
-title('Convoluted signal z(t)')
-xlabel('t')
+//Scilab Code for Example 7.23 of Signals and systems by +//P.Ramakrishna Rao +//Convolution of two signals +clc; +clear; +function [y]=u(t) + if t>=0 + y=1 +else y=0 + end +endfunction +for n=0:10; + x(n+1)=(0.5)^n*u(n-2); +end +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +n=0:10; +plot2d3(n,x,-4); +title('x(n)') +xlabel('n') +for n=0:10; + y(n+1)=u(n); +end +figure(1); +n=0:10; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot2d3(n,y,-4); +title('y(k)') +xlabel('k') +z=conv(x,y); +figure(2); +n=0:20; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot2d3(n,z,-4); +title('Convoluted signal z(t)') +xlabel('t')
\ No newline at end of file |