localizer_detect.m 947 Bytes
Newer Older
1 2
% revision 1.00.1 beta, 07/01/04

3
function response = localizer_detect
4 5 6 7 8 9 10

global def
global work
global simwork

% we select only the left channels, the model is monaural
simwork.tmpSig = work.signal;
11
simwork.DOA = [];
12 13

for i=1:def.intervalnum
14
	simwork.DOA(i) = eval([work.vpname '_preproc(simwork.tmpSig(:,2*i-1:2*i))']);		% actual sig processing
15 16
end

17 18
if length(unique(simwork.DOA))==1
    response=randi(3);
19 20 21 22 23 24
else
where=simwork.DOA(1)-simwork.DOA(2:3);
if where(1)==where(2)
    response=1;
elseif where(1)==0
    response=3;
25
elseif where(2)==0
26
    response=2;
27 28
elseif where(1)~=where(2)
    response=randi(3);
29 30 31 32
end
end

    
33
% now select the interval with the maximum standard deviation
34
% [tmp,response] = max(simwork.actStd);			% select max power
35 36 37 38 39 40 41

% if it is another interval than the first, the response is wrong, since in the work.signal always carries the
% signal interval in the first column
if response ~= 1
   response = 0;
end

42 43 44
end


45
% eof