nullevels.wd | R Documentation |
Sets whole resolution levels of coefficients equal to zero in a wd.object
## S3 method for class 'wd'
nullevels(wd, levelstonull, ...)
wd |
An object of class |
levelstonull |
An integer vector specifying which resolution levels of coefficients of |
... |
any other arguments |
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.
An object of class wd
where the coefficients in resolution levels specified by levelstonull
have been set to zero.
Version 3.8.1 Copyright Guy Nason 1997
G P Nason
nullevels
, wd
, wd.object
, threshold
.
#
# Generate some test data
#
test.data <- example.1()$y
#
# Do wavelet transform of test.data and plot the wavelet coefficients
#
wds <- wd(test.data)
## Not run: 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
#
## Not run: plot(wdsnl, scaling = "by.level")
#
# Lo and behold the odd levels have been set to zero!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.