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

Close

[77a22a]: frames / frsyn.m Maximize Restore History

Download this file

frsyn.m    81 lines (67 with data), 2.1 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
76
77
78
79
80
function outsig=frsyn(F,insig);
%FRSYN Frame synthesis operator
% Usage: f=frsyn(F,c);
%
% `f=frsyn(F,c)` constructs a signal *f* from the frame coefficients *c*
% using the frame *F*. The frame object *F* must have been created using
% |frame|_.
%
% See also: frame, frana, plotframe
if nargin<2
error('%s: Too few input parameters.',upper(mfilename));
end;
if ~isstruct(F)
error('%s: First agument must be a frame definition structure.',upper(mfilename));
end;
switch(F.type)
case 'identity'
outsig=insig;
case 'gen'
outsig=F.g*insig;
case 'dgt'
outsig=idgt(framecoef2native(F,insig),F.g,F.a,F.vars{:});
case 'dgtreal'
outsig=idgtreal(framecoef2native(F,insig),F.g,F.a,F.M,F.vars{:});
case 'dwilt'
outsig=idwilt(framecoef2native(F,insig),F.g);
case 'wmdct'
outsig=iwmdct(framecoef2native(F,insig),F.g);
case {'filterbank','ufilterbank'}
outsig=ifilterbank(framecoef2native(F,insig),F.g,F.a);
case {'filterbankreal','ufilterbankreal'}
outsig=2*real(ifilterbank(framecoef2native(F,insig),F.g,F.a));
case {'nsdgt','unsdgt'}
outsig=insdgt(framecoef2native(F,insig),F.g,F.a);
case {'nsdgtreal','unsdgtreal'}
outsig=insdgtreal(framecoef2native(F,insig),F.g,F.a);
case {'dcti','dctiv','dsti','dstiv'}
outsig=feval(F.type,insig);
case 'dctii'
outsig=dctiii(insig);
case 'dctiii'
outsig=dctii(insig);
case 'dstii'
outsig=dstiii(insig);
case 'dstiii'
outsig=dstii(insig);
case 'dft'
outsig=idft(insig);
case 'fusion'
W=size(insig,2);
L=size(insig,1)/framered(F);
outsig=zeros(L,W);
idx=0;
for ii=1:F.Nframes
coeflen=L*framered(F.frames{ii});
outsig=outsig+frsyn(F.frames{ii},insig(idx+1:idx+coeflen,:))*F.w(ii);
idx=idx+coeflen;
end;
case 'tensor'
outsig=frsyn(F.frames{1},insig);
perm=circshift((1:F.Nframes).',-1);
for ii=2:F.Nframes
outsig=permute(outsig,perm);
outsig=frsyn(F.frames{ii},outsig);
end;
outsig=permute(outsig,perm);
end;