您的位置:首页 > 其它

PDM编码的软件实现

2017-09-21 17:46 337 查看

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
>= qe)
y
= 1;
else
y
= -1;
qe = y
- x
+ qe; // calculate the error to feedback
}
}


参考资料

Wikipedia-Pulse-density_modulation
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  PDM