Altering Perceptions, Visualizing Sub-ground Metal Objects

Smart phones and sensor technology represent a key part of everyday life and are being used in areas such as safety, training, healthcare and others. Utilizing an array of internal sensors and a metal detector requires an evaluation of the precision of the measurements and performance reviews. Metal detectors are versatile, with uses in healthcare as well as recreational

From the tools available today we know that improvements can be made, and especially on the presentation given by the metal detector setup. The presentation is usually just numbers on a display, some simplified graphs or a sound (pitch) stating the depth and type of material reflected.
Combination of information can be used to either provide new insights not possible by partial information or make a toolset that make certain operations easier.

2-Components
The two main components of the custom setup are the metal detector and a smartphone. The smartphone is presumed attached to the metal detector in a fixed orientation. Throughout this work we consider the mount fixed along the handle of the metal detector with the screen pointing up towards the user. Additionally, the smartphone frame is considered fixed with respect to the search area plane, see Figure 1.

2-1-Metal Detector
In principle the functional parts of a metal detector consist of two coils, a search coil and a detector coil and a set of control logic. The search coil generates an electromagnetic field, and the detector receives the replicated field generated by the metallic objects, Eddy current [9]. The output from the metal detector is then transferred to the control logics which emit an audio signal indicating the type of material. The audio signal can then be recorded and used for the purpose of analysis.

2-2-Smartphone Components
The metal detector has its own control logic, and by adding an extra layer of information using built in sensors such as: For the simplest motion-based representation, the accelerometer is used to detects movement changes in x, y, and zaxis. The gyroscope is used for orientation by measuring the rate of rotation for the three-coordinate axis. The rotation vector is an attitude composite sensor reporting the orientation relative to an East-North-Up coordinate frame by integrating the underlying accelerometer, magnetometer and gyroscope readings. The microphone has its own reporting mechanism which can be invoked using the android library.

2-3-Frame Representation
The metal detector and smartphone are modeled as a digital twin, where the smartphone orientation is represented using a spatial 3-component frame following a right-hand system [10]. The phone frame is fixed, that is, the z-axis is aligned with the detector pointing upwards. The y-axis is aligned with the forward direction of the handle. The x-axis is orthogonal to the y-and z-axis, pointing towards the right.

3-Digital Twin
To calibrate the smartphone sensors, we utilize an experiment which calibrates the phone sensors with an approximated pendulum motion. The x-axis is deciding the search pattern going from side to side when sweeping the metal detector over a surface area. The commercial device is replaced by a custom prototype based on a smart phone. The metal detector is a DEUS XP Metal detector [11]. The custom mount is a Celestron NEXYZ 3-AXIS Universal Smartphone Adapter [12].

4-Results
The sound emitted from the metal detector is recorded on the smart phone and analyzed by performing frequency analysis. From this we can say something about the object or objects that are in the scope of the metal detector. The plot of a raw audio sample is shown in Figure 4.  The audio was sampled using a part of the android API called AudioRecord. AudioRecord is configured to use a 16-bit mono channel at a frequency of 12kHz. This audio data is then being processed using Fast Fourier transform (FFT). The result is a multi-resolution analysis with equally distributed bands of 256 samples.
Distributed over the whole spectrum, this gives 12000 256 = 46,875 / . We can now compute the frequency for each amplitude in the graph, seen in Figure 5. By using the mapping from sample index to frequency as we described above, the "beep" signal sound from the metal detector can be detected. Two bands are illustrated in Figure 6, showing a specific pattern emitted (left-hand side) and a signal containing noise only (right-hand side).

4-1-Visualization and Processing Algorithm
The visualization consists of a twostep algorithm, where the coloring follows a straightforward conversion from the pre-processed sound signal to a HSV (Hue, Saturation, Value) color model Where is the sample index nr between [0.512] and ℎ ∈ [0,360]. Saturation is set to a constant value 1 and the is the processed sound signal value divided on the max peak value, mapping the total value between [0.5,1].
The HSV color model produces a color representing the sound signal as shown in Figure 7. The second step of the algorithm is drawing the movement pattern on a canvas where the colors are based on the combination of a frequency band analysis and time dependent intensity accumulation as follows: The process of combining the frequency analysis with the movement pattern in the prototype application follows the evaluation scheme seen in Figure 8. The result is on the right-hand side where the sweeping motion is colored.

