1
$\begingroup$

Consider a segment of a time-domain signal shown in the following graph and the two marked peaks, the first one facing downwards (in red) and the second one facing upwards (in black). enter image description here

I would like to attenuate the peak facing downwards only. Unfortunately, both peaks seem to have the same frequency, so a linear filter that attenuates that frequency will attenuate both peaks. Is there a kind of a filter (perhaps a non-linear filter) that can attenuate peaks that face downward and keep peaks that faces upward (or vice-versa)?

$\endgroup$
  • $\begingroup$ "both peaks seem to have the same frequency" What frequency does a peak have? $\endgroup$ – endolith Aug 28 '17 at 21:15
  • 1
    $\begingroup$ As I said, I have only presented a small segment of the signal. I meant that these peaks both repeat at a certain frequency, which is similar. Furthermore, the shape of the peak itself has certain frequencies that are dominant, for instance , read about the QRS complex of an ECG signal that in most papers is said to be around 10-25 Hz. $\endgroup$ – D.Cohen Sep 7 '17 at 6:46
1
$\begingroup$

My immediate approach to this: try something that I'd call a running-minimum filter:

Look at a fixed amount of $N$ samples around the current sample. If the current sample is significantly below that, modify the sample to be closer to a low-pass variant of the original signal.

$\endgroup$
  • 1
    $\begingroup$ (+1) and that's a threshold based output decision nonlinear filter... $\endgroup$ – Fat32 Aug 27 '17 at 13:03
  • $\begingroup$ indeed, extremely nonlinear! I wonder whether one could "rephrase" / approximate that principle by using a continuous function of the signal (so that we can analytically derive spectral properties of this operation), but I can't think of a clever nonlinear function that would do this. $\endgroup$ – Marcus Müller Aug 27 '17 at 13:04
  • $\begingroup$ I like nonlinear and/or time-varying filters (things), eventhough they lack some mathematical tractability, they can perform magical things that you can't get even close by linear ones. That's why I call linear filers as boring... :-) $\endgroup$ – Fat32 Aug 27 '17 at 13:13
  • $\begingroup$ hehe, nice :) I wish I felt proficient enough in the design of linear filters to call them boring; to me, there's a lot of things where I am on the level of someone just applying recipes. $\endgroup$ – Marcus Müller Aug 27 '17 at 15:01
1
$\begingroup$

You're signal's peaks seem to be very sharp so as another option you can calculate derivative of your signal and peaks($ d[n] = x[n]-x[n-1]$). Set a negative threshold and wherever the derivative is less than that threshold, is most likely downward peak.

$\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.