Fig5.15n <- function() { # postscript(file = "Fig5.15.ps", height = 3.9, width = 7.37, horiz = F) par(mfrow = c(1, 2), mar = c(2.5, 2.5, 1.5, 1.5), mgp = c(1.5, 0.4, 0)) rs <- c(57, 14, 55, 51, 30, 0, 53, 44, 34, 53, 49, 2) .Random.seed <- rs x <- (1:1024)/1024 blocky <- fblocks(x) sigma <- sqrt(var(blocky))/3 bnoise <- blocky + rnorm(1024, sd = sigma) qqnorm(wd(bnoise, filter.number = 5)$D, ylab = "Wavelet coefficient values") mtext("Blocky function", side = 3, line = 0.1) .Random.seed <- rs wn <- rnorm(1024) qqnorm(wd(wn, filter.number = 5)$D, ylab = "Wavelet coefficient values") mtext("White noise", side = 3, line = 0.1) # graphics.off() NULL } fblocks <- function(x) { n <- length(x) t <- c(0.1, 0.13, 0.15, 0.23, 0.25, 0.4, 0.44, 0.65, 0.76, 0.78, 0.81) h <- c(4, -5, 3, -4, 5, -4.2, 2.1, 4.3, -3.1, 2.1, -4.2) f <- rep(0, n) i <- 1 while(i <= 11) { ind <- ceiling(t[i] * n) f[ind:n] <- f[ind:n] + h[i] i <- i + 1 } f }