Skip to main content
. 2021 Jul 5;21(13):4602. doi: 10.3390/s21134602
Algorithm 2 Decoder of ADPCM [19].
Require:p // an ADPCM value.
Ensure: P // a unit of data to be compressed.
  w← W_INIT
  Pprev← P_INIT
  C[]←[c0,c1,...,c2M−1]
  fprev←w
  step←(w×2)/2M−1
  if p<2M−1 then
    d←step×(p×2+1)/2
  else
    d←−step×((p−2M−1)×2+1)/2
  end if
   P←Pprev+d
   fprev←fprev×C[p&((1≪M)−1)]/64
   w←fprev