I need to run a Shannon (or any such metric) Entropy minimization for a wavelet packet tree, but I'm having problems sussing out the algorithm. Sometimes this is referred to as optimizing the tiles in frequency-space. I can follow solve the problem for a scale, but I can't find a way of resolving overlap conflicts with the subsequent scales. Should the gaps in the resultant scalogram simply be padded with the result from the first resolved layer?
I've tried using PyWavelet's pywt.WaveletPacket, and scouring google for someone that has addressed this problem, but I can't seem to find a Python based answer. The closest I got was Matlab's besttree function in the Wavelet Toolbox, but I don't have a license to that toobox so I can't simply MCC-it and run in python.
import pywt
wave='db4'
wp=pywt.WaveletPacket(data,wave)
levels=pywt.dwt_max_level(len(data),pywt.Wavelet(wave))+1
At that point, I don't know if it's better to proceed along a node and trace back up to its parents, or trace along a given level.
I've been using Addison's "Illustrated Wavelet Transform Handbook" for technical reference. I'm trying to replicate the procedure shown in Figure 3.41 on page 170, or similar to the following link: https://www.researchgate.net/figure/TF-tiling-comparison-between-a-a-DWT-and-b-a-sample-WP-decomposition_fig1_4128902