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

AI Thread Summary
The discussion focuses on improving the reliability of real-time pulse tracking from a sensor detecting pulses on a rotating disk. The current method involves calculating a cumulative average and normalizing data, but it requires frequent adjustments and lacks reliability with larger sample sizes. Suggestions for improvement include using a delta threshold to check pulse edges, applying a median filter to reduce noise, and utilizing percentiles for background and pulse height identification. More advanced techniques like Fourier transforms and Hough Transform methods are also proposed for better accuracy. The conversation emphasizes the need for a more robust approach to pulse detection in real-time applications.
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: 114
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.
 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...
Back
Top