transforms data using wavelet transform w, up to scales FORMAT [wimg, oimgi] = transform(data, w, scales) Input data - data to transform - up to 3 dimensions w - wavelet object specifying transform scales - degree of coursest scale Output wimg - wavelet transformed data, in resized data matrix if necessary oimgi - index limits to retrieve original data from (inverted) wimg matrix $Id: transform.m,v 1.5 2005/06/05 04:42:22 matthewbrett Exp $
0001 function [wimg, oimgi] = transform(data, w, scales) 0002 % transforms data using wavelet transform w, up to scales 0003 % FORMAT [wimg, oimgi] = transform(data, w, scales) 0004 % 0005 % Input 0006 % data - data to transform - up to 3 dimensions 0007 % w - wavelet object specifying transform 0008 % scales - degree of coursest scale 0009 % 0010 % Output 0011 % wimg - wavelet transformed data, in resized data matrix if necessary 0012 % oimgi - index limits to retrieve original data from (inverted) wimg 0013 % matrix 0014 % 0015 % $Id: transform.m,v 1.5 2005/06/05 04:42:22 matthewbrett Exp $ 0016 0017 % embed data in appropriate size matrix for wt 0018 [newdims oimgi] = inp2out(w, size(data)); 0019 wimg = zeros(newdims); 0020 numdims = pr_ndims2(newdims); 0021 % do assign in funny way to generalize for dimensions 0022 wimg = subsasgn(wimg, phiw_lims('subs', oimgi), data); 0023 0024 % transform 0025 levs = levels(w, newdims, scales); 0026 for d = 1:numdims 0027 [H{d} K{d}] = get_filters(w,newdims(d)); 0028 end 0029 0030 % in (up to) 3d 0031 wimg = wtnd(wimg, H, K, scales); 0032 0033 return 0034