Of interest to anybody using CVSD:
I have tried using gr-cvsd-vocoder code on a microcontroller.
The primary problem seen was related to the decoder:
// Pull off the corresponding bit input_bit = input_byte & mask; // Update the bit counter bit_count++; // Update runner with the next input bit // Runner is a shift-register; shift left, add on newest output
d_runner = (d_runner<<1) | ((unsigned int) input_bit);
where the input_bit is not always being added to the LSbit of d_runner.
//d_runner = (d_runner<<1) | ((unsigned int) input_bit);
d_runner <<= 1;
d_runner |= 1; // always add it to the LSbit
Additionally, because I was using on microcontroller, the pow() function
Since powers of 2 is needed, pow can be replaced by leftshifting 1.
Also, the d_step_decay effect was being rounded out.
The source-code is gr-cvsd-vocoder put into C language using ascii-text
files for input and output.
Separate decoder and encoder executables.
I had used a Makefile for MingGW on windows, however a linux makefile
be easily made if necessary.