aboutsummaryrefslogtreecommitdiff
path: root/src/modules/audio_processing/aecm/main/matlab/hisser2.m
blob: 5a414f9da8582c67bbd2033065b41fe1637e0e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function  bcount=hisser2(bs,bsr,bandfirst,bandlast)
% function  bcount=hisser(bspectrum,bandfirst,bandlast)
% histogram for the binary spectra
% bcount= array of bit counts 
% bs=binary spectrum (one int32 number each)  
% bsr=reference binary spectra (one int32 number each)
% blockSize = histogram over blocksize blocks
% bandfirst = first band considered
% bandlast = last band considered

% weight all delays equally
maxDelay = length(bsr);

% compute counts (two methods; the first works better and is operational)
bcount=zeros(maxDelay,1);
for(i=1:maxDelay)
 % the delay should have low count for low-near&high-far and high-near&low-far
 bcount(i)= sum(bitget(bitxor(bs,bsr(i)),bandfirst:bandlast));  
 % the delay should have low count for low-near&high-far (works less well)
% bcount(i)= sum(bitget(bitand(bsr(i),bitxor(bs,bsr(i))),bandfirst:bandlast));
end