Home > NoiseTools > nt_filter_comb.m

nt_filter_comb

PURPOSE ^

[B,A] = nt_filter_comb(T,sign) - simple comb filter

SYNOPSIS ^

function [B,A] = nt_filter_comb(T,sign)

DESCRIPTION ^

[B,A] = nt_filter_comb(T,sign) - simple comb filter

 T: lag in samples (can be fractionary)
 sign: sign of second pulse, +1 or -1 [default: +1]

 NoiseTools

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [B,A] = nt_filter_comb(T,sign)
0002 %[B,A] = nt_filter_comb(T,sign) - simple comb filter
0003 %
0004 % T: lag in samples (can be fractionary)
0005 % sign: sign of second pulse, +1 or -1 [default: +1]
0006 %
0007 % NoiseTools
0008 
0009 if nargin<1; error('!'); end
0010 if nargin<2||isempty(sign); sign=1; end
0011 if T==0; B=0; A=1; return; end
0012 
0013 A=1;
0014 B=zeros(ceil(T),1);
0015 B(1)=1;
0016 frac=T-floor(T);
0017 B(floor(T)+1)=(1-frac)*sign;
0018 if frac;
0019     B(floor(T)+2)=frac*sign;
0020 end

Generated on Sat 29-Apr-2023 17:15:46 by m2html © 2005