One way to remove noise from a signal is applying the discrete wavelet transform, apply a threshold (soft or hard) and then run the inverse discrete wavelet transform to retrieve the original signal without noise.
R language has dwt and idwt functions (package wavelets) to perform the discrete wavelet transform and inverse discrete wavelet transform. The output of dwt is W (wavelet coefficient) and V (scale coefficient).
My question is: The threshold should be applied on W, on V or both? And why? I'm missing something here because for me should be on W, but it didnt work.
Example:
library(wavelets)
w <- dwt(series_with_noise, filter="la16")
w@W$W1 <- treshold_function(w@W$W1, lambda) # Should I do this?
w@V$V1 <- treshold_function(w@V$V1, lambda) # Should I do this?
series_denoised <- idwt(w)
plot(series_denoised)
If I nullify all w@W but maintaining V the idwt doesnt change. Don't know why =/.
You should modify the W values if you want to do smoothing. For example:
Created on 2023-12-30 with reprex v2.0.2