PDM编码的软件实现

来源:互联网 发布:python json 转换字典 编辑:程序博客网 时间:2024/06/06 19:32

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   }                  }

参考资料

Wikipedia-Pulse-density_modulation

原创粉丝点击