📄 wtlib.par.lib
字号:
WTLIB - Functions for wavelet transformswt_cascade - generate the mother wavelet and scaling functionfhierfromcd - calculates f(x,z) hierarchically from CD (wavelet coefficients)wto1d - wavelet transform operator, 1Dwto1dset - setup wavelet operatorswt1 - 1D wavelet transformwtn - n-D wavelet transformFunction prototypes:void wt_cascade(WtFilter *wfilt,WtSizes *wtsizes);void fhierfromcd(float *f,float *cd, WtFilter *wfilt,WtSizes *wtsizes,int justDC);void wto1d(float *cd,int npoints,enum ToCorD tocord, WtFilter *wfilt);void wto1dset(WtFilter *wfilt,WtSizes *wtsizes);void wt1(float *cd,enum ToCorD tocord,int npoints, WtFilter *wfilt,WtSizes *wtsizes,int idim);void wtn(float *cd,enum ToCorD tocord, WtFilter *wfilt,WtSizes *wtsizes, int dconly);wt_cascade:Input:WtFilter *wfilt pointer to wavelet operator (filter)WtSizes *wtsizes pointer to sizes of the wavelet operatorReturns:wfilt->psi pointer to mother waveletwfilt->phi pointer to scaling functionfhierfromcd:Input:float *cd pointer to wavelet coefficientsWtFilter *wfilt pointer to wavelet operator (filters)WtSizes *wtsizes pointer to wavelet sizesint justDC flag =1 do DC (zero frequency)Returns:float *f pointer to function f(x,z)wto1d:Input:float *cd pointer to wavelet coefficients, or f(x)int npoints size of the input signalenum ToCorD tocord =ToC inverse or =ToD forward transformWtFilter *wfilt pointer to wavelet operator (filters)Returns:float *cd pointer to f(x) or to wavelet coefficientswto1dset:Input:WtFilter *wfilt pointer to wavelet filterWtSizes *wtsizes pointer to wavelet filter sizesReturn:wfilt->order order of Daubechies waveletwtsizes->sizes sizes of the wavelet operatorwt1:Input:float *cd pointer to wavelet coeff. or input f(x)enum ToCorD tocord =ToC (invers) =ToD (forward) wavelet transformint npoints size of signal f(x) or cdWtFilter *wfilt pointer to wavelet operator (filters)WtSizes *wtsizes pointer to wavelet sizesint idim index for dimensionReturns:float *cd pointer to input f(x) or to wavelet coefficientswtn:Input:float *cd pointer to n-D wavelet coeff, or f(x_1,..,x_n)enum ToCorD tocord =ToC (inverse) =ToD (forward) wavelet transformWtFilter *wfilt pointer to wavelet operator (filters)WtSizes *wtsizes pointer to wavelet sizes int dconly keep and transform back form mra dc component onlyReturns:float *cd pointer to f(x_1,...,x_n) or n-D wavelet coeffs.Notes:wt_cascade:Generate data sets phi[0..lengthphi-1] or psi[0..lengthphi-1].phi or psi[i] = \phi or \psi (i>>MaxLevel).fhierfromcd:Once we have the wavelet coefficients cd, we could applied a inverse wavelet transform to reconstruct the function f, this is the ordinary way to view the reconstructed f. A good alternativeis to make the "MRA display", which is to show f hierarchically. In "MRA display", the DC is put on the upper-left corner, and higherfrequency rectanges are on the lower-right corner. wto1d:1D wavelet transform operator, used to apply multi-dimensional wavelet transform, in which data of each dimension is extracted and 1D wavelet transform (forward: tocord==ToD; backward: tocord ==ToC) is applied to this 1-D data. Before using wto1d, we must call wto1dset to set up the wavelet filters. wto1dset:This subroutine initialize the wavelet filters for wavelettransform operator wto1d. According to the order you choosein your main (wtsizes->order=4 up to 20), wto1dset set upthe filter to be the Daubechies wavelet of this order/length. This subroutine will be need before calling wt1 or wtn. wt1:1D wavelet transform. cd[1..npoints] as the discrete values of a 1Dfunction f(x) will be replaced by its wavelet transform if tocord==ToD, or the wavelet coefficients cd[1..npoints] will be replacedby the inverse wavelet transform, thus to obtain the reconstructedf. The size of f npoints MUST be an integer power of 2.wtn:Given a n-D discrete values cd[...] of a n-D function f(x_1,...,x_n)n-D wavelet transform will be applied if tocord==ToD; or givena n-D wavelet coefficients of an n-D function, inverse wavelettransform will be applied to reconstruct the n-D function f. Mustcall wto1dset before calling wtn.References:Daubechies, I., 1988, Orthonormal Bases of Compactly SupportedWavelets, Communications on Pure or Applied Mathematics, Vol. XLI,909-996.Z. Meng & J. Scales, Multi-resolution Analysis with wavelet transform: An application to 2-D tomography, CWP-223, 1996 W. Press et al., Numberical Recipes in C (second edition), Cambridge University Press, 1988 Author:CWP: Zhaobo Meng, Colorado School of Mines, Sept 1996Modified: Carlos E. Theodoro, Colorado School of Mines, Jun 97
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -