How to find time of rising and falling edges
Show older comments
Can someone help me find the time at wich the rising and falling edge are detectected in simulink. My end gold is to calculate the pulse width, pulse repetiton interval, time of arrival, and time of delay. help would be much appreciated. I am generating the pulse signal with in my model
Answers (2)
Mathieu NOE
on 17 Nov 2023
0 votes
hello
see file attached , this is a good starting point
here we want to measure (in samples) the time difference (period) between the rising edge and falling edge of a chirp signal
the model runs a fixed time step (Fs = 10^5)

5 Comments
Paul
on 17 Nov 2023
A more general approach that doesn't rely on a fixed time step would be to use a triggered subsystem witht the Trigger Type set to "either". Inside the subsytem subtract the current value of a Clock from the previous value. As with any approach like this, care must be taken on what to compute on the first hit crossing.
Jose Montano Vazquez
on 18 Nov 2023
Paul
on 18 Nov 2023
Read the comment directly above yours.
madhan ravi
on 18 Nov 2023
+1 Paul
Jose Montano Vazquez
on 18 Nov 2023
Bharath Venkataraman
on 28 Nov 2023
0 votes
You could use the Logic Analyzer capability (or the Simulink Scope block) to view the signal and see where teh rising and falling edges happen.
Categories
Find more on Signal Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!