|
1 | 1 | function [specGlobal] = doa_srp(x,method, Param)
|
2 | 2 | %%
|
3 | 3 | if(~any(strcmp(method, {'SRP-PHAT' 'SRP-NON'})))
|
4 |
| - error('ERROR[doa_srp]:´íÎóµÄmethod'); |
| 4 | + error('ERROR[doa_srp]: method参数错误'); |
5 | 5 | end
|
6 | 6 | %% STFT
|
7 | 7 | X = ssl_stft(x.',Param.window, Param.noverlap, Param.nfft, Param.fs);
|
|
21 | 21 | % Output:X: nbin x nfram x nchan matrix
|
22 | 22 |
|
23 | 23 | [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 |
25 | 25 | nbin = length(F);
|
26 | 26 | nframe = length(T);
|
27 | 27 | X = zeros(nbin,nframe,nchan);
|
|
42 | 42 | specCurrentPair = interp1q(Param.alphaSampled{i}', specSampledgrid, Param.alpha(i,:)');
|
43 | 43 | specInst(:,:) = specInst(:,:) + specCurrentPair;
|
44 | 44 | 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 | + |
49 | 46 | switch Param.pooling
|
50 | 47 | case 'max'
|
51 | 48 | specGlobal = shiftdim(max(specInst,[],2));
|
|
66 | 63 | specCurrentPair = interp1q(Param.alphaSampled{i}', specSampledgrid, Param.alpha(i,:)');
|
67 | 64 | specInst = specInst + specCurrentPair;
|
68 | 65 | 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 | + |
73 | 67 | switch Param.pooling
|
74 | 68 | case 'max'
|
75 | 69 | specGlobal = shiftdim(max(specInst,[],2));
|
|
0 commit comments