Designing a built-for-purpose peak picking algorithm in Python

submited by
Style Pass
2022-01-12 20:00:07

I was recently working on a project in which me and my research partner determined the effects of salt on the speed of sound in water. We set up to do this by placing a container of salty water in another container filled with regular water. Then we generated ultrasonic soundwaves, while listening for their echos. The time delay of such an echo is determined by the speed of sound, thus by repeatadly altering the salinity and measuring the time delay, the speed of sound in salt water is charictarised.

But in order to determine the time delay of the sound echo, we had to accurately determine the peaks in the graph of sound amplitude against time. I was tasked with doing the peak picking. At first I experimented with existing algorithms implemented by the Numpy and Scipy packages, but all algorithems came short of our expectations. Some detected peaks in the noise, and some failed to detect peaks occasionaly. I decided against spending more time tweaking the parameters of these algorithems, and instead implement my own.

The experimental setup we settled on consisted of a large tub of regular water, within which we suspended two aluminium plates. Between these two plates we compressed a balloon containing the salty water, see figure 1. The recorded signal corresponds to the sound echo's that reflect from the aluminium plates.

Leave a Comment