[e6709d]: gabor / iwmdct.m  Maximize  Restore  History

Download this file

77 lines (64 with data), 1.7 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
function [f,g]=iwmdct(c,g,Ls)
%IWMDCT Inverse MDCT
% Usage: f=iwmdct(c,g);
% f=iwmdct(c,g,Ls);
%
% Input parameters:
% c : M*N array of coefficients.
% g : Window function.
% Ls : Final length of function (optional)
% Output parameters:
% f : Input data
%
% `iwmdct(c,g)` computes an inverse windowed MDCT with window *g*. The
% number of channels is deduced from the size of the coefficient array *c*.
%
% The window *g* may be a vector of numerical values, a text string or a
% cell array. See the help of |wilwin| for more details.
%
% `iwmdct(f,g,Ls)` does the same, but cuts or zero-extends the final
% result to length *Ls*.
%
% `[f,g]=iwmdct(...)` additionally outputs the window used in the
% transform. This is usefull if the window was generated from a
% description in a string or cell array.
%
% See also: wmdct, wilwin, dgt, wildual, wilorth
%
% References: prbr86 prjobr87 ma92 bohl96-1
% AUTHOR: Peter L. Søndergaard
% TESTING: TEST_WMDCT
% REFERNCE: OK
error(nargchk(2,3,nargin));
wasrow=0;
if isnumeric(g)
if size(g,2)>1
if size(g,1)>1
error('g must be a vector');
else
% g was a row vector.
g=g(:);
% If the input window is a row vector, and the dimension of c is
% equal to two, the output signal will also
% be a row vector.
if ndims(c)==2
wasrow=1;
end;
end;
end;
end;
M=size(c,1);
N=size(c,2);
W=size(c,3);
a=M;
L=M*N;
assert_L(L,0,L,a,2*M,'IWMDCT');
g=wilwin(g,M,L,'IWMDCT');
f=comp_idwiltiii(c,g);
% Check if Ls was specified.
if nargin==3
f=postpad(f,Ls);
else
Ls=L;
end;
f=comp_sigreshape_post(f,Ls,wasrow,[0; W]);

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

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks