Home > voicebox > erb2frq.m

erb2frq

PURPOSE ^

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

SYNOPSIS ^

function [frq,bnd] = erb2frq(erb)

DESCRIPTION ^

ERB2FRQ  Convert ERB frequency scale to Hertz FRQ=(ERB)
    frq = erb2frq(erb) converts a vector of ERB-rate values
    to the corresponding frequencies in Hz.
   [frq,bnd] =  erb2frq(erb) also calculates the ERB bandwidths

    Note that erb values must not exceed 42.79.
    The inverse function is frq2erb.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

Generated on Wed 26-Nov-2014 16:18:22 by m2html © 2003