jvok wrote: ↑Sun Feb 12, 2023 11:09 pmI can see why that's true for a plain (hard switched 38kHz) switching coder because the fundamental of a square wave is 4/pi times the square wave ampitude, i.e. the nasty fourier equation on wikipedia
https://en.wikipedia.org/wiki/Square_wa ... r_analysis
But an oversampling coder is reconstructing a pretty accurate sine wave, not a square wave. In other words if I had an infinite number of taps on the resistor chain then the circuit would work exactly the same as a true analog multiplier. Obviously with 8 taps its not perfect but its still much closer than a switching coder. But if you have equations that prove me wrong I'd like to see them.
So I've done some analysis of this. A basic square wave (i.e. +1 / -1 switched) does produce a fundamental (i.e. at 38 kHz) which is pi/4 (1.273) times too big. There is also a third harmonic component (at 114 kHz) which is 0.33 times the size of the fundamental which needs to be filtered out meaning some pretty severe filtering requirements.
If you change this for a waveform which goes 0, 1, 0, -1, 0 ... the fundamental is now too small (0.9) and the third harmonic is still a third the size of the fundamental, so this is effectively worse.
If you change the timing of the 0, 1, 0, -1, 0 pattern so that the 1 and the -1 are on for twice as long as the 0, so the pattern is roughly 0, 1, 1, 0, -1, -1, 0... then the fundamental is still too large (1.1 roughly) but the third harmonic disappears completely! Note that you would need a clock which runs at 6 times 38 kHz to switch this correctly. The fifth harmonic (which at 190 kHz is much easier to get rid of) is 0.2 times the size of the fundamental.
If you change the sequence to 0, 0.71, 1, 0.71, 0, -0.71, -1, -0.71, 0... all with equal timing, then the fundamental is pretty close to 1 (I get 0.97) and the third and fifth harmonics both disappear. The 7th harmonic (which is even easier to get rid of being at 266 kHz) is 0.15 time the fundamental.
Based on this, therefore, I reckon that it probably isn't worth going above 8 times oversampling (i.e. 0, 0.71, 1, 0.71 etc...) as the result is pretty accurate, and the harmonics are easy to get rid of.