Home > voicebox > frq2erb.m

frq2erb

PURPOSE ^

FRQ2ERB Convert Hertz to ERB frequency scale ERB=(FRQ)

SYNOPSIS ^

function [erb,bnd] = frq2erb(frq)

DESCRIPTION ^

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. The
   inverse function is erb2frq.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

Generated on Thu 24-Jul-2014 09:49:39 by m2html © 2003