-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathCOSHdist.m
47 lines (41 loc) · 960 Bytes
/
COSHdist.m
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function [E,Eps] = COSHdist(H,P)
% Finds the symmetric Itakura-Saito distance using the hyperbolic cosine function
%
% Syntax: [OUTPUTARGS] = COSHDIST(INPUTARGS) Explain usage here
%
% Inputs:
% input1 - Description
% input2 - Description
% input3 - Description
%
% Outputs:
% output1 - Description
% output2 - Description
%
% Example:
% Line 1 of example
% Line 2 of example
% Line 3 of example
%
% See also: List related files here
% Author: Jacob Donley
% University of Wollongong
% Email: [email protected]
% Copyright: Jacob Donley 2017
% Date: 24 October 2016
% Revision: 0.1
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[~,X]=size(P);
Hx = repmat(H(:),1,X);
% K = numel(H);
% E = 1/K *...
% sum( ...
% abs(Hx)./P ...
% - log( abs(Hx)./P ) ...
% + P./abs(Hx) ...
% - log( P./abs(Hx) ) ...
% - 2 ) / 2;
E = mean( cosh( log( Hx./P ) ) - 1 );
Eps = mean(E);
end