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/trial_iirlp2mb.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/trial_iirlp2mb.sci')
-rw-r--r-- | macros/trial_iirlp2mb.sci | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/macros/trial_iirlp2mb.sci b/macros/trial_iirlp2mb.sci new file mode 100644 index 0000000..9419184 --- /dev/null +++ b/macros/trial_iirlp2mb.sci @@ -0,0 +1,44 @@ +function [Num,Den,AllpassNum,AllpassDen] = iirlp2mb(varargin) +B = varargin(1) +A = varargin(2) +Wo = varargin(3) +Wt = varargin(4) +rhs = argn(2) +lhs = argn(1) +if(rhs < 4 | rhs > 5) +error("Wrong number of input arguments.") +end +if(rhs == 5) +Pass = varargin(5); + if(Pass == 'pass') + pass_stop = -1 + elseif(Pass == 'stop') + pass_stop = 1 + else + error("Pass must be pass or stop.") + end +else +pass_stop = -1 +end +if(Wo <= 0) +error("Wo is <= 0.") +end +if(Wo >= 1) +error("Wo is >= 1."); +end +oWt = 0; +for i = 1 : length(Wt) + if(Wt(i) <= 0) + error("Wt is <= 0."); + end + if(Wt(i) >= 1) + error("Wt is >= 1."); + end + if(Wt(i) <= oWt) + error("Wt not monotonically increasing."); + else + oWt = Wt(i); + end +end +endfunction + |