data extraction method related question

one of my dataset shows as below figure. I want to corp proper range of windows which could represent each spikes or peaks - thus pulsed signals. I want to extract a peak into a window.
Note that alarm rings when signal touches '0.5'
But signals do not show regular behaviour. I don't quite sure how I can catch both start and end point of the signal. Although I tried to use moving average to get some idea from slope, it doesn't quite acurate. for instance, slow gradient changes are not detected.
below case is easy to catch,
but this one is tricky. one spike occurs and then another one appears.
Another exmaple, as you could recognised from below figure, signals are already touches 0.5 line(alaram level). But there's no alarm event in real field - thus, this case, detector shows malfuction.
My job is find out why. Back to the begining, I need to collect all signals from every sensor dataset. I will then cluster them into proper groups.
To do this, cropping every alarm events from dataset is the first step to me. I am almost newbie handling dataset in Matlab.

2 Comments

It is not implicitly clear, what you consider as "spike" or "peak". You have to define this accurately at first with exact mathematical expressions. I cannot know what "that alarm rings when signal touches '0.5' " means.
What exactly is your Matlab related question?
Sorry, my question was not clear. what I want to find and create is the windows including bunch of signals as shown below. dataset may contain many peaks and spikes, but what I only consider is only the top peak. 0.5('A') is a criteria for creating window. for example, if bunch of signals has speak at 0.3('B'), it is not considered for my data selection.
  • I have tried to use findpeak() function. of course, it does find peaks including some errors, but I have no idea to find start and end point.
temp.JPG
if window has only one or two points pulse formed signal ans it touches '0.5', it needs to be collected into one of window.
temp2.JPG

Sign in to comment.

Answers (1)

Is this what you mean
threshold = 0.5;
aboveThreshold = signal >= threshold;
maskedSignal = signal; % Create copy/initialize
maskedSignal(~aboveThreshold) = 0; % Zero out where it's below threshold.
% Plot only those elements above the threshold
plot(maskedSignal, 'b-');
grid on;

3 Comments

Jack Ahn
Jack Ahn on 20 Dec 2018
Edited: Jack Ahn on 20 Dec 2018
Thanks for your answer.
What I need to crop is full window('B') as whon below. The window obtained hrough your answer is 'A'. all data is zero except the values in window 'A'.
To get 'B', I have tried moving average gradient changes and standard deviation changes with certain range of windows, but they don't work properly. Maybe I didn't use functions properly using detail options.
Attach your actual data with the paper clip icon so we can try some things with it.
And exactly how is the full window determined? It's not the width of the peak until it first touches zero (like at 1.18) because you're going out past that (like to 1.23).
Have you tried the findchangepts() function?
I attached some of my data.
window criteria is
  1. max signal must touch 0.5
  2. window starts from certain level(0.05) with approximately 60 points of low level signals(level might be dfferent by dataset, I use average value of data- except the signals abobe 0.5) before start point.
  3. oppsite to start point. window ends with 0.05. end point must follow with 60 points of low level signals.
캡처ddd.JPG
one of tricky signals is below.
too many noises near peak signal(above 0.5)
캡처zzz.JPG

Sign in to comment.

Products

Asked:

on 19 Dec 2018

Commented:

on 20 Dec 2018

Community Treasure Hunt

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

Start Hunting!