**1. Introduction**

We develop innovative road signs that can autonomously determine and communicate (visually and over V2X, vehicle-to-everything radio messaging) the speed limit in cases where the traffic situation requires it in connection with the project that was carried out in our department. The project entitled "Intelligent Road Signs with V2X Interface for Adaptive Traffic Controlling" is carried out in response to the demand for improving road safety and traffic efficiency. The developed system of autonomous road signs will enable the prevention of the most common collisions on highways, resulting from the rapid stacking of vehicles that results most often from accidental heavy braking [1]. Figure 1 shows an example of a dangerous road situation, together with a system of autonomous road signs that display and wirelessly transmit (in the V2X standard) decreasing permissible speed as drivers approach the place with traffic obstruction.

The new design demands for solving various research and construction problems, such as effective and independent of weather conditions traffic monitoring based on simultaneous analysis of several types of data representation [2]. The engineering part of the project, as well as previous research results on this topic, as described in our earlier papers [3,4], were preceded by a series of experimental studies. Their results showed that measuring speed and traffic density causes a number of problems in practical conditions. For example, the use of visual analysis for this purpose encounters limitations that are associated with restrictions on the visibility of vehicles in both RGB and thermal cameras. The currently popular lidars also have some limitations and they are also relatively expensive. In this case, an estimation of the traffic exploits optical opacity of cars and laser beam reflections as the physical principle of working is often accompanied by advanced data processing [5]. Setting the sensor

perpendicular to the axis of the road makes it impossible to count vehicles in the case of occlusion (vehicles present on both lanes simultaneously), which causes many missed detections. Inductive loops or pneumatic cables for counting vehicles are used as a source of reliable data. However, their use requires installation in the road pavement, which is cumbersome and is only suitable for permanent installations, rather than for temporary installation of road signs in hazardous locations.

**Figure 1.** Illustration of the principle of limiting the speed when approaching a dangerous place on the road using autonomous road signs connected wirelessly to each other. Road signs communicate speed in a traditional way and also via radio channels using the V2X standard.

Another approach is based on recording anonymous Bluetooth MAC addresses of devices together with a timestamp as they pass by each detector, and then perform matching the addresses as vehicles pass through the next detector [6]. Specialized hardware was developed for related research (not covered in this paper), namely a radio module with software implementing the baseband controller and the firmware link manager layers. We constructed a practical vehicle counter in this way and then performed field tests showing that this technology makes a promising method of collecting real-time statistical traffic data and actual journey times from measurements on long distances, e.g., 1 km, which is not possible or difficult with other modalities [4]. However, counting vehicles that are based on the MAC addresses of Bluetooth devices can be unreliable, because these addresses are associated with both vehicles and mobile phones that are used by pedestrians. There can be several Bluetooth devices in one vehicle, e.g., audio and communication devices, as well as radio modules that are embedded in-vehicle diagnostic systems. Gupta et al. presented a different and interesting idea. They proposed the system for vehicles (i.e., bicycles, cars, trucks) counting by means of variations in the Wi-Fi signals strength [7]. Another approach that was related to the monitoring of traffic flow exploited the magnetic sensors to measure the vehicle's magnetic signature (VMS) evoked by moving vehicles [8].

Still, measurements of traffic intensity and vehicle speed while using Doppler microwave sensors find technical and economic justification. For example, a system that is based on high range resolution based on microwave radar sensor has been previously proposed by other authors to estimate the traffic flow rate and the flow rate of certain types of the vehicle [9,10]. However, microwave sensors are exposed to interference due to noise in the radio channels and reaching the receiver by parasitic reflections and microwave interferences. For this reason, we worked on this issue and presented an experimentally verified approach in this paper that allows for improving the results that were obtained while using a microwave radar.

Acoustic methods of road traffic estimation are, in practice, quite rarely used, although experimental research in this field is being conducted [11–13]. Our department has also been conducting such research for some time, which resulted in publications [14,15] and a recently defended doctoral dissertation [16].

