wavelet compression python

121 views Asked by At

Im trying to compress a time serie with a wavelet transform , I saw it can smooth the signal but i want to get only the most important points with their position and delete the rest but i dont know once i have the wavelet coefficients how can i compress the signal and have less points

import matplotlib.pyplot as plt
plt.plot(noisy_signal)
plt.title("Noisy Signal")
coeffs = pywt.wavedec(noisy_signal, 'db2', level=2)
threshold = 0.5
coeffs_thresholded = [pywt.threshold(c, threshold, mode='soft') for c in coeffs]

# Reconstruct the signal from the thresholded coefficients
denoised_signal = pywt.waverec(coeffs_thresholded, 'db2')
plt.plot(denoised_signal) 

I get this results te two signals have the same length even if the second is smoothed enter image description here

0

There are 0 answers