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

handling level=0 in waverec/wavedec functions #108

Closed
grlee77 opened this issue Aug 10, 2015 · 1 comment
Closed

handling level=0 in waverec/wavedec functions #108

grlee77 opened this issue Aug 10, 2015 · 1 comment

Comments

@grlee77
Copy link
Contributor

grlee77 commented Aug 10, 2015

I found an inconsistency in all wavedec functions relative to their waverec counterparts. If the signal is too small for the chosen wavelet, level will be set to 0 in wavedec and a length 1 coeffs_list containing only the original data will be returned. If this is then passed in to waverec, an error will occur, because it only allows coefficient lists of length >= 2.

There are two potential solutions here:
1.) raise an error in _check_level if level = 0.
2.) modify waverecn to allow length 1 coefficient arrays and just return coeffs[0] (which is the original data) if the coeffs input was length 1.

I would lean toward solution 2, possibly adding a warning in wavedecn and waverecn if level=0.

@grlee77
Copy link
Contributor Author

grlee77 commented Mar 2, 2017

closing this as I was mistaken and the waverecn transform` does already work as expected for a zero-level transform.

This is tested indirectly in test_multilevel.py where some tests involve large wavelets such as coif17 that exceed the test signal size resulting in a zero-level transform.

@grlee77 grlee77 closed this as completed Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant