MHB Is there a more reliable way to track a pulse in real time?

Zaprime
Messages
1
Reaction score
0
Hi.

I hope someone can assist me?

I have a sensor that is being used to detect a pulse triggered from a point on the surface of a disk rotating past the sensor. I am processing the data in real time to determine if the values would count as a pulse so that I can count up the number of revolutions.

Here is a picture of some sample data. The width of the pulse can vary quite significantly, as can the offset.

View attachment 8250

My current methodology is to take a cumulative average over time. I then calculate the percentage of the sensor value relative the average to normalise the data. I look at the normalised data and check for a high state and a low state. I also look at the period that elapses between declaring a high and low state to see if this is actually a realistic pulse.

I'm sampling every 5 ms. The problem I have with this method is that it requires a lot of adjusting and isn't proving very reliable across a bigger sample size. I'm wondering if there is a better way to track a pulse in real time?

I can post a CSV file with the values if someone would like to have a more detailed look at the data. There are some gaps in the data which I'm busy trying to track down and fix.
 

Attachments

  • Graph.PNG
    Graph.PNG
    35 KB · Views: 105
Mathematics news on Phys.org
Zaprime said:
Hi.

I hope someone can assist me?

I have a sensor that is being used to detect a pulse triggered from a point on the surface of a disk rotating past the sensor. I am processing the data in real time to determine if the values would count as a pulse so that I can count up the number of revolutions.

Here is a picture of some sample data. The width of the pulse can vary quite significantly, as can the offset.
My current methodology is to take a cumulative average over time. I then calculate the percentage of the sensor value relative the average to normalise the data. I look at the normalised data and check for a high state and a low state. I also look at the period that elapses between declaring a high and low state to see if this is actually a realistic pulse.

I'm sampling every 5 ms. The problem I have with this method is that it requires a lot of adjusting and isn't proving very reliable across a bigger sample size. I'm wondering if there is a better way to track a pulse in real time?

I can post a CSV file with the values if someone would like to have a more detailed look at the data. There are some gaps in the data which I'm busy trying to track down and fix.

Hi Zaprime, welcome to MHB!

What is it that you need to adjust exactly?
And what is making it unreliable?

From your graph it seems to me that the pulses are fairly well-defined.
They have an edge-width of about 30 samples, a width of about 200-800 samples, and a height of 200 or more.

Possible improvements:
- Check the edge with a delta (like $a_{100(i+1)} - a_{100i}$), and see if it exceeds a threshold (e.g. 100).
- Use a median filter beforehand to eliminate the high frequency noise. That is, replace every sample by the median of the surrounding, say, 10 samples.
- Use a percentile instead of an average to identify the background level and the top of a pulse. For instance the 25% percentile to find the background level, and a 99% percentile to find the top of the pulse.

Note that medians and percentiles are more robust against noise and outliers than an average.

More advanced solutions, that are more computationally expensive, include:
- Use a Fourier transform to calculate the correlation to a pulse function.
- Use a Hough Transform technique.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top