pywt icon indicating copy to clipboard operation
pywt copied to clipboard

Omitting detail signals won't produce same result as approximate signal

Open fozba opened this issue 4 years ago • 0 comments

Hello everyone. My knowledge about wavelets is limited (I am a beginner). When I try to omit the detail signals and reconstruct the signal only with the approximate signal, I don't obtain the same signal with approximate signal. Here is the code which will provide a much better explanation of the situation:

coeffs = pywt.wavedec(pressure, 'db1', level=5)
for idx in range(2, len(coeffs)):
    coeffs[idx]= np.zeros(len(coeffs[idx]))
y = pywt.waverec(coeffs, 'db1')

After this, plotting just the approximate signal and the reconstructed signal by setting detail signals to zero:

plt.plot(coeffs[0])
plt.plot(time, y)

Yields these two plots respectively: approx omitteddetails

As you can see, reconstructed signal is not "smooth" as the approximate signal itself. Is there a way to omit the detail signals and just keep the "smooth" approximate signal? I put this question here because I believe this feature is not supposed to work like this.

fozba avatar Jul 13 '21 13:07 fozba