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