POTSBAND Design filter for 300-3400 telephone bandwidth [B,A]=(FS) Input: FS=sample frequency in Hz Output: B/A is a discrete time bandpass filter with a passband gain of 1 The filter meets the specifications of G.151 for any sample frequency and has a gain of -3dB at the passband edges.

0001 function [b,a]=potsband(fs) 0002 %POTSBAND Design filter for 300-3400 telephone bandwidth [B,A]=(FS) 0003 % 0004 %Input: FS=sample frequency in Hz 0005 % 0006 %Output: B/A is a discrete time bandpass filter with a passband gain of 1 0007 % 0008 %The filter meets the specifications of G.151 for any sample frequency 0009 %and has a gain of -3dB at the passband edges. 0010 0011 0012 % Copyright (C) Mike Brookes 1998 0013 % Version: $Id: potsband.m 713 2011-10-16 14:45:43Z dmb $ 0014 % 0015 % VOICEBOX is a MATLAB toolbox for speech processing. 0016 % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 0017 % 0018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0019 % This program is free software; you can redistribute it and/or modify 0020 % it under the terms of the GNU General Public License as published by 0021 % the Free Software Foundation; either version 2 of the License, or 0022 % (at your option) any later version. 0023 % 0024 % This program is distributed in the hope that it will be useful, 0025 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0026 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0027 % GNU General Public License for more details. 0028 % 0029 % You can obtain a copy of the GNU General Public License from 0030 % http://www.gnu.org/copyleft/gpl.html or by writing to 0031 % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 0032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0033 0034 szp=[0.19892796195357i; -0.48623571568937+0.86535995266875i]; 0035 szp=[[0; -0.97247143137874] szp conj(szp)]; 0036 % s-plane zeros and poles of high pass 3'rd order chebychev2 filter with -3dB at w=1 0037 zl=2./(1-szp*tan(300*pi/fs))-1; 0038 al=real(poly(zl(2,:))); 0039 bl=real(poly(zl(1,:))); 0040 sw=[1;-1;1;-1]; 0041 bl=bl*(al*sw)/(bl*sw); 0042 zh=2./(szp/tan(3400*pi/fs)-1)+1; 0043 ah=real(poly(zh(2,:))); 0044 bh=real(poly(zh(1,:))); 0045 bh=bh*sum(ah)/sum(bh); 0046 b=conv(bh,bl); 0047 a=conv(ah,al);

Generated on Wed 28-Mar-2018 15:33:24 by