


FRQ2ERB Convert Hertz to ERB frequency scale ERB=(FRQ)
erb = frq2erb(frq) converts a vector of frequencies (in Hz)
to the corresponding values on the ERB-rate scale on which
the human ear has roughly constant resolution as judged by
psychophysical measurements of the cochlear filters.

0001 function [erb,bnd] = frq2erb(frq) 0002 %FRQ2ERB Convert Hertz to ERB frequency scale ERB=(FRQ) 0003 % erb = frq2erb(frq) converts a vector of frequencies (in Hz) 0004 % to the corresponding values on the ERB-rate scale on which 0005 % the human ear has roughly constant resolution as judged by 0006 % psychophysical measurements of the cochlear filters. 0007 0008 % We have df/de = 6.23*f^2 + 93.39*f + 28.52 0009 % where the above expression gives the Equivalent Rectangular 0010 % Bandwidth (ERB)in Hz of a human auditory filter with a centre 0011 % frequency of f kHz. 0012 % 0013 % By integrating the reciprocal of the above expression, we 0014 % get: 0015 % e = a ln((f/p-1)/(f/q-1)) 0016 % 0017 % where p and q are the roots of the equation: -0.312 and -14.7 0018 % and a = 1000/(6.23*(p-q)) = 11.17268 0019 % 0020 % We actually implement e as 0021 % 0022 % e = a ln (1 + b*f/(f+c)) 0023 % 0024 % where b = q/p - 1 = 46.06538 0025 % c = -1000q = 14678.49 0026 % and f is in Hz 0027 % 0028 % References: 0029 % 0030 % [1] B.C.J.Moore & B.R.Glasberg "Suggested formula for 0031 % calculating auditory-filter bandwidth and excitation 0032 % patterns", J Acoust Soc America V74, pp 750-753, 1983 0033 % 0034 % [2] O. Ghitza, "Auditory Models & Human Performance in Tasks 0035 % related to Speech Coding & Speech Recognition", 0036 % IEEE Trans on Speech & Audio Processing, Vol 2, 0037 % pp 115-132, Jan 1994 0038 % 0039 0040 0041 0042 % Copyright (C) Mike Brookes 1998 0043 % Version: $Id: frq2erb.m 713 2011-10-16 14:45:43Z dmb $ 0044 % 0045 % VOICEBOX is a MATLAB toolbox for speech processing. 0046 % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 0047 % 0048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0049 % This program is free software; you can redistribute it and/or modify 0050 % it under the terms of the GNU General Public License as published by 0051 % the Free Software Foundation; either version 2 of the License, or 0052 % (at your option) any later version. 0053 % 0054 % This program is distributed in the hope that it will be useful, 0055 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0056 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0057 % GNU General Public License for more details. 0058 % 0059 % You can obtain a copy of the GNU General Public License from 0060 % http://www.gnu.org/copyleft/gpl.html or by writing to 0061 % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 0062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0063 g=abs(frq); 0064 erb=11.17268*sign(frq).*log(1+46.06538*g./(g+14678.49)); 0065 bnd=6.23e-6*g.^2 + 93.39e-3*g + 28.52; 0066 if ~nargout 0067 plot(frq,erb,'-x'); 0068 xlabel(['Frequency (' xticksi 'Hz)']); 0069 ylabel(['Frequency (' yticksi 'Erb-rate)']); 0070 end