-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathToolFreq2Mel.m
More file actions
33 lines (27 loc) · 668 Bytes
/
ToolFreq2Mel.m
File metadata and controls
33 lines (27 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
%converts frequency to mel
%>
%> @param fInHz: frequency
%> @param cModel: 'Fant','Shaughnessy', or 'Umesh'
%>
%> @retval mel pitch value
% ======================================================================
function [mel] = ToolFreq2Mel(fInHz, cModel)
if (nargin < 2)
cModel = 'Fant';
end
% set function handle
hPitchFunc = str2func (['aca' cModel '_I']);
mel = hPitchFunc(fInHz);
end
% Fant
function [mel] = acaFant_I(f)
mel = 1000 * log2(1 + f/1000);
end
% Shaughnessy
function [mel] = acaShaughnessy_I(f)
mel = 2595 * log10(1 + f/700);
end
% Umesh
function [mel] = acaUmesh_I(f)
mel = f./(2.4e-4*f + 0.741);
end