Home > ACA-Code > ToolMel2Freq.m

ToolMel2Freq

PURPOSE ^

converts frequency to mel

SYNOPSIS ^

function [fInHz] = ToolMel2Freq(fMel, cModel)

DESCRIPTION ^

converts frequency to mel
>
> @param fMel: frequency
> @param cModel: 'Fant','Shaughnessy', or 'Umesh'
>
> @retval Hertz value
 ======================================================================

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 %converts frequency to mel
0002 %>
0003 %> @param fMel: frequency
0004 %> @param cModel: 'Fant','Shaughnessy', or 'Umesh'
0005 %>
0006 %> @retval Hertz value
0007 % ======================================================================
0008 function [fInHz] = ToolMel2Freq(fMel, cModel)
0009 
0010     if (nargin < 2)
0011         cModel  = 'Fant';
0012     end
0013 
0014     % set function handle
0015     hPitchFunc  = str2func (['aca' cModel '_I']);
0016     
0017     fInHz       = hPitchFunc(fMel);
0018 end
0019 
0020 function [f] = acaFant_I(m)
0021     %mel         = 1000 * log2(1 + f/1000);
0022     f   = 1000 * (2.^(m/1000)-1);
0023 end
0024 
0025 function [f] = acaShaughnessy_I(m)
0026     %mel         = 2595 * log10(1 + f/700);
0027     f   = 700 * (10.^(m/2595)-1);
0028 end
0029 
0030 function [f] = acaUmesh_I(m)
0031     %mel         = f./(2.4e-4*f + 0.741);
0032     f   = m*.741 ./ (1 - m * 2.4e-4);
0033 end

Generated on Fri 22-Apr-2022 20:59:51 by m2html © 2005