Edge operator shows both rising and falling edge
Mostrar comentarios más antiguos
Im trying to detect the rising edge of a datastream. My code looks as follows:
data = importdata('myfile');
Trigger = data.data(:,1)
L = logical(Trigger)
which results in the following figure.

As I only want the rising edge the edge() operator from the image processing package should give me just that.
but for some reason it ends up like this:
M = edge(L);

what am i doing wrong?
thanks
Respuestas (2)
Shubham Rawat
el 1 de Feb. de 2021
0 votos
Hi Max,
Edge functionality is used to detect edges(boundaries) in an image. You may look into the documentation here:
To detect rising or falling edge in data:
You may use this: Rising or falling edges of EdgeCount signals - MATLAB (mathworks.com)
Hope this Helps!
Image Analyst
el 1 de Feb. de 2021
Try this trick of using strfind():
risingEdgeIndexes = strfind(L, [0, 1]) + 1;
Categorías
Más información sobre Object Analysis en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!