All Theremins Need Mains Hum Filtering In The Signal Path
While farting around integrating the truncation filter into the CIC hum filter this morning (I don't think anything else will need it as a subroutine, and one can compute the truncation bit width using the CIC depth parameter) I wondered if I'd broken anything, so as a check I removed the hum filter from the signal path (I should note for completeness that removal of the CIC introduces 1024 / 800 = 1.28 or ~2dB of gain below, which is negligible):
Completely unacceptable spectra. And you should see the waveform view: +/-15k peak and the hum is loud as hell in my headphones. Numbers coming from the UART show at least a 4 bit degradation in the pitch operating point. With the CIC hum filter in the signal path the waveform peak is +/-500, and there is no hum whatsoever in my headphones even at full volume (with a Presonus HP4 driving them that's a lot of gain at full volume!).
I'm not sure I would be inspired enough keep going much further in this project if it weren't for the squeaky clean data and relatively spur-free noise floor the CIC hum filter provides. It's a real game changer.