-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinferA.m
34 lines (28 loc) · 883 Bytes
/
inferA.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
function[A] = inferA(blockSize, mixtures, aprioriA, epsilon)
%------------------------------------------------------------------------
%
% inferA.m:
% Infers the mixing matrix based on apriori information.
%
% Inputs:
% mixtures: The mixtures undergoing blind source separation
% blockSize: The block size to use when sampling from the mixtures
% while performing blind source separation
% aprioriA: The last inferred value of the mixing matrix
%
% Outputs:
% A: The inferred mixing matrix
%
%------------------------------------------------------------------------
% Get number of mixtures
numMixtures = size(mixtures, 1);
% Get samples
samples = sample(blockSize, mixtures);
% Get S according to apriori A
S = aprioriA\samples;
% Block evaluation
Z = -sign(S);
% Recalculate A
deltaA = -aprioriA*Z*S' - numMixtures*aprioriA;
A = aprioriA + epsilon*deltaA;
end