Coincidence detector in Matlab
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How to make coincidence detector on MATLAB In the picture, signal 5 is result of coincidence detector for signal 1 and signal 3
Signal 6 is result of coincidence detector for signal 2 and signal 4.
Thank you.

2 commentaires
Réponse acceptée
Matt Kindig
le 12 Mar 2013
Modifié(e) : Matt Kindig
le 12 Mar 2013
How about something like this? (I assume all signals are sampled synchronously).
edges1 = find(diff(Signal1) > 0); %get rising edges on Signal 1
edges3 = find(diff(Signal3) > 0); %get rising edges on Signal 3
commonEdges = intersect(edges1, edges3); %these are the indices of the coincident edges.
Note that this assumes that the rising edges are at identical locations. If there is any timing errors, this simple approach won't work.
2 commentaires
Matt Kindig
le 14 Mar 2013
Is the subplot error you've indicated here your only problem? The error is thrown because
subplot(2,1,3)
attempts to create a 2x1 grid of two subplots. However, you are attempting to call subplot 3 (which does not exist). Change your subplot call to subplot(3,1,3) and it will work.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Detection dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!