PDM编码的软件实现
PDM(Pulse-density_modulation)
// Encode samples into pulse-density modulation
// using a first-order sigma-delta modulator
// C/C++ 描述
// x[s]: signal array
// y[S]: output PDM array
// qe : running error
void PDM(double x[s], double y[s], double qe = 0,) // initial running error is zero
{
for(int n = 0, n < s, ++n)
{
if(x[n] >= qe)
y[n] = 1;
else
y[n] = -1;
qe = y[n] - x[n] + qe; // calculate the error to feedback
}
}
本文介绍了一种使用一阶Σ-Δ调制器实现脉冲密度调制(PDM)的软件编码方法。通过简单的C/C++代码示例,展示了如何将输入信号转换为PDM输出。该方法适用于对音频信号进行编码。
1587

被折叠的 条评论
为什么被折叠?



