summaryrefslogtreecommitdiff
path: root/Digital_Signal_Processing_by_S_Salivahanan/5-Linear_Time_Invariant_Systems.ipynb
blob: ba1d7112e6b762022412f171060cca33e7e72b98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{
"cells": [
 {
		   "cell_type": "markdown",
	   "metadata": {},
	   "source": [
       "# Chapter 5: Linear Time Invariant Systems"
	   ]
	},
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 5.20: System_response.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"//Example 5.20\n",
"\n",
"clc;clear;close;\n",
"z=poly(0,'z');\n",
"x=[-1 1 0 -1];n=0:length(x)-1;\n",
"X=x*(z^-n)';\n",
"H=0.2-0.5*z^-2+0.4*z^-3\n",
"Y=H*X;\n",
"l=coeff(numer(Y));\n",
"y=l(:,$:-1:1);\n",
"disp(X,'Input sequence x(n)={-1,1,0,-1} X(z)=');\n",
"disp(H,'System Transfer Function H(z)=');\n",
"disp(Y,'Z transform of output response Y(z)=');\n",
"disp(y,'Digital output sequence y=')"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 5.21: Poles_and_zeros.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"//Example 5.21\n",
"clc;clear;close;\n",
"z=poly(0,'z');\n",
"H=(1+z^-1)/(1+3/4*z^-1+1/8*z^-2);\n",
"pole=roots(numer(H));\n",
"zero=roots(denom(H));\n",
"disp(H,'System Transfer Function H(z)=');\n",
"disp(zero,'System zeros are at');\n",
"disp(pole,'System poles are at ');\n",
"plzr(H);"
   ]
   }
],
"metadata": {
		  "kernelspec": {
		   "display_name": "Scilab",
		   "language": "scilab",
		   "name": "scilab"
		  },
		  "language_info": {
		   "file_extension": ".sce",
		   "help_links": [
			{
			 "text": "MetaKernel Magics",
			 "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
			}
		   ],
		   "mimetype": "text/x-octave",
		   "name": "scilab",
		   "version": "0.7.1"
		  }
		 },
		 "nbformat": 4,
		 "nbformat_minor": 0
}