Mercurial > hg > emotion-detection-top-level
comparison Code/Descriptors/Matlab/MPEG7/FromWeb/VoiceSauce/func_getBWfromFMT.m @ 4:92ca03a8fa99 tip
Update to ICASSP 2013 benchmark
author | Dawn Black |
---|---|
date | Wed, 13 Feb 2013 11:02:39 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:e1cfa7765647 | 4:92ca03a8fa99 |
---|---|
1 function BW = func_getBWfromFMT(FMT, voiced, method) | |
2 % formant to bandwidth mapping function | |
3 % | |
4 % Author: Yen-Liang Shue and Markus Iseli, Speech Processing and Auditory Perception Laboratory, UCLA | |
5 % Copyright UCLA SPAPL 2009 | |
6 | |
7 if (nargin == 2) % use the Mannell formula | |
8 BW = (80 + 120 * FMT/5000) * (2 - voiced); | |
9 | |
10 elseif (nargin == 3 && strcmp(method, 'hm')) % use the Hawks and Miller formula | |
11 F0 = voiced; | |
12 BW = getbw_HawksMiller(FMT, F0)'; | |
13 | |
14 end | |
15 | |
16 | |
17 %------------------------------------------------------------------------- | |
18 function BW = getbw_HawksMiller(FMT,F0) | |
19 % Reference: Hawks, Miller, "A formant bandwidth estimation procedure for vowel | |
20 % synthesis," JASA, vol 97, no. 2, 1995 | |
21 | |
22 [r, c] = size(FMT); | |
23 if (r > c) | |
24 FMT = FMT'; | |
25 end | |
26 | |
27 S = 1+0.25*(F0-132)/88; % bandwidth scaling factor as a function of F0 | |
28 | |
29 % coefficients C1 (for Fx<500 Hz) and C2 (Fx>=500Hz) | |
30 C1 = [165.327516, -6.73636734e-1, 1.80874446e-3, -4.52201682e-6, 7.49514000e-9, -4.70219241e-12]; | |
31 C2 = [15.8146139, 8.10159009e-2, -9.79728215e-5, 5.28725064e-8, -1.07099364e-11, 7.91528509e-16]; | |
32 | |
33 F = [ones(1, length(FMT)); FMT; FMT.^2; FMT.^3; FMT.^4; FMT.^5]; | |
34 mask = FMT<500; % Fx < 500 Hz | |
35 mask = repmat(mask,length(C1),1); | |
36 | |
37 BW = S' .* (C1*(F .* mask) + C2*(F .* ~mask)); |