4-2-Mapping and Deviation
The detector sweeping motion differs depending on the search state, where the angle changes as follows:  Pinpoint sweep → [10,40] .
Accuracy between screen dimension and ground measurement is calculated using curve length (length of a complete sweep): Where θ is the sweeping angle. A test case visualizing the three states can be seen in Figure 9.  The curve length ratio from Table 1 is , , = 1396 104.7 = 13.33 / . Since the mapping is a relative correlation between the physical space and the digital twin, see Figure 10, the ratio is an error estimate describing limitations of the current setup. Figure 10. The mapping between screen drawing resolution and the physical ground size measured from the metal detector.
With other words, the obtainable accuracy is 1.3 for every 1 on the ground using the current algorithm and mapping. Illustration of a test case where the average position values are visualized is shown in Figure 11. These positions show the tendency of the metal detector movement. Next we calculate the standard deviation model as follows: Where is equal to the number of values in the total dataset, is the value of the current index and x ̅ is the average value of the total dataset.
The presented model is in this case used to estimate the deviation away from the average positions, hence, the graph in Figure 12 shows the tendencies around the average positions. Since the outward position is changing slowly based on the back and forth motion of the metal detector, it is similar to a linear development. The sweeping motion on the other hand is prone to higher values in the start, since we are in the general sweep phase. The curve is flattening out towards the area where we are pinpointing; hence, we have a higher point density.

Figure 12. This graph is plotting the standard deviation in x-direction (blue) and y-direction (red).
Since the deviation calculation is using a continuous average, calculating the deviation every time a movement is detected, we expect the x-direction to flatten out towards the centre of the motion and the y-direction to be close to linear.

4-3-Error Estimation
Precision on stability of sensor technology has been thoroughly researched in for instance [13][14][15][16]. However, the canvas is graphical approximation using position and coloring of pixels; therefor the visualization will introduce errors which are not considered in the present study. Figure 13 is illustrating the preliminary movement trajectory drawn on the canvas without any processing, i.e. smoothing and pathing.
There are limitations of the current framework, where for instance the sweeping motion is only valid when standing still and the trajectory calculated is only from the device itself.
The curve length mapping ratio was calculated (13.33 / ) and Table 1 is estimating the obtainable accuracy of the current implementation. Stability of sensor technology, implementation of motion tracking and user movement restrictions will influence the precision of the total system. When performing a sweep, such as the data shown in Figure 14, the three states have different error ratios and calculating the standard deviation shown in Figure 12, we are able to trace where the error ratio is at a maximum. The general sweep is going to have the biggest deviation, and by narrowing the sweep angle we achieve increased accuracy. The deviation is showing a higher precision (less turbulent) when the system is run longer, and we are using the pinpointing sweep state. Since the values of sweeping is higher than the back and forth motion, the y-axis deviation for back and forth motion is close to linear.

5-Conclusion
Starting the development of a prototype application and implementing a multi-sensor system using the built-in sensor in a mobile phone, such as accelerometer, gyroscope, sound (microphone) and a metal detector, requires some extensive testing where we measure the outputs of the non-calibrated sensors. This is done in order to both properly calibrate the sensors, but also to know what to expect and include in the prototype application.
Since the signal and component magnitudes can differ and the receiving signal can be weak depending on the depth to the object, a thorough analysis is required. The coloring scheme used for visualization purposes uses a signal that needs pre-processing, e.g., filtering or smoothing.
We present a custom setup using a metal detector with an off-the-shelf smartphone creating a digital twin.
We have created a tool for interactively modelling the inputs and visualize the information, and the canvas drawing is analogous to sketching indentation clues on a paper using an object beneath.

5-1-Future Comments
For future development the signal wave lengths should be analyzed and using the signal amplitude, a better accuracy pinpointing the location of an object should be obtainable.
The current implementation does not allow for the user change orientation during a sweep, and for future reference, the solution for this problem could be in generating reference points on the ground. The reference points can generate a stable ground-frame, which enables the user to rotate freely and change orientation during a recording.

6-Conflict of Interest
The author declares that there is no conflict of interests regarding the publication of this manuscript. In addition, the ethical issues, including plagiarism, informed consent, misconduct, data fabrication and/or falsification, double publication and/or submission, and redundancies have been completely observed by the authors.