~jeffpc/fox#9: 
Wave array should use int8_t

While we need the DAC to output 0..255 with "zero" in the middle, in the firmware itself we are free to use any representation we want. To simplify some of the signal processing math, we should switch to using int8_t in the wave table and the DSP math.

Status
REPORTED
Submitter
~jeffpc
Assigned to
No-one
Submitted
2 years ago
Updated
6 months ago
Labels
No labels applied.

~jeffpc 6 months ago

The sine_wave array is only used in the get_wave function that converts the passed in phase (in 8.8 fixed point) to a sine wave value. All the complicated math is done on the phase and not the wave value. So, converting to int8_t doesn't improve the DSP math (at least for now). It does, however, push the +128 offset to get a reasonable DAC value all the way to the DAC writing code.

~jeffpc 6 months ago

I have a prototype (b5c951a410d1), but need to check that it works.

Register here or Log in to comment, or comment via email.