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

Close

[6db11f]: blockproc / blockplot.m Maximize Restore History

Download this file

blockplot.m    41 lines (30 with data), 949 Bytes

 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
function cola=blockplot(p,F,c,cola)
%BLOCKPLOT Plot block coefficients
% Usage: blockplot(p,F,c);
%
% Input parameters:
% p : JAVA object of the class net.sourceforge.ltfat.SpectFrame.
% F : Frame object.
% c : Block coefficients.
%
% `blockplot(p,F,c)` appends the block coefficients `c` to the running
% coefficient plot in `p`.
if size(c,2)>1
error('%s: Only one channel input is supported.',upper(mfilename));
end
ctf = framecoef2tf(F,c(:,1));
if strcmp(F.blockalg,'sliced')
% DO the coefficient overlapping or cropping
%ctf = ctf(:,floor(end*3/8):floor(end*5/8)+1);
if nargin>3
olLen = ceil(size(ctf,2)/2);
if isempty(cola)
cola = zeros(size(ctf,1),olLen);
end
ctf(:,1:olLen) = ctf(:,1:olLen) + cola;
cola = ctf(:,end+1-olLen:end);
ctf = ctf(:,1:olLen);
end
end
ctf = cast(ctf,'single');
javaMethod('append',p,ctf);