Need to measure time difference between two pulses

8 visualizaciones (últimos 30 días)
Deena
Deena el 20 de Nov. de 2012
I have a signal which will give out series of pulses in various time intervals. I need to measure how many pulses are occuring per second.
Measuring pulse width of the inverted signal will also solve my problem.
How to measure Pulse Width of Signal in Simulink? Is there a block available to do that?

Respuestas (1)

Sumit Tandon
Sumit Tandon el 20 de Nov. de 2012
Couple of ways to do it would be:
1. Using a Triggered Subsytem block and drive a counter with that. The key here would be choosing appropriate trigger type - rising edge, falling edge, either, etc.
2. Using a MATLAB Function block with PERSISTENT variables as counters. Check value of signal inside the block and update the counters.
  1 comentario
Deena
Deena el 26 de Nov. de 2012
The challenge here is the sample time. The timing of the "Data" is uncontrolled. They are random. So it is not possible to check number of 1s, because the duration of each pulse is random. I won't know if there is a One 1 or Two 1 in a Pulse. It will vary with the sampling rate.
Hence, the best way will be to measure the number of Transitions from 1 to 0. Correct me if I'm wrong. And Help me to achieve the above said task.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by