I'm trying to approximate a time series/vector usind dwt. I can apply the full dwt and idwt reconstruction, but i don´t know how to reconstruct/approximate the original signal based on just a few coefficients (not all).
I tryed this:
library(wavelets)
x<-c(7, 5, 5, 3, 3, 3, 4, 6)
w <- dwt(x, filter="haar",n.levels = 3)
rec<-idwt(w)
I read about coefficient truncation, but I don´t know how to do it.
What if I need an approximation based on ,lets say, 2 coefficients?
I'll appreciate any help.