How to find DC bias of periodic signal from samples that include a non-integer number of periods?
Low-pass filter with DC gain = 1 (or 0 dB).

i s'pose, if you want to be sophisticated and want a rock-solid DC that might vary very little, then the output of your LPF can go into a median filter.