Skip to content

Commit

Permalink
cosmetic fixes and dependency checking
Browse files Browse the repository at this point in the history
  • Loading branch information
lerch committed Jul 31, 2015
1 parent 897bb88 commit 8477b9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions FeatureSpectralMfccs.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
% ======================================================================
function [vmfcc] = FeatureSpectralMfccs(X, f_s)

if(exist('ComputeFeature') ~=2)
error('Please add the ACA scripts (https://github.com/alexanderlerch/ACA-Code) to your path!');
end

iNumCoeffs = 13;

% allocate memory
Expand Down
20 changes: 10 additions & 10 deletions ToolFreq2Bark.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
%>
%> @retval bark value
% ======================================================================
function [mel] = ToolFreq2Bark(fInHz, cModel)
function [bark] = ToolFreq2Bark(fInHz, cModel)

if (nargin < 2)
cModel = 'Schroeder';
Expand All @@ -15,21 +15,21 @@
% set function handle
hPitchFunc = str2func (['aca' cModel]);

mel = hPitchFunc(fInHz);
bark = hPitchFunc(fInHz);
end

function [mel] = acaSchroeder(f)
mel = 7 * asinh(f/650);
function [bark] = acaSchroeder(f)
bark = 7 * asinh(f/650);
end

function [mel] = acaTerhardt(f)
mel = 13.3 * atan(0.75 * f/1000);
function [bark] = acaTerhardt(f)
bark = 13.3 * atan(0.75 * f/1000);
end

function [mel] = acaZwicker(f)
mel = 13 * atan(0.76 * f/1000) + 3.5 * atan(f/7500);
function [bark] = acaZwicker(f)
bark = 13 * atan(0.76 * f/1000) + 3.5 * atan(f/7500);
end

function [mel] = acaTraunmuller(f)
mel = 26.81/(1+1960./f) - 0.53;
function [bark] = acaTraunmuller(f)
bark = 26.81/(1+1960./f) - 0.53;
end

0 comments on commit 8477b9a

Please sign in to comment.