I guess it might be a basic questions but here it goes anyways.

How could I extract a DC value from a sum of sinusoids, i.e.:

$$v(t) =\widetilde{v_{dc}} + \sum_{n=1}^{\infty}\sin(\omega_nt+\phi_n)$$

I tried using low pass filters in Matlab or just mean of the signal but it's not quite what I'm looking for. I'd also like to have a mathematical way of expressing this.

  • $\begingroup$ How can you have sum of sinusoids upt to infinity in MATLAB? Can you share your code with us? $\endgroup$ – learner Oct 2 '17 at 9:37
  • $\begingroup$ First apply a DC-block (a notch) then subtract the signals... $\endgroup$ – Fat32 Oct 2 '17 at 10:07
  • $\begingroup$ Can you please provide some more information about your application? I get the sense that what you are trying to do is some form of envelope detection (?). A DC is just that, the mean of a signal. At $f=0$, the trigonometric function stays at $1$, which "weighs" all signal samples equally during the summation step. This is complemented by the subsequent $\frac{1}{N}$ and that's basically an average. A constant value. Is this what you are after? If not, then what sort of time basis do you have? $\endgroup$ – A_A Oct 2 '17 at 10:19
  • $\begingroup$ @learner Well, it was gust to generalise. It's not obviously an infinite sum but I have a mix of bunch of signals and I just need to find a part of it. I could share the code but the signals come from a Simulink and I might have to go too deep into details in that case. $\endgroup$ – MarkoP Oct 2 '17 at 10:32
  • 1
    $\begingroup$ @Fat32 I was also thinking about doing something so I might try that but I might also have a signal at 1Hz here and there so I would have to gave something highly selective, right? $\endgroup$ – MarkoP Oct 2 '17 at 10:32

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.