Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[291105]: comp / comp_dgtreal.m Maximize Restore History

Download this file

comp_dgtreal.m    60 lines (41 with data), 1.2 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
46
47
48
49
50
51
52
53
54
55
function c=comp_dgtreal(f,g,a,M,lt,phasetype)
%COMP_DGTREAL Compute a DGTREAL
% Usage: c=comp_dgt_real(f,g,a,M,lt,phasetype);
%
% Input parameters:
% f : Input data
% g : Window function.
% a : Length of time shift.
% M : Number of modulations.
% L : Length of transform to do.
% Output parameters:
% c : M*N array of coefficients.
%
% AUTHOR : Peter L. Søndergaard.
L=size(f,1);
Lwindow=size(g,1);
W=size(f,2);
N=L/a;
M2=floor(M/2)+1;
if lt(2)==1
if Lwindow<L
% Do the filter bank algorithm
% Periodic boundary conditions
c=comp_dgtreal_fb(f,g,a,M);
c=reshape(c,M2,N,W);
else
% Do the factorization algorithm
c=comp_dgtreal_long(f,g,a,M);
c=reshape(c,M2,N,W);
end;
if phasetype==1
TimeInd = (0:(N-1))*a;
FreqInd = (0:(M2-1))/M;
phase = FreqInd'*TimeInd;
phase = exp(2*i*pi*phase);
c=bsxfun(@times,c,phase);
end;
else
% Quinqux lattice
c=comp_nonsepdgtreal_quinqux(f,g,a,M);
end;