# Extracting a DC value from a sum of sinusoids

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.

• How can you have sum of sinusoids upt to infinity in MATLAB? Can you share your code with us? – learner Oct 2 '17 at 9:37
• First apply a DC-block (a notch) then subtract the signals... – Fat32 Oct 2 '17 at 10:07
• 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? – A_A Oct 2 '17 at 10:19
• @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. – MarkoP Oct 2 '17 at 10:32
• @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? – MarkoP Oct 2 '17 at 10:32