You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've come across this error when trying to reconstruct data from the coefficients given by dwt2 in a project to port some matlab code to python. An example of the data and code that I'm using is given below.
`---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
----> 1 pywt.upcoef('a', ca, 'db1')
/usr/local/lib/python3.4/dist-packages/pywt/_dwt.py in upcoef(part, coeffs, wavelet, level, take)
341 if part not in 'ad':
342 raise ValueError("Argument 1 must be 'a' or 'd', not '%s'." % part)
--> 343 return np.asarray(_upcoef(part == 'a', coeffs, wavelet, level, take))
/usr/local/lib/python3.4/dist-packages/pywt/_extensions/_dwt.cpython-34m.so in pywt._extensions._dwt.__pyx_fused_cpdef (pywt/_extensions/_dwt.c:7860)()
TypeError: No matching signature found`
However, using idwt2 works and gives approximately the same answers compared to the matlab code that uses the native upcoef2 function.
coeffs = (ca, (None, None, None))
reconstructed = pywt.idwt2(coeffs, 'db1')
I think that this kind of TypeError is usually raised when there is a conflict between type definitions, but everything is of type numpy.ndarray and dtype float64.
The text was updated successfully, but these errors were encountered:
I've come across this error when trying to reconstruct data from the coefficients given by dwt2 in a project to port some matlab code to python. An example of the data and code that I'm using is given below.
data = np.array([[ 1.47728539, 1.59481049, 1.59481049, 1.46021461, 1.44889259], [ 1.48014069, 1.48872185, 1.67795181, 1.38459396, 1.32822609], [ 1.41849327, 1.57595444, 1.50884819, 1.44937897, 1.57595444], [ 1.46079826, 1.53956032, 1.54245186, 1.53089523, 1.49732971], [ 1.49732971, 1.4323349 , 1.44937897, 1.49158859, 1.48872185]])
ca, (_, _, _) = pywt.dwt2(data, 'db1')
reconstructed = pywt.upcoef('a', ca, 'db1')
`---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
----> 1 pywt.upcoef('a', ca, 'db1')
/usr/local/lib/python3.4/dist-packages/pywt/_dwt.py in upcoef(part, coeffs, wavelet, level, take)
341 if part not in 'ad':
342 raise ValueError("Argument 1 must be 'a' or 'd', not '%s'." % part)
--> 343 return np.asarray(_upcoef(part == 'a', coeffs, wavelet, level, take))
/usr/local/lib/python3.4/dist-packages/pywt/_extensions/_dwt.cpython-34m.so in pywt._extensions._dwt.__pyx_fused_cpdef (pywt/_extensions/_dwt.c:7860)()
TypeError: No matching signature found`
However, using idwt2 works and gives approximately the same answers compared to the matlab code that uses the native upcoef2 function.
coeffs = (ca, (None, None, None))
reconstructed = pywt.idwt2(coeffs, 'db1')
I think that this kind of TypeError is usually raised when there is a conflict between type definitions, but everything is of type numpy.ndarray and dtype float64.
The text was updated successfully, but these errors were encountered: