3
$\begingroup$

I am running a WT using pywt.wavedec on a gait signal (accelerometer and gyroscope data), I'm setting level to 5 and using a db4 Wavelet. I am wondering why we only get the approximation coefficient cAn (cA5 in my case) returned from the pywt function. How do I access the rest of the approximation coefficients? Would appreciate the help, thank you!

$\endgroup$
1
  • 1
    $\begingroup$ Because that’s what this function outputs. Maybe this is what you’re looking for? $\endgroup$
    – Jdip
    Commented Sep 12, 2023 at 22:36

1 Answer 1

1
$\begingroup$

Basically at level $j$, approximation coefficients at level $j+1$ are obtained by applying one more wavelet level analysis step on cA$\{j\}$. Hence, you obtain approximation cA$\{j+1\}$ and details cD$\{j+1\}$. The reciprocal conists in applying an inverse or wavelet synthesis step on cA$\{j+1\}$ and cD$\{j+1\}$ to get cA$\{j\}$ back.

At level 4, cA4 decomposition on one level yields cA5 and cD5. This applies to all levels. Hence, you have all information for cA4 if you recompose one wavelet level from cA5 and cD5.

If you are only interested in approximation coefficients, you could just apply the low-pass filter followed by subsampling iteratively. Remember that low-pass outputs share some common information.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.