I’ve looked more into the uneven left channel there, as it almost seems as if averaging only works for the right channel.
Another theory could be that one measurement would be far off, so the averaging isn’t able to smooth it out.
But, here is an example with 50 averages:
The spikes at -36dBV and -18dBV are still there!
With some debug logging enabled on a test with 3 averages, it seems to work like it should:
Left Avg Object { x: -37, y: -88.06942520329595 }
Left Array(3) [ -87.94052591359119, -87.86672254275254, -88.40102715354412 ]
Right Avg Object { x: -37, y: -90.59398073864186 }
Right Array(3) [ -90.80666210483946, -90.6269706075218, -90.34830950356437 ]
Left Avg Object { x: -36, y: -87.62263578484847 }
Left Array(3) [ -87.38337873782913, -87.47992063737277, -88.00460797934352 ]
Right Avg Object { x: -36, y: -91.35525708431193 }
Right Array(3) [ -91.49845889537026, -91.02222008278561, -91.54509227477995 ]
Left Avg Object { x: -35, y: -89.0486398479045 }
Left Array(3) [ -89.58806234716104, -88.36118728014819, -89.19666991640429 ]
Right Avg Object { x: -35, y: -92.78451906457178 }
Right Array(3) [ -92.82596543465581, -92.50493911178549, -93.02265264727404 ]
…
Left Avg Object { x: -19, y: -106.78792007020523 }
Left Array(3) [ -107.08643417960914, -106.53207577515903, -106.7452502558475 ]
Right Avg Object { x: -19, y: -108.25841335194217 }
Right Array(3) [ -108.30169760344062, -108.43563859068452, -108.03790386170135 ]
Left Avg Object { x: -18, y: -106.12511412243259 }
Left Array(3) [ -106.03637460574981, -106.22221288471206, -106.11675487683587 ]
Right Avg Object { x: -18, y: -108.92601594066468 }
Right Array(3) [ -109.30089139410013, -108.50025094770486, -108.97690548018903 ]
Left Avg Object { x: -17, y: -107.70814729384739 }
Left Array(3) [ -107.90644964817035, -107.57803366559767, -107.63995856777414 ]
Right Avg Object { x: -17, y: -109.61882139852382 }
Right Array(3) [ -109.69651387247153, -109.51514982798861, -109.64480049511131 ]