From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 2294/CH1/EX1.22/EX1_22.sce | 94 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 2294/CH1/EX1.22/EX1_22.sce (limited to '2294/CH1/EX1.22') diff --git a/2294/CH1/EX1.22/EX1_22.sce b/2294/CH1/EX1.22/EX1_22.sce new file mode 100755 index 000000000..977f731eb --- /dev/null +++ b/2294/CH1/EX1.22/EX1_22.sce @@ -0,0 +1,94 @@ +//Example 1.22 +//Find whether the given signal is causal or not. +clear all; +clc; +t=-10:10; +a=.5; +for i=1:length(t) + if t(i)<0 then + x1(i)=0; + else + x1(i)=exp(a.*t(i)); + end +end +causal=%t; +for i=1:length(t) + if t(i)<0 & x1(i)~=0 then + causal=%f; + end +end +disp(causal,"The statement that the system is causal is:"); +//Example 1.22 +//Find whether the given signal is causal or not. +clear all; +clc; +t=-10:10; +for i=1:length(t) + if t(i)>0 then + x2(i)=0; + else + x2(i)=exp(-2.*t(i)); + end +end +causal=%t; +for i=1:length(t) + if t(i)<0 & x2(i)~=0 then + causal=%f; + end +end +disp(causal,"The statement that the system is causal is:"); +//Example 1.22 +//Find whether the given signal is causal or not. +clear all; +clc; +t=-10:10; +c=2; +for i=1:length(t) + x3(i)=sin(c.*t(i)); + end +causal=%t; +for i=1:length(t) + if t(i)<0 & x3(i)~=0 then + causal=%f; + end +end +disp(causal,"The statement that the system is causal is:"); +//Example 1.22 +//Find whether the given signal is causal or not. +clear all; +clc; +n=-10:10; +for i=1:length(n) + if n(i)<-3 | n(i)>2 then + x1(i)=0; + else + x1(i)=1; + end + end +causal=%t; +for i=1:length(n) + if n(i)<0 & x1(i)~=0 then + causal=%f; + end +end +disp(causal,"The statement that the system is causal is:"); +//Example 1.22 +//Find whether the given signal is causal or not. +clear all; +clc; +n=-10:10; +for i=1:length(n) + if n(i)>-2 then + x2(i)=(1/2)^n(i); + else + x2(i)=0; + end + end +causal=%t; +for i=1:length(n) + if n(i)<0 & x2(i)~=0 then + causal=%f; + end +end +disp(causal,"The statement that the system is causal is:"); + -- cgit