I was going through the example of counting complex events in matlab environment. I followed example given below;
href = ""<http://www.mathworks.se/help/daq/examples/counting-complex-events-using-analog-input-data.html?prodcode=DA&language=en</a>>
If you scroll down to see the pulse duration, there will be a section where they counted the duration of each pulse.
Find the Duration of Each Pulse
A switch bounce is represented by a very short duration pulse. To find the duration of each pulse, you need to combine the rising edge and falling edge times into a single vector. The difference of any two consecutive times shows the duration of a pulse.
pulseIndices = zeros(length(risingEdge) * 2, 1);
pulseIndices(1:2:end) = risingEdge;
pulseIndices(2:2:end) = fallingEdge;
pulseTimes = diff(time(pulseIndices))
The image shows 15 pulses, and the dataset of pulseTimes show 30. What is this number? Is it T_on and T_off values?
I wish to know the pulse duration. Am I looking at the right code?