vDSP.DCT展开为零

问题描述

当我执行以下代码行时:

self.forwardDCTSetup = vDSP.DCT(count: 40,transformType: vDSP.DCTTransformType.II)!

我得到:

Fatal error: Unexpectedly found nil while unwrapping an Optional value

我几乎完全遵循本教程:https://developer.apple.com/documentation/accelerate/signal_extraction_from_noise

解决方法

在长度/计数方面,vDSP.DCT遵循与vDSP_DCT_CreateSetup相同的规则:

The supported values are Length = f * 2**n,where f is 1,3,5,or 15 and n is at least 4. 

请参阅:https://developer.apple.com/documentation/accelerate/1449930-vdsp_dct_createsetup

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...