diff options
Diffstat (limited to 'macros/isstable.sci')
-rw-r--r-- | macros/isstable.sci | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/macros/isstable.sci b/macros/isstable.sci index db7d5b5..16cf5a2 100644 --- a/macros/isstable.sci +++ b/macros/isstable.sci @@ -1,26 +1,35 @@ -//isstable True for stable filter -// FLAG = ISSTABLE(B,A) returns a logical output, FLAG, equal to TRUE if -// the filter specified by numerator coefficients B, and denominator -// coefficients A, is stable. Input vectors B, and A define a filter with -// transfer function: -// -// jw -jw -jmw -// jw B(e) b(1) + b(2)e + .... + b(m+1)e -// H(e) = ---- = ------------------------------------ -// jw -jw -jnw -// A(e) a(1) + a(2)e + .... + a(n+1)e -// -// FLAG = ISSTABLE(SOS) returns TRUE if the filter specified using the -// second order sections matrix, SOS, is stable. SOS is a Kx6 matrix, -// where the number of sections, K, must be greater than or equal to 2. -// Each row of SOS corresponds to the coefficients of a second order -// filter. From the transfer function displayed above, the ith row of the -// SOS matrix corresponds to [bi(1) bi(2) bi(3) ai(1) ai(2) ai(3)]. +//Checks for stability of Discrete time System function + +//Description : A Discrete time system is stable if all poles of system function are inside unit circle + // Calling Syntax // flag=isstable(b,a); // flag=isstable(sos); -//Author: Parthasarathi Panda -//parthasarathipanda314@gmail.com + +//It takes input b and a which are array vector of numerator and denumerator coefficients respectively also it takes second order section (sos) system function input.SOS is a Kx6 matrix,where the number of sections, K, must be greater than or equal to 2.Each row of SOS corresponds to the coefficients of a second order filter +//It returns a logical flag = 1(true) if given system is stable and 0(false) otherwise + +// Eample : 1 +// flag = isstable([1 2],[1 -0.7 0.1]) + +// Output: +// flag = +// +// 1. + +// Conclusion : as flag output is 1 system is stable + +// Example : 2 +// flag = isstable([1 2 0],[1 5 6]) + +//Output : +//unstable system +// flag = +// +// 0. + +// Conclusion : this system is unstable as flag output is 0 + function isstab=isstable(varargin) [nargout,nargin]=argn(); if (nargin==2) then//(a,b) is the input @@ -59,7 +68,7 @@ elseif (nargin==1) then//sos form is given as input if type(sos)~=1 then error('check input type'); end - + if length(v)>2 then error('check input dimension'); end |