我想将 scipy.fftpack 中的 dct 功能与 numpy float64 数组一起使用。但是,它似乎只针对 np.float32 实现。我有什么快速的解决方法可以完成这项工作吗?我很快调查了它,但我不确定所有的依赖关系。所以,在搞砸一切之前,我想我会在这里寻求提示!
到目前为止,我唯一找到的就是这个链接: http: //mail.scipy.org/pipermail/scipy-svn/2010-September/004197.html
提前致谢。
这是它引发的 ValueError:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-12-f09567c28e37> in <module>()
----> 1 scipy.fftpack.dct(c[100])
/usr/local/Cellar/python/2.7.3/lib/python2.7/site-packages/scipy/fftpack/realtransforms.pyc in dct(x, type, n, axis, norm, overwrite_x)
118 raise NotImplementedError(
119 "Orthonormalization not yet supported for DCT-I")
--> 120 return _dct(x, type, n, axis, normalize=norm, overwrite_x=overwrite_x)
121
122 def idct(x, type=2, n=None, axis=-1, norm=None, overwrite_x=0):
/usr/local/Cellar/python/2.7.3/lib/python2.7/site-packages/scipy/fftpack/realtransforms.pyc in _dct(x, type, n, axis, overwrite_x, normalize)
215 raise ValueError("Type %d not understood" % type)
216 else:
--> 217 raise ValueError("dtype %s not supported" % tmp.dtype)
218
219 if normalize:
ValueError: dtype >f8 not supported