# Interpretation of Sonar Raw Data

**URL:** <https://discuss.bluerobotics.com/t/interpretation-of-sonar-raw-data/11722>\
**Category:** Ping Sonar Devices\
**Created:** [March 11, 2022, 7:51am UTC](https://discuss.bluerobotics.com/t/interpretation-of-sonar-raw-data/11722 "2022-03-11T07:51:44Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [September 16, 2024, 6:04pm UTC](https://discuss.bluerobotics.com/t/interpretation-of-sonar-raw-data/11722/9 "2024-09-16T18:04:00Z")

</div>

Hi @Lulu 🙂

> [@Lulu](#):
>
> Is there any way of finding out what time interval elapses between each of these 200 points?

Each [`profile`](https://docs.bluerobotics.com/ping-protocol/pingmessage-ping1d/#1300-profile) message includes fields for `scan_length` [mm] and `profile_data_length` [unitless] (number of samples in the profile), and the internal speed of sound value is [user defined](https://docs.bluerobotics.com/ping-protocol/pingmessage-ping1d/#1002-set_speed_of_sound) (1,500,000 mm/s by default\[1\]), so the sampling duration (similar to camera exposure) for a given sample is just

\Delta t\_s = \frac{\text{scan\_length}}{\text{profile\_data\_length}\cdot v\_s}

> [@Lulu](#):
>
> what I’d really like to do is to be able to scale this axis as a function of time, rather than just successive points.

Is there a particular reason for this? It’s generally more intuitive to scale by distance, using the `scan_length` for scaling and the `scan_start` as an offset.

> [@Lulu](#):
>
> what do the values 0 to 250 on the y-axis correspond to? How are they set?

The “return strength measurement data” (as described by the `profile` message documentation) is an array of bytes (0-255) representing the energy/strength of the transducer vibration during each sample period.

In case it’s of interest,

> [@Raw profile data from Ping1D?](https://discuss.bluerobotics.com/t/raw-profile-data-from-ping1d/12425/10):
>
> The ADC samples the vibrations of the transducer (i.e. acoustic measurements), then there’s processing of that signal to get from “several sound wave samples” over a period of time into “one response strength measurement” representing a datapoint within the profile.

You’ll note that those values are saturated while the transducer is transmitting (at the start of the scans, including some extra time for the vibrations of the device to die down after a pulse is sent), and then low while waiting for echoes, with later values being determined by the strength of echoes (or noise in the transducer’s frequency range).

> [@Lulu](#):
>
> I’d like to take this opportunity to ask if there is a radiation pattern for Ping2D?  
> …  
> If you can give me this information, it would be a great help in my research.

We’ve done some testing around this, but the data needs some cleaning up before we can provide a beam plot, and we don’t currently have an estimate of when that will be completed/released.

By the way, our Ping2 Sonar is the second major version of a 1D sensor (which is why it uses the `ping1d` message set) - ping2D would be a multibeam or something. We have found the name to be confusing though, so we’re intending to change it (likely to Ping Sonar v2 or something) to reduce that confusion in future.

* * *

1. although you might have [adjusted it to suit your water conditions](https://github.com/bluerobotics/ping-python/issues/125), or set it to ~343,000 mm/s if you’re trying to get reasonable distance estimates in air

---

_[View the full topic](https://discuss.bluerobotics.com/t/interpretation-of-sonar-raw-data/11722)._
