Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dof

Compute number of non-zero coefficients in wd object


Description

Compute number of non-zero coefficients in wd object

Usage

dof(wd)

Arguments

wd

A wavelet decomposition object (such as that returned by the wd function).

Details

Very simple function that counts the number of non-zero coefficients in a wd class object.

Value

An integer that represents the number of non-zero coefficients in the input wd object.

RELEASE

Version 3.0 Copyright Guy Nason 1994

Author(s)

G P Nason

See Also

Examples

#
# Let's generate some purely random numbers!!
#
myrandom <- rnorm(512)
#
# Take the discrete wavelet transform
#
myrandomWD <- wd(myrandom)
#
# How many coefficients are non-zero?
#
dof(myrandomWD)
# [1] 512
#
# All of them were nonzero!
#
# Threshold it
#
myrandomWDT <- threshold(myrandomWD, policy="universal")
#
# Now lets see how many are nonzero
#
dof(myrandomWDT)
# [1] 8
#
# Wow so 504 of the coefficients were set to zero! Spooky!
#

wavethresh

Wavelets Statistics and Transforms

v4.6.8
GPL (>= 2)
Authors
Guy Nason [aut, cre]
Initial release
2016-10-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.