A method is presented and experimentally studied for counting vehicles and determining their movement direction by means of the acoustic vector sensor application and the enhanced Doppler microwave sensor. The assumptions of the method employing spatial distribution of sound intensity determined with the help of an integrated three-dimensional (3D) intensity probe are discussed. The developed intensity probe was used for the experiments that brought the results discussed in the paper.

#### **2. Materials and Methods**

#### *2.1. Vehicle Counting and Speed Measurement with Doppler Sensor*

#### 2.1.1. Doppler Sensor

The sensor that was used in the presented research emits a continuous wave with constant frequency within the K band (24.125 GHz) and it provides a dual-channel (I/Q) signal with frequencies below ca. 8 kHz, being proportional to the object's velocity, according to the Doppler effect. The sensor is characterized by a wide horizontal beam, which allows for capturing a vehicle's movement within a sufficiently long road segment (at least 50 m). This is different from the majority of radar sensors used in practical measurement systems, which measure the vehicle speed within a narrow zone.

The sensor transmits an electromagnetic wave with a constant frequency *f* 0. The frequency *fr* of waves reflected from moving objects and received by the sensor differs from *f* 0, according to the Doppler effect [17,18]. An I/Q mixer produces a difference signal with frequency *fd*, in two channels: in-phase (I) and quadrature (Q), which allows for the detection of the object's direction of movement (phase difference between I-Q channels is either 90◦ or −90◦). The frequency *fd* is related to the object's velocity *vr* by an equation:

$$f\_d = \left| f\_r - f\_0 \right| = \frac{2}{\lambda} v\_r = \frac{2f\_0}{c} v\_r = Sv\_{r\prime} \tag{1}$$

where *c* is the speed of light. For a K-band sensor, *f* <sup>0</sup> = 24.125 GHz, and the scaling factor *S* ≈ 160.94 (*vr* in m/s). *fd* ≤ 8.94 kHz for road vehicles moving with speed up to 200 km/h (55.5 m/s). Therefore, the difference signal fits in the audio band (it is indeed audible), so standard audio signal processing algorithms may be applied for vehicle detection and speed measurement.

For practical reasons, it is not possible to directly mount the sensor on the vehicle's path of movement, therefore the sensor is usually placed alongside the road (Figure 2). As a result, the sensor only measures the radial component *vr* of the velocity vector. As a vehicle moves through the detection zone of a sensor, *vr* decreases when the vehicle approaches the sensor, and then increases as it moves away. This is called a 'cosine effect' [19], as the actual velocity is multiplied by a cosine of the angle to the object (Figure 2). Additionally, the angle difference between the front and the rear of the vehicle becomes larger as the vehicle moves closer to the sensor, which results in *vr* values spanning a wider range. Figure 3 illustrates this, showing a spectrogram of a signal reflected from a road vehicle and recorded by a Doppler sensor. Signal frequency spans a range (*f* min, *f* max), given by:

$$f\_{\rm min} = Sv \cos \alpha\_{\rm max} = Sv \frac{r}{\sqrt{r^2 + y^2}} \tag{2}$$

$$f\_{\text{max}} = Sv \cos \alpha\_{\text{min}} = Sv \frac{r+d}{\sqrt{(r+d)^2 + y^2}} \tag{3}$$

where Figure 2 explains *r*, *d*, *y*, and α.

**Figure 2.** Measurement of the radial velocity of a vehicle with a Doppler sensor.

**Figure 3.** Spectrogram of a Doppler sensor signal recorded when a single vehicle was moving towards the sensor. The cosine effect is visible in the final phase (time 2.5–4.5 s).

Compensation of the cosine effect is problematic. Therefore, frequency is usually taken from the signal part captured at a large distance between the sensor and the object for speed measurement, so that the angle α is small (cos α close to 1), the difference between αmin and αmax is also small, and therefore the cosine effect is negligible. This approach was used in the proposed algorithm.

#### 2.1.2. Algorithm for Processing of Doppler Sensor Signals

The task of the algorithm is to perform vehicle detection and tracking, as well as vehicle speed measurement, in a signal that was acquired with a continuous wave Doppler sensor. Figure 4 shows an overview of the processing algorithm. A dual-channel signal is received from an I/Q Doppler sensor. The first stage is the signal preprocessing, which suppresses noise and interference in the signal and then decomposes the signal into two components that represent opposite directions of movement. In the next stages, signal components that are reflected by moving vehicles are detected, and tracking of individual vehicles is performed. Finally, a velocity estimate is calculated from each identified vehicle track. The details of the algorithm are presented in the following Subsections.

