1
$\begingroup$

I have a signal that has both AC and DC components and both a re varying with time. How can I extract the varying DC wave from the signal?

eg: A PPG (Photopletysmography) signal extracted from a healthy patient.

$\endgroup$
3
  • $\begingroup$ An example would be nice... $\endgroup$ – jojek Sep 2 '15 at 9:50
  • $\begingroup$ I edited the question $\endgroup$ – Saad Qureshi Sep 2 '15 at 10:05
  • $\begingroup$ PPG is an interesting medical application. See the following link for signal examples, information extraction, etc: ncbi.nlm.nih.gov/pmc/articles/PMC3394104 $\endgroup$ – user14819 Sep 3 '15 at 4:59
4
$\begingroup$

DC, by definition, is the non-varying part of the signal. To find the DC component you simply average the entire signal.

How can I extract the varying DC wave from the signal?

This sounds more like you want to extract the low frequency part of the signal. The most basic filter for this is a moving average filter. However, I would recommend a smoother filter, such as a Gaussian filter. Start with $\sigma$ about 1/6 the period of the low frequency oscillations you are interested in and modify to suit.

$\endgroup$
2
$\begingroup$

You could also solve an optimization problem.
If the data is given by the vector $ y $ the following optimization problem would work:

$$ \hat{x} = \arg \min_{x} \left \{ {\left \| x - y \right \|}_{2}^{2} + \lambda {\left \| Lx \right \|}_{1} \right \} $$

Where the $ L $ matrix enforces smoothness.
For instance is could be:

$$ \hat{x} = \arg \min_{x} \left \{ {\left \| x - y \right \|}_{2}^{2} + \lambda \sum_{i = 1}^{N - 1} {\left \| {x}_{i} - {x}_{i - 1} \right \|}_{1} \right \} $$

Now, by choosing large ennough $ \lambda $ the solution enforces the derivative to be zero -> DC.

It would even work with $ {\ell}_{2} $ regularization.
Though if the model is DC jumps, the $ {\ell}_{1} $ would be a much better choice.

$\endgroup$
1
  • $\begingroup$ Why the down vote? This works like a charm for this cases. $\endgroup$ – Royi Apr 12 '16 at 18:35
1
$\begingroup$

You can try to perform FFT on the signal and extract the first sample, or zero index of the FFT array (assuming it is zero-based index array). This is a direct approach to observe DC signal in comparison to other method of curve fitting with smoothing algorithm. For example, Savitzky-Golay can smooth out high frequency and obtain the pedestal shape of the signal.

$\endgroup$

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.