-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Hi,
I wanted to know if there is a specific reason why, in asr_calibrate, the following loop was used for the covariance estimation
line 158
% calculate the sample covariance matrices U (averaged in blocks of blocksize successive samples)
U = zeros(length(1:blocksize:S),C*C);
for k=1:blocksize
range = min(S,k:blocksize:(S+k-1));
U = U + reshape(bsxfun(@times,reshape(X(range,:),[],1,C),reshape(X(range,:),[],C,1)),size(U));
end
A faster and less memory intensive implementation would be something like this:
U2 = zeros(length(1:blocksize:S),C*C);
indx=1:blocksize:S;
for i=k:length(1:blocksize:S)
indices=indx(k):min(S,indx(k)+blocksize-1);
U2(k,:) = reshape(X(indices,:)' * X(indices,:),[1 C*C]);
end
Also, I see that that the default blocksize is 10 which seems very low for a correct empirical covariance estimation. Shouldn't we prefer a blocksize at least greater than the number of electrodes (or even blocksize>2*C) ?
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels