Skip to content

Commit c184c28

Browse files
Update doa_srp.m
1 parent 0c0555d commit c184c28

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

ssl_tools/doa_srp.m

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function [specGlobal] = doa_srp(x,method, Param)
22
%%
33
if(~any(strcmp(method, {'SRP-PHAT' 'SRP-NON'})))
4-
error('ERROR[doa_srp]:´íÎóµÄmethod');
4+
error('ERROR[doa_srp]: method参数错误');
55
end
66
%% STFT
77
X = ssl_stft(x.',Param.window, Param.noverlap, Param.nfft, Param.fs);
@@ -21,7 +21,7 @@
2121
% Output:X: nbin x nfram x nchan matrix
2222

2323
[nchan,~]=size(x);
24-
[Xtemp,F,T,~] = spectrogram(x(1,:),window,noverlap,nfft,fs);%S nbinxnframe
24+
[Xtemp,F,T,~] = spectrogram(x(1,:),window,noverlap,nfft,fs); % S nbin x nframe
2525
nbin = length(F);
2626
nframe = length(T);
2727
X = zeros(nbin,nframe,nchan);
@@ -42,10 +42,7 @@
4242
specCurrentPair = interp1q(Param.alphaSampled{i}', specSampledgrid, Param.alpha(i,:)');
4343
specInst(:,:) = specInst(:,:) + specCurrentPair;
4444
end
45-
% for i=1:nFrames
46-
% minVal = min(min(specInst(:,i)));
47-
% specInst(:,i)=(specInst(:,i) - minVal)/ max(max(specInst(:,i)- minVal));
48-
% end
45+
4946
switch Param.pooling
5047
case 'max'
5148
specGlobal = shiftdim(max(specInst,[],2));
@@ -66,10 +63,7 @@
6663
specCurrentPair = interp1q(Param.alphaSampled{i}', specSampledgrid, Param.alpha(i,:)');
6764
specInst = specInst + specCurrentPair;
6865
end
69-
% for i=1:nFrames
70-
% minVal = min(min(specInst(:,i)));
71-
% specInst(:,i)=(specInst(:,i) - minVal)/ max(max(specInst(:,i)- minVal));
72-
% end
66+
7367
switch Param.pooling
7468
case 'max'
7569
specGlobal = shiftdim(max(specInst,[],2));

0 commit comments

Comments
 (0)