Commit [06be9a] Maximize Restore History

Single coefficient plotting function plotwavelets

Fixed 2nd parameter checking in the inverse transform functions (fixed demo_imagecompression).
Fixed examples in function headers.

prusa prusa 2013-03-14

1 2 > >> (Page 1 of 2)
removed wavelets/plotufwt.m
changed wavelets
changed wavelets/Contents.m
changed wavelets/fwt.m
changed wavelets/ifwt.m
changed wavelets/iufwt.m
changed wavelets/iuwfbt.m
changed wavelets/iuwpfbt.m
changed wavelets/iwfbt.m
changed wavelets/iwpfbt.m
changed wavelets/private
changed wavelets/private/nat2freqOrder.m
changed wavelets/private/rangeWpBF.m
changed wavelets/private/treeSub.m
changed wavelets/ufwt.m
changed wavelets/uwfbt.m
changed wavelets/uwpfbt.m
changed wavelets/wavfun.m
changed wavelets/wfbt.m
changed wavelets/wfbtmultid.m
changed wavelets/wfbtput.m
changed wavelets/wfbtremove.m
changed wavelets/wpbest.m
copied wavelets/plotfwt.m -> wavelets/plotwavelets.m
wavelets/plotufwt.m
File was removed.
wavelets
Directory.
wavelets/Contents.m Diff Switch to side-by-side view
Loading...
wavelets/fwt.m Diff Switch to side-by-side view
Loading...
wavelets/ifwt.m Diff Switch to side-by-side view
Loading...
wavelets/iufwt.m Diff Switch to side-by-side view
Loading...
wavelets/iuwfbt.m Diff Switch to side-by-side view
Loading...
wavelets/iuwpfbt.m Diff Switch to side-by-side view
Loading...
wavelets/iwfbt.m Diff Switch to side-by-side view
Loading...
wavelets/iwpfbt.m Diff Switch to side-by-side view
Loading...
wavelets/private
Directory.
wavelets/private/nat2freqOrder.m Diff Switch to side-by-side view
Loading...
wavelets/private/rangeWpBF.m Diff Switch to side-by-side view
Loading...
wavelets/private/treeSub.m Diff Switch to side-by-side view
Loading...
wavelets/ufwt.m Diff Switch to side-by-side view
Loading...
wavelets/uwfbt.m Diff Switch to side-by-side view
Loading...
wavelets/uwpfbt.m Diff Switch to side-by-side view
Loading...
wavelets/wavfun.m Diff Switch to side-by-side view
Loading...
wavelets/wfbt.m Diff Switch to side-by-side view
Loading...
wavelets/wfbtmultid.m Diff Switch to side-by-side view
Loading...
wavelets/wfbtput.m Diff Switch to side-by-side view
Loading...
wavelets/wfbtremove.m Diff Switch to side-by-side view
Loading...
wavelets/wpbest.m Diff Switch to side-by-side view
Loading...
wavelets/plotfwt.m to wavelets/plotwavelets.m
--- a/wavelets/plotfwt.m
+++ b/wavelets/plotwavelets.m
@@ -1,4 +1,4 @@
-function [C] = plotfwt(c,info,varargin)
+function [C] = plotwavelets(c,info,varargin)
 %PLOTFWT  Plot wavelet coefficients
 %   Usage:  plotfwt(c,info,fs) 
 %           plotfwt(c,info,fs,'dynrange',dynrange,...)
@@ -48,13 +48,17 @@
    error('%s: Flag %s not supported yet.',upper(mfilename),flags.fwtplottype);
 end
 
+maxSubLen = [];
 draw_ticks = 1;
+
 if(strcmpi(info.fname,'fwt'))
+%% FWT plot
    % Change to the cell format
    if(isnumeric(c))
        c = wavpack2cell(c,info.Lc,info.dim);
    end
-
+   maxSubLen = max(info.Lc);
+   
    % Only one channel signals can be plotted.
    if(size(c{1},2)>1)
       error('%s: Multichannel input not supported.',upper(mfilename));
@@ -67,6 +71,7 @@
    J = info.J;
    a = [aBase(1).^J, reshape(aBase(2:end)*aBase(1).^(J-1:-1:0),1,[])]';
 elseif(strcmpi(info.fname,'ufwt'))
+   
    % Only one channel signals can be plotted.
    if(ndims(c)>2)
       error('%s: Multichannel not supported.',upper(mfilename));
@@ -75,8 +80,6 @@
    subbNo = size(c,2);
    a = ones(subbNo,1);
 
-   % Determine number of levels *J* and subsampling factors *a* for
-   % subbands. For correct y axis description.
    g = fwtinit(info.fwtstruct,'syn');
    filtNo = numel(g.filts);
    J = info.J; 
@@ -85,16 +88,44 @@
    if(size(c{1},2)>1)
       error('%s: Multichannel input not supported.',upper(mfilename));
    end
+   maxSubLen = max(cellfun(@(cEl) size(cEl,1),c));
    a = treeSub(info.wt);
    subbNo = numel(c);
-   J = subbNo - 1;
-   filtNo = 2;
    draw_ticks = 0;
+elseif(strcmpi(info.fname,'uwfbt'))
+   % Only one channel signals can be plotted.
+   if(ndims(c)>2)
+      error('%s: Multichannel not supported.',upper(mfilename));
+   end
+
+   subbNo = size(c,2);
+   a = ones(subbNo,1);
+   draw_ticks = 0;
+elseif(strcmpi(info.fname,'wpfbt'))
+   % Only one channel signals can be plotted.
+   if(size(c{1},2)>1)
+      error('%s: Multichannel input not supported.',upper(mfilename));
+   end
+   maxSubLen = max(cellfun(@(cEl) size(c,1),c));
+   aCell = nodeSub(nodesBForder(info.wt),info.wt);
+   a = cell2mat(cellfun(@(aEl) aEl(:)',aCell,'UniformOutput',0));
+   draw_ticks = 0;
+elseif(strcmpi(info.fname,'uwpfbt'))
+   % Only one channel signals can be plotted.
+   if(ndims(c)>2)
+      error('%s: Multichannel not supported.',upper(mfilename));
+   end
+
+   subbNo = size(c,2);
+   a = ones(subbNo,1);
+   draw_ticks = 0;
+else
+   error('%s: Unknown function name %s.',upper(mfilename),info.fname);
 end
 
 % Use plotfilterbank
 C=plotfilterbank(c,a,[],kv.fs,kv.dynrange,flags.plottype,...
-  flags.log,flags.colorbar,flags.display,'fontsize',kv.fontsize,'clim',kv.clim);
+  flags.log,flags.colorbar,flags.display,'fontsize',kv.fontsize,'clim',kv.clim,'xres',min([maxSubLen,800]));
 
 if(draw_ticks)
    % Redo the yticks and ylabel
1 2 > >> (Page 1 of 2)