This is the sort of performance (but with more smoothing) we could expect from a good AC
voltmeter
Smoothing narrows the bandwidth in which we receive
noise
But noise in this bandwidth is captured regardless of
its phase
A better filter would eliminate
both noise "out of band" and noise "out of phase" with the
modulation
The trick is to replace the full-wave rectifier Abs[] with a
synchronous rectifier SyncRec[]:
Abs[] -> if signal >0 then +signal else
-signal
SyncRec[] -> if modulation >0 then +signal else
-signal (synchronous
Quick-and-dirty implementation is multiplication by
If[Cos[40. p t]>0.,1.,-1.]
The modulation in this case
chops the signal rather than smoothly shaping it with a sinusoid
both work fine, though there are application-dependent pros and
cons because of some subtle differences