Dear friends ,
I want to pass an B4J array of doubles and compute wavelet decomposition using the python script and return the result to B4J.
I tried to use the example provided by default but was unsuccessful.
Any pointer in the right direction is highly appreciable.
I want to pass an B4J array of doubles and compute wavelet decomposition using the python script and return the result to B4J.
Function to compute wavelet decomposition:
import pywt
import numpy as np
def compute_wavelet_decomposition(data, wavelet_name='db1'):
Parameters:
data (list or np.array): The input signal.
wavelet_name (str): The type of wavelet to use (default is 'db1').
Returns:
data = np.array(data)
cA, cD = pywt.dwt(data, wavelet_name)
return cA.tolist(), cD.tolist()
Any pointer in the right direction is highly appreciable.