**Figure 4.** Block diagram of the Doppler sensor and the processing algorithm.

#### 2.1.3. Suppression of Interference and Noise

The signals obtained from a Doppler sensor are often contaminated with distortions that make the detection and tracking processes more troublesome (Figure 5a). There are two main types of distortions that are observed in Doppler sensors. Noise is present in the signal as wide-band spectral components with random amplitude and phase, as a result of sensor imperfections, the nature of wave reflection, and environmental factors, such as wind. Electromagnetic interference (EMI) usually manifests as narrowband spectral components with a constant frequency. They may be induced by air (e.g., from nearby radio frequency transmitters, such as mobile network stations or airport radars) and by power lines. The amount of signal distortion depends on the sensor class, its positioning, and orientation, the quality of power supply, etc. As a result, a procedure for the suppression of distortions is necessary before the detection and tracking are performed.

**Figure 5.** Spectrograms of road traffic signals: (**a**) signal recorded by the Doppler sensor, with electromagnetic interference (EMI) at multiplies of 1 kHz, and a wideband noise, (**b**) processed signal—suppression of noise, interference, and signals reflected from vehicles moving away from the sensor.

Noise reduction is usually performed by computing a noise profile and subtracting it from the signal. Such an approach requires the detection of signal parts containing only noise and constantly updating the profile. It is also not efficient for EMI removal. Therefore, a novel approach, which is

based on the phase relationship between I/Q channels, is proposed. An additional benefit of this algorithm is the separation of the opposite directions of movement [20]. The algorithm is based on the phase difference Δφ between the I/Q channels of the sensor signal:

$$
\Delta\phi = \arg Q(\omega) - \arg I(\omega) \tag{4}
$$

where *Q* and *I* are the spectra of the respective signal channels.

In theory, Δφ should be equal to ±90◦ for signals that are reflected from moving objects. In practice, Δφ varies within a range, depending on the sensor class. The following observations were made from the analysis of phase in I/Q sensor signals [20]:


Therefore, the algorithm for suppression of noise and EMI is based on the concept of a 'phase filter', as illustrated in Figure 6. The signal spectrum is multiplied by a weighting function *w* given by:

$$w(\omega) = \frac{1}{1 + e^{-\gamma(u(\omega) - 0.5)}}\tag{5}$$

where *u* is given by:

$$\mu(\omega) = 1 - \left| \max\left(\frac{\Delta\phi(\omega)}{90}, 0\right) - 1 \right| \tag{6}$$

for objects moving towards the sensor ('oncoming'), and

$$\mu(\omega) = 1 - \left| \max\left(\frac{-\Delta\phi(\omega)}{90}, 0\right) - 1 \right| \tag{7}$$

for objects moving away from the sensor ('outgoing'), where Δφ is expressed in degrees [20]. The γ parameter controls the shape of the weighting function. As shown in Figure 6, part of the signal energy is lost if *u* is used as the weighting function (the 'no γ' case), and the overlap with the noise distribution is larger than in the case of additional shaping of the function. In the experiments, the authors found that γ = 20 is optimal, providing a proper balance between signal preservation and the suppression of distortions.

Figure 5b shows the example results of the preprocessing while using the proposed algorithm. As can be seen, EMI that occurred at multiplies of 1 kHz (most prominent at 4 kHz) is almost completely removed and wideband noise is significantly suppressed. The remaining speckle-noise results from the partial overlapping of signal and noise distributions, and from 'reflected' signals, captured when a vehicle has already passed the sensor. Such remaining noise components are discarded with amplitude thresholding in the later stage of processing. As can be seen, two opposite directions of the movement were separated, so that they may be individually analyzed. The detection and tracking phases are now significantly easier to perform due to the removal of occlusion by objects that are moving in opposite directions.

**Figure 6.** Polar plot illustrating the concept of phase filtering. Filled areas show distributions of signal and noise (σ = 30◦), dashed lines show the shape of the weighting functions. The outer axis is scaled in the phase difference between I/Q channels (in degrees), the radial axis shows relative amplitude or gain.

#### 2.1.4. Vehicle Detection, Tracking, and Velocity Estimation

The automatic measurement of the velocity of vehicles in road traffic, being performed by an unsupervised algorithm, requires performing three stages. First, the detection of spectral components that represent moving vehicles is performed in the preprocessed signal, in blocks of signal samples (short term analysis). In the second stage, the detection results have to be assigned to vehicles, so that changes in the signal frequency (caused by the object movement and the cosine effect) are tracked. The preprocessing algorithm that is presented in the previous Subsection, by decreasing the level of noise and interference, allows for easier vehicle detection, and eliminating occlusion from vehicles moving in the opposite direction allows for easier tracking. Occlusion from vehicles moving in the same direction still occurs and it is the main problem in the tracking. In the final stage of the analysis, the estimated velocity is extracted from each vehicle track. It should be noted that the velocity measurement with an automatic algorithm is much more problematic than where a human operator is able to relate the measurements to the observed vehicles.

The detection algorithm works on signal spectra that were computed in short windows (e.g., 2048 samples, 42.6 ms for 48 kHz sampling), after multiplication by the weighting function, as described earlier. The detection works by finding sequences of spectral bins with an amplitude above a threshold (that should be set according to the signal level and the remaining noise level). The threshold should be sufficiently low in order to detect weak signals when a vehicle is far from the sensor. Groups of spectral bins containing the reflected signal become larger when a vehicle approaches the sensor (Figure 3). In practice, gaps occur in such groups (due to weaker signal components at some frequencies), and such gaps result in the segmentation of signal parts. These fragments have to be merged in the detection phase. It is also inevitable that some strong noise components are incorrectly detected as signals.

The tracking algorithm merges the detection results from consecutive time windows. Each stored track is extrapolated to find the expected frequency in the current window. Linear interpolation is used in the initial phase and cubic interpolation in the later stage for objects approaching the sensor. Next, the detected groups of spectral bins are searched for the one closest to the expected value. If such a group is found, this group is appended to the track, its centroid frequency is computed, and the lowest and the highest frequency is stored in the track. The track is not updated when no matching group is found. Additionally, dead tracks are removed from the analysis, and finished tracks (i.e., with a

sufficient length, and with a minimum frequency below a threshold of ca. 500 Hz, below which the vehicle is very close to the sensor) are passed to the velocity estimation phase.

The velocity of a vehicle should be measured within an initial ('thin' and flat) section of a track. Therefore, a finished track is analyzed in short sections. Frequency computed in each window is converted to velocity, and then the mean and the standard deviation are computed for each section. The algorithm selects a section with the highest mean, provided that the standard deviation is below the threshold. The latter condition allows for the elimination of tracking errors (track following a group of noise components) from velocity estimation. The computed standard deviation is used as a representation of the 'quality' of the result. If the value is obtained from an initial, flat section of a track, and the standard deviation is low (<0.1 km/h). The value is obtained from the later track part (with decreasing frequency), which will be reflected by the higher standard deviation, if there is no flat segment, e.g., due to occlusion by another vehicle ahead. The results with a high standard deviation (>1.0 km/h) should be discarded.

Figure 7 shows an example of a successful analysis in a signal recorded during the experiments. Only vehicles moving on the lane closer to the sensor (the oncoming traffic) were analyzed. The results of the detection stage are shown as gray points. Some of the detected components are assigned to the tracks of individual vehicles, color dots mark the computed centroids of the detected spectral bin groups, thus forming continuous tracks. The obtained velocity estimates are also shown in the plot. All of the estimates had a standard deviation not exceeding 0.25 km/h.

**Figure 7.** Example of vehicle detection and velocity measurement with the proposed algorithm. Gray points indicate the detection results, color dots mark the detection results assigned to the tracks of individual vehicles (distinguished by a color), values show the obtained velocity estimates (km/h).

#### *2.2. Vehicle Counting and Speed Measurement with Acoustic Vector Sensor*
