summaryrefslogtreecommitdiff
path: root/52/CH2/EX2.58/Example2_58.sce
diff options
context:
space:
mode:
Diffstat (limited to '52/CH2/EX2.58/Example2_58.sce')
-rwxr-xr-x52/CH2/EX2.58/Example2_58.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/52/CH2/EX2.58/Example2_58.sce b/52/CH2/EX2.58/Example2_58.sce
new file mode 100755
index 000000000..741170cc8
--- /dev/null
+++ b/52/CH2/EX2.58/Example2_58.sce
@@ -0,0 +1,27 @@
+//Example 2.58
+//To plot the responce of the system analyically and using scilab
+clear;
+clc ;
+close ;
+n=0:1:20;
+x=[1 zeros(1,20)];
+b=[1 -0.5];
+a=[1 -1 3/16];
+yanaly=0.5*(0.75).^n+0.5*(0.25).^n;//Analytical Solution
+ymat=filter(b,a,x);
+subplot(3,1,1);
+plot2d3(n,x);
+xlabel('n');
+ylabel('x(n)');
+title('INPUT SEQUENCE (IMPULSE FUNCTION)');
+subplot(3,1,2);
+plot2d3(n,yanaly);
+xlabel('n');
+ylabel('y(n)');
+title('OUTPUT SEQUENCE yanaly');
+subplot(3,1,3);
+plot2d3(n,ymat);
+xlabel('n');
+ylabel('y(n)');
+title('OUTPUT SEQUENCE ymat');
+//As the Analtical Plot matches the Scilab Plot hence it is the Responce of the system \ No newline at end of file