summaryrefslogtreecommitdiff
path: root/2294/CH3/EX3.25/EX3_25.sce
diff options
context:
space:
mode:
Diffstat (limited to '2294/CH3/EX3.25/EX3_25.sce')
-rwxr-xr-x2294/CH3/EX3.25/EX3_25.sce125
1 files changed, 125 insertions, 0 deletions
diff --git a/2294/CH3/EX3.25/EX3_25.sce b/2294/CH3/EX3.25/EX3_25.sce
new file mode 100755
index 000000000..5e1a42125
--- /dev/null
+++ b/2294/CH3/EX3.25/EX3_25.sce
@@ -0,0 +1,125 @@
+//Example 3.25<i>
+//Find whether the system is causal and stable.
+clear all;
+ clc ;
+ n = -5:5;
+ for i =1: length (n)
+ if(n(i) <=0)
+ h(i)= 2^n(i);
+ else
+ h(i)=0;
+ end
+ end
+ causal =%t;
+ for i =1: length (n)
+ if n(i) <0 & h(i) ~=0 then
+ causal =%f;
+ end
+ end
+ disp (causal,'The statement that the system is causal is:');
+ n =0:100000;
+ for i =1: length (n)
+ if(n(i) <=0)
+ h(i)= 2^n(i);
+ else
+ h(i)=0;
+ end
+ end
+ bibo =sum(h);
+ if (bibo < %inf ) then
+ disp (" system is bibo stable ");
+ else
+ disp (" systes not stable ");
+end
+//Example 3.25<ii>
+//Find whether the system is causal and stable.
+clear all;
+ clc ;
+ n = -5:5;
+ for i =1: length (n)
+ if(n(i) >=1)
+ h(i)= exp(2*n(i));
+ else
+ h(i)=0;
+ end
+ end
+ causal =%t;
+ for i =1: length (n)
+ if n(i) <0 & h(i) ~=0 then
+ causal =%f;
+ end
+ end
+ disp (causal,'The statement that the system is causal is:');
+ n =0:100000;
+ for i =1: length (n)
+ if(n(i) >=1)
+ h(i)= exp(2*n(i));
+ else
+ h(i)=0;
+ end
+ end
+ bibo =sum(h);
+ if (bibo < %inf ) then
+ disp (" system is bibo stable ");
+ else
+ disp (" system not stable ");
+ end
+//Example 3.25<iii>
+//Find whether the system is causal and stable.
+clear all;
+ clc ;
+ n = -5:5;
+ for i =1: length (n)
+ if(n(i) <=3)
+ h(i)= (5*n(i));
+ else
+ h(i)=0;
+ end
+ end
+ causal =%t;
+ for i =1: length (n)
+ if n(i) <0 & h(i) ~=0 then
+ causal =%f;
+ end
+ end
+ disp (causal,'The statement that the system is causal is:');
+ n =0:100000;
+ for i =1: length (n)
+ if(n(i) <=1)
+ h(i)= (5*n(i));
+ else
+ h(i)=0;
+ end
+ end
+ bibo =sum(h);
+ if (bibo < %inf ) then
+ disp (" system is bibo stable ");
+ else
+ disp (" system not stable ");
+ end
+//Example 3.2<iv>
+//Find whether the system is causal and stable.
+clear all;
+ clc ;
+ n = -5:5;
+ for i =1: length (n)
+ h(i)= exp(-6*abs(n(i)));
+ end
+ causal =%t;
+ for i =1: length (n)
+ if n(i) <0 & h(i) ~=0 then
+ causal =%f;
+ end
+ end
+ disp (causal,'The statement that the system is causal is:');
+ n =0:100000;
+ for i =1: length (n)
+ h(i)= exp(-6*abs(n(i)));
+ end
+ bibo =sum(h);
+ if (bibo < %inf ) then
+ disp (" system is bibo stable ");
+ else
+ disp (" system not stable ");
+ end
+