相关疑难解决方法(0)

峰值均衡器的IIR系数,如何将它们传递给vDSP_deq22?

我有这6个峰值均衡系数:

b0 = 1 + (? ? A)
b1 = ?2??C
b2 = 1 - (? ? A)
a0 = 1 + (? / A)
a1 = ?2 ? ?C
a2 = 1 ? (? / A)
Run Code Online (Sandbox Code Playgroud)

有了这些中间变量:

?c = 2 ? ? ? fc / fs
?S = sin(?c)
?C = cos(?c)
A = sqrt(10^(G/20))
? = ?S / (2Q)
Run Code Online (Sandbox Code Playgroud)

vDSP_deq22()应该通过"5个单精度输入,滤波器系数" 的状态记录,但我有6个系数!另外,我以什么顺序将它们传递给vDSP_deq22()

更新(17/05):我建议大家使用我在github上发布的DSP类:https://github.com/bartolsthoorn/NVDSP它可能会为你节省很多工作.

c macos signal-processing core-audio accelerate-framework

7
推荐指数
1
解决办法
1192
查看次数

手动重新实现Biquad IIR滤波器的vDSP_deq22

我正在移植一个过滤器库,该过滤器库目前使用Apple特定的(加速)vDSP功能vDSP_deq22到Android(其中Accelerate不可用).滤波器组是一组带通滤波器,每个滤波器滤波器返回其各自频带的RMS幅度.目前代码(ObjectiveC++,改编自NVDSP)如下所示:

- (float) filterContiguousData: (float *)data numFrames:(UInt32)numFrames channel:(UInt32)channel {

    // Init float to store RMS volume
    float rmsVolume = 0.0f;

    // Provide buffer for processing
    float tInputBuffer[numFrames + 2];
    float tOutputBuffer[numFrames + 2];

    // Copy the two frames we stored into the start of the inputBuffer, filling the rest with the current buffer data 
    memcpy(tInputBuffer, gInputKeepBuffer[channel], 2 * sizeof(float));
    memcpy(tOutputBuffer, gOutputKeepBuffer[channel], 2 * sizeof(float));
    memcpy(&(tInputBuffer[2]), data, numFrames * sizeof(float));

    // Do the processing
    vDSP_deq22(tInputBuffer, 1, coefficients, tOutputBuffer, 1, numFrames);
    vDSP_rmsqv(tOutputBuffer, …
Run Code Online (Sandbox Code Playgroud)

filtering signal-processing accelerate-framework

5
推荐指数
1
解决办法
589
查看次数