diff options
author | shamikam | 2017-11-07 15:59:48 +0530 |
---|---|---|
committer | shamikam | 2017-11-07 15:59:48 +0530 |
commit | c0c0582462720ed597b00e116506570577614e89 (patch) | |
tree | 31dedd23698e5357b19c810b7d7a8464100ef44a /macros/isfir.sci | |
download | FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.gz FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.tar.bz2 FOSSEE-Signal-Processing-Toolbox-c0c0582462720ed597b00e116506570577614e89.zip |
initial commit
Diffstat (limited to 'macros/isfir.sci')
-rw-r--r-- | macros/isfir.sci | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/macros/isfir.sci b/macros/isfir.sci new file mode 100644 index 0000000..d9e4a05 --- /dev/null +++ b/macros/isfir.sci @@ -0,0 +1,57 @@ +//Author: Parthasarathi Panda +//parthasarathipanda314@gmail.com +function fir=isfir(varargin) + [nargout,nargin]=argn(); + if (nargin==2) then + a=varargin(1); + b=varargin(2); + if type(a)~=1 | type(b)~=1 then + error('check input type'); + end + v=size(a); + if length(v)>2 then + error('check input dimension'); + end + v=size(b); + if length(v)>2 then + error('check input dimension'); + end + [n,k]=size(a); + if k==1 then + a=a'; + elseif n~=1 then + error('check input dimension'); + end + [n,k]=size(b); + if k==1 then + b=b'; + k=n; + elseif n~=1 then + error('check input dimension'); + end + elseif (nargin==1) then + sos=varargin(1); + if type(sos)~=1 then + error('check input dimension'); + end + v=size(sos); + if length(v)>2 then + error('check input dimension'); + end + if v(2)~=6 then + error('no. of columns must be 6'); + end + a=1;b=1; + for i=[1:v(1)] + a=convol(a,sos(1:3)); + b=convol(b,sos(4:6)); + end + else + error('no. of inputs not matching'); + end + if length(b)==1 then + fir=1; + else + fir=0; + end +endfunction |