[e2c226]: comp / comp_gabreassign.m  Maximize  Restore  History

Download this file

49 lines (36 with data), 1.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function sr=comp_gabreassign(s,tgrad,fgrad,a);
%COMP_GABREASSIGN Reassign time-frequency distribution.
% Usage: sr = comp_gabreassign(s,tgrad,fgrad,a);
%
% COMP_GABREASSIGN(s,tgrad,fgrad,a) will reassign the values of the positive
% time-frequency distribution s using the instantaneous time and frequency
% fgrad and ifdummy. The lattice is determined by the time shift _a and
% the number of channels deduced from the size of s.
%
% See also: gabreassign
%
% References: aufl95
% AUTHOR : Peter L. Søndergaard.
% TESTING: OK
% REFERENCE: OK
[M,N,W]=size(s);
L=N*a;
b=L/M;
freqpos=fftindex(M);
tgrad=bsxfun(@plus,tgrad/b,freqpos);
timepos=fftindex(N);
fgrad=bsxfun(@plus,fgrad/a,timepos.');
tgrad=round(tgrad);
fgrad=round(fgrad);
tgrad=mod(tgrad,M);
fgrad=mod(fgrad,N);
sr=zeros(M,N,W);
fgrad=fgrad+1;
tgrad=tgrad+1;
for w=1:W
for ii=1:M
for jj=1:N
sr(tgrad(ii,jj),fgrad(ii,jj),w) = sr(tgrad(ii,jj),fgrad(ii,jj),w)+s(ii,jj,w);
end;
end;
end;

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks