I have time domain signal that varies in amplitude over time. I need to hold the value of the signal at zero when the amplitude of a peak/trough falls below a certain value.

I have time domain signal that varies in amplitude over time. I need to hold the value of the signal at zero when the amplitude of a peak/trough falls below a certain value and begin capturing again when the peak jumps up above this level. Is this possible? So far I've used the findpeaks function to locate the peaks/troughs in the signal that are below a certain amplitude value but I don't know where to go from here?
Thanks in advance!

Answers (1)

If you have the signal in vector representation, you can do this easily. For example, given:
v = [0.81, 0.91, 0.12, 0.91, 0.63, 0.09, 0.28, 0.54, 0.95, 0.96];
you could do something like
v((v<0.5)) = 0;
if your threshold was 0.5, to say anything below should be 0

This question is closed.

Products

Asked:

on 3 Mar 2016

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!