tests/mrdwt.R

###
### $Id: mrdwt.R 35 2022-05-31 05:53:13Z proebuck $
###

options(warn=1)
library(rwt)


##-----------------------------------------------------------------------------
test.mrdwt <- function(input, expected) {
   result <- rwt::mrdwt(input$signal, input$filter, input$nlevels)
   identical(all.equal(result,
                       expected,
                       tolerance=0.0000001),
             TRUE)
}


sig <- rwt::makesig(SIGNAL.LEOPOLD, 8)
h <- rwt::daubcqf(4, PHASE.MINIMUM)
mrdwt.expected <- list(yl = matrix(data = c( 0.8365163,
                                             0.4829629,
                                             0,
                                             0,
                                             0,
                                             0,
                                            -0.1294095,
                                             0.2241439)),
                       yh = matrix(data = c(-0.2241439,
                                            -0.1294095,
                                             0,
                                             0,
                                             0,
                                             0,
                                            -0.4829629,
                                             0.8365163)),
                       L = 1)

test.mrdwt(list(signal = sig$x, filter = h$h.0, nlevels = 1), mrdwt.expected)

Try the rwt package in your browser

Any scripts or data that you put into this service are public.

rwt documentation built on June 14, 2022, 5:07 p.m.