为了有源噪声消除的目的,我如何使用诺维卡因生成反相信号?也就是说,在NovocaineOutputBlock中,如何生成与输入相差180度的输出?
到目前为止,我的代码如下:
__weak AppDelegate * wself = self;
self.ringBuffer = new RingBuffer(32768, 2);
self.audioManager = [Novocaine audioManager];
[self.audioManager setInputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels)
{
wself.ringBuffer->AddNewInterleavedFloatData(data, numFrames, numChannels);
}];
[self.audioManager setOutputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels)
{
wself.ringBuffer->FetchInterleavedData(data, numFrames, numChannels);
for (int i=0; i < numFrames; ++i)
{
for (int iChannel = 0; iChannel < numChannels; ++iChannel)
{
// Within here do noise cancellation. How?
}
}
}];发布于 2015-01-14 02:20:36
我一直在想同样的事情。我的想法是使用这样的东西:
data[i*numChannels + iChannel] *= -1;编辑这段代码可能会被用来反转阶段(它甚至可能无法工作)。然而,考虑到iPhone本身的延迟,有源噪声消除通常比简单的相位反转更多。
https://stackoverflow.com/questions/26070963
复制相似问题