Extracting a DC value from a sum of sinusoids
You can go with linear filtering as others have suggested or do something nonlinear.

The sinusoids are symmetric around zero so if the exact dc value is subtracted prior to a hard clipper like Matlab’s sign() function, the, leaky integral of the hard clipped  time series would be zero, which means that it can act as the error of a feedback loop.

This sort of thing was done a lot by circuitry in older systems to compensate for the dc offsets that occurred in A/D converters that operated in a wide temperature range.

The integrator can be a linear leaky integrator, or a counter depending on how you implement it