Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fozba opened this issue Jul 13, 2021 · 0 comments
Open
Labels

Comments

@fozba
Copy link

fozba commented Jul 13, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants