I H-bridge Class-D works I mentioned
I was getting a rather annoying amount of 60Hz hum, probably from the microphone preamplifier. I’ll have to play with it a bit tomorrow to see if I can avoid the hum pickup.
It turned out to be a fairly simple, but unexpected problem. The TLC3702 comparator chip has 2 comparators in the package, and I had not connected anything to the second comparator. Connecting the inputs to ground eliminated the hum! I think that what was happening was that 60Hz pickup on the unconnected input was causing the second comparator to swing back and forth at about 60Hz, and that this was coupled internally to the comparator I was using (probably through the shared power connections). By silencing the second comparator, I removed this source of hum.
My son also noticed a high-pitched noise that was barely audible to me. I figured that the source was probably the low-quality triangle wave from the FG085 function generator. If the period is not an exact multiple of 250ns, then the sampling of the triangle wave gradually shifts phase, and that changing phase turns into a PWM signal that is audible on the speaker. By selecting 62.5kHZ, exactly 64 clock pulses of the FG085 clock, as my PWM frequency, I avoided phase shifts and eliminated the high-pitched whine.