Learn R Programming

wavethresh (version 4.7.3)

nullevels.wd: Sets whole resolution levels of coefficients equal to zero in a wd object.

Description

Sets whole resolution levels of coefficients equal to zero in a wd.object

Usage

# S3 method for wd
nullevels(wd, levelstonull, ...)

Value

An object of class wd where the coefficients in resolution levels specified by levelstonull have been set to zero.

Arguments

wd

An object of class wd.

levelstonull

An integer vector specifying which resolution levels of coefficients of wd that you wish to set to zero.

...

any other arguments

RELEASE

Version 3.8.1 Copyright Guy Nason 1997

Author

G P Nason

Details

Setting whole resolution levels of coefficients to zero can be very useful. For examples, one can construct a linear smoothing method by setting all coefficients above a particular resolution (the primary resolution equal to zero. Also setting particular levels equal to zero can also be useful for removing noise which is specific to a particular resolution level (as long as important signal is not also contained at that level).

Note that this function removes the horiztonal, diagonal and vertical detail coefficients at the resolution level specified. It does not remove the father wavelet coefficients at those resolution levels.

To remove individual coefficients on a systematic basis you probably want to look at the threshold function.

See Also

nullevels, wd, wd.object, threshold.

Examples

Run this code
#
# Generate some test data
#
test.data <- example.1()$y
#
# Do wavelet transform of test.data and plot the wavelet coefficients
#
wds <- wd(test.data)
if (FALSE) plot(wds)
#
# Now let us set all the coefficients in ODD resolution levels equal to zero!
#
# This is just to illustrate the capabilities of the function. I cannot
# imagine you wanting to do this in practice!
##
wdsnl <- nullevels(wds, levelstonull = c(1, 3, 5, 7))
#
# Now let's plot the result
#
if (FALSE) plot(wdsnl, scaling = "by.level")
#
# Lo and behold the odd levels have been set to zero!

Run the code above in your browser using DataLab