Yi Han
email: yi.han@ucdconnect.ie

Damien Magoni
email: magoni@labri.fr

Patrick Mcdonagh
email: patrick.mcdonagh@dcu.ie

Liam Murphy
email: liam.murphy@ucd.ie

Determination of Bit-Rate Adaptation Thresholds for the Opus Codec for VoIP Services

In this paper, we present an experimental evaluation of the recently standardized Opus codec used in a VoIP context. Opus operates in both narrow and wideband modes, similar to Adaptive Multi-Rate (AMR). Through the use of the Wideband Perceptual Evaluation of Speech Quality (WB-PESQ) metric, we have conducted an extensive set of experiments using multiple audio samples encoded at different bit-rates, to investigate the impact of packet loss on resulting speech quality. Using these results, fitting functions for each bit-rate were computed to provide a straightforward manner of evaluating speech quality when given a specified packet loss rate. Using ns-2, a simulation analysis was conducted to evaluate the effect of background traffic on transmitted Opus streams. We observed that, when using different levels of background traffic, the observed packet loss rates varied heavily depending on the stream bit-rate. By correlating this information with the fitting functions derived previously, we were able to define switching thresholds. These are points where the speech quality of a lower bit-rate stream is greater than that of a higher bit-rate stream for the same levels of link bandwidth saturation.

I. INTRODUCTION

In VoIP systems the codec heavily influences the resulting speech quality. This is because it specifies components such as compression algorithms and encoding modes, allowable bit-rates, frame sizing, etc. Narrowband codecs operate on frequencies between 300 Hz and 3.4 kHz, while wideband codecs operate on a larger range of frequencies resulting in higher call quality.

Multiple wideband codecs have been released in an effort

to improve the quality of encoded speech. Examples of these include G.722 [START_REF] Murphy | 7 kHz audio-coding within 64 kbit/s -technical specification[END_REF], AMR-WB [START_REF] Bessette | The adaptive multirate wideband speech codec (amr-wb)[END_REF] and G.722.1 [START_REF]Low-complexity coding at 24 and 32 kbit/s for hands-free operation in systems with low frame loss[END_REF]. The Opus codec [START_REF] Valin | Definition of the Opus Audio Codec[END_REF], standardized in September 2012, is designed to be an open codec, supporting many audio applications. Opus is comprised of a modified SILK codec [START_REF] Vos | SILK Speech Codec[END_REF] and the CELT codec [START_REF] Valin | A highquality speech and audio codec with less than 10-ms delay[END_REF] [START_REF] Valin | A full-bandwidth audio codec with low complexity and very low delay[END_REF]. Opus supports bit-rates from 6 kbps up to 510 kbps, with sampling rates from 8 kHz to 48 kHz, as detailed in [START_REF] Valin | Definition of the Opus Audio Codec[END_REF], making it applicable for many usage scenarios. While limited research has been conducted using the Opus codec, it has been shown to be comparable and in some cases, it provides a better quality than many popular codecs for similar bit-rates [START_REF]Opus interactive audio codec[END_REF]. Opus also allows for the use of a variety of frame sizes, from 2.5ms up to 60ms [START_REF] Valin | Definition of the Opus Audio Codec[END_REF]. Using larger frame sizes reduces the number of packets transmitted per second, making more efficient use of bandwidth by minimizing the overhead of protocol (MAC/IP/UDP/RTP) headers. However, this increases latency, as audio frames have an increased length for encoding and sensitivity to packet loss, as more audio data is contained per packet. Similarly to most codecs used for VoIP, a frame size of 20 ms is used throughout this paper.

An extensive set of experiments were conducted using the Opus codec in order to investigate the performance of different bit-rates under varying packet loss rates. The ITU-T standard wideband codec measurement tool WB-PESQ [START_REF]Wideband Extension to Recommendation P. 862 for the Assessment of Wideband Telephone Networks and Speech Codecs. ITU-Telecommunication Standardization Sector[END_REF] was used to provide a Mean Opinion Score (MOS) for call quality for each test case. These were conducted using multiple audio samples and were run to a 99% confidence level with a 1% error (Section III-B). The reason for doing this was to allow us to derive a fitting function for each bit-rate which indicates the expected call quality as the packet loss rate increases, without requiring real-time WB-PESQ analysis (Section III-C). Thus, this provides a more straightforward method of assessing call quality for the Opus codec. Comparing packet loss with delay and jitter, our experiment indicated that, in a low delay and jitter scenario, with limited small buffer size, the call quality degradation, in terms of MOS, resulting from delay is limited to lower than 4%, while packet loss is the dominant factor in quality degradation. Furthermore, a network simulation was carried out using ns-2 to investigate the impact of increasing background traffic on a bandwidth-constrained network. The network environment with continuously increasing background traffic was simulated and the packet loss of an Opus VoIP call was monitored. Here, we only focus on the effect of packet loss for each bit-rate. From these experiments, it can be observed that different bit-rates experience varying levels of packet loss for a given level of congestion. We then combine these simulation results with the fitting functions from the PESQ analysis in order to find the relation between bit-rate, packet loss rate, and call quality. Furthermore, our results show that having a mapping from packet loss to call quality between different bitrates allows for the determination of points where adapting the bit-rate results in a better call quality (Section IV-B).

II. RELATED WORK

As network conditions can vary widely, particularly in wireless scenarios, the quality of VoIP services can be improved by adapting the bit-rate accordingly. This can be achieved through the use of an adaptive codec such as AMR or Opus. With Opus' support for real-time adaptation of bit-rates, other, lower quality codecs are not required when adapting the bit-rate, thus noticeable silent gaps in the audio can be avoided [START_REF] Assem | A Generic Algorithm for Mid-call Audio Codec Switching[END_REF]. Results comparing the quality and latency of Opus to other codecs are presented on the Opus website [START_REF]Opus interactive audio codec[END_REF]. They show that the Opus codec MOS values outperform the other codecs for bit-rates higher than 16 kbps, and that they are similar to AMR and better than both iLBC and Speex for bit-rates between 16 kbps and 8 kbps. Several Opus listening tests [START_REF]Opus interactive audio codec[END_REF] were undertaken by different groups and it was shown that for 11 kbps, 15 kbps and 20 kbps bit-rates, Opus achieved higher values for MOS than Speex (narrowband), iLBC, and Speex (wideband) respectively. In addition, the results also indicate that the encoding delay of Opus is lower than the ones of other popular codecs for bit-rates up to 80 kbps.

The authors of [START_REF] Rämö | Voice Quality Characterization of IETF Opus Codec[END_REF] investigate the quality of the 3 modes of the Opus codec: LP mode (SILK based), hybrid mode and MDCT mode (CELT based). According to their results, the LP mode of the Opus codec yields a moderate voice quality, comparable to AMR and AMR-WB for similar bitrates. When using the hybrid mode, at 20kbps Opus achieves similar quality to the LP mode, while at 24kbps, it produces higher quality than G.722.1C [START_REF]Low-complexity coding at 24 and 32 kbit/s for hands-free operation in systems with low frame loss[END_REF]. They also demonstrated that the MDCT mode does not produce as high a quality as the hybrid mode, when used for voice applications. The authors of [START_REF] Orosz | Performance Analysis of the Opus Codec in VoIP Environment Using QoE Evaluation[END_REF] investigate the performance of Opus for VoIP, however their analysis used only a single bit-rate configuration.

The WB-PESQ standard [START_REF]Wideband Extension to Recommendation P. 862 for the Assessment of Wideband Telephone Networks and Speech Codecs. ITU-Telecommunication Standardization Sector[END_REF] is an extension of the PESQ standard [START_REF]Perceptual evaluation of speech quality (PESQ): An objective method for end-to-end speech quality assessment of narrow-band telephone networks and speech codecs[END_REF]. This wideband extension predicts the subjective score that would be attributed for a wideband speech sample by a panel of listeners. The POLQA metric was not used as the toolkit was not directly available. However, a direct comparison between the MOS results of WB-PESQ and PESQ is not possible due to their different target applications and the fact that they are based on a subjective scale. According to the authors of the WB-PESQ standard [START_REF]Wideband Extension to Recommendation P. 862 for the Assessment of Wideband Telephone Networks and Speech Codecs. ITU-Telecommunication Standardization Sector[END_REF], the MOS results for a given speech quality level can be impacted by the language used. Japanese and Korean languages [START_REF] Takahashi | Objective Assessment Methodology for Estimating Conversational Quality in VoIP[END_REF] are known to yield higher MOS values when subjected to the same amount of signal distortion. In this paper, we thus only study American English samples, leaving the study of other languages for future work.

The survey described in [START_REF] Carvalho | Survey on application-layer mechanisms for speech quality adaptation in VoIP[END_REF] investigates application layer mechanisms for speech quality adaptation in VoIP, including bit-rate control, Forward Error Correction (FEC) control, playout scheduling adaptation, etc. Moller et al. have shown in [START_REF] Moller | Speech Quality While Roaming in Next Generation Networks[END_REF] that switching from one codec to another can improve the speech quality, if the former codec was suffering a high packet loss rate and if the latter codec significantly reduces the packet loss impact on the speech quality. Furthermore, in [START_REF] Chakraborty | Active queue management with adaptive codec bit rate variation in WLAN for efficient VoIP performance[END_REF], the authors note that decreasing the transmission rate by increasing packet size is not an effective method of ensuring voice quality, possibly due to the fact that more voice data is lost when a packet is lost. To combat this, the authors proposed a similar switching method to [START_REF] Moller | Speech Quality While Roaming in Next Generation Networks[END_REF]. However, in both of these papers, handover was investigated between two different codecs rather than one supporting real-time self-adaptation of its bit-rate. In this paper, we focus on the same idea applied to the Opus codec only, as it is able to provide a dynamically adaptable bit-rate.

III. OPUS PACKET LOSS PERFORMANCE ANALYSIS

Assuming all other encoding parameters are maintained at the same value, a higher bit-rate results in better quality. When using a frame size of 20 ms, suggested bit-rate ranges for different applications are provided in [START_REF] Valin | Definition of the Opus Audio Codec[END_REF]. In this paper, we investigate Opus with 20 ms frame size, which is the most common frame size with other popular codecs. In this way, the results in this paper can be compared to those from other codecs.

As existing wideband codecs such as AMR-WB support bit-rates up to 20 or 24 (limited use) kbps and 20 kbps is the highest bit-rate supported in Opus LP mode, 3 bit-rates from 8 to 20 kbps were chosen to be the focus for our experimental evaluation. Additionally, through our experiments, it was found that PESQ-WB gives more accurate results when all the test samples are in one single mode of the Opus codec. Inconsistent results were observed in our experimental evaluation when analyzing two samples that are encoded by two different modes, i.e. LP and Hybrid mode.

A. Experimental Setup

The aim of this experiment was to investigate Opus performance, under varying packet loss rates. The Opus development package (opus-tools v0.1.8 and libopus v1.1-rc3) from [START_REF]Opus interactive audio codec[END_REF] was used for encoding and decoding voice samples using suggested samples from the ITU [START_REF]Methodology for the derivation of equipment impairment factors from instrumental models[END_REF], along with a voice sample from the Opus website [START_REF]Opus interactive audio codec[END_REF]. The sample from [START_REF]Opus interactive audio codec[END_REF], (referred to as 'original') is uncompressed speech, consisting of a continuous speech by 2 males and 2 females, each for one sentence for a total duration of 10 seconds. The 4 samples selected from [START_REF]Methodology for the derivation of equipment impairment factors from instrumental models[END_REF] are uncompressed speech in American English from 2 males and 2 females separately. Each clip is approximately 8 seconds long, each has two sentences separated by a 2 second period of silence. These are referred to as Male 1 & 2 and Female 1 & 2. This matches the recommended test sample duration of 8 to 12 seconds, with 2 to 4 sentences separated by silence periods [START_REF]Wideband Extension to Recommendation P. 862 for the Assessment of Wideband Telephone Networks and Speech Codecs. ITU-Telecommunication Standardization Sector[END_REF]. All the samples had a 16 kHz sample rate and 16 bits per sample. The samples were encoded at 20 kbps, 14 kbps and 8 kbps from their original audio sample, using the OPUS APPLICATION VOIP flag. Furthermore, to study the effect of transcoding (in which an intermediary node re-encodes the audio at a lower bit-rate), we also tested samples that were transcoded from 20 kbps encoding to 14 kbps and 8 kbps, and also from the 14 kbps encoding to 8 kbps. In a two person call, it would be likely that the source will adapt the bit-rate should this be necessary. However, in a multi-party call, the link qualities of participants may vary. Therefore, some callers may be able to support the high quality audio, while others can only support the medium or low quality audio. The use of transcoding enables this to be achieved without sacrificing the call quality for all participants. Thus, for the sake of completeness, we included this scenario in our experimental evaluation.

Figure 1 shows the experimental framework. Experiments were conducted using the Opus codec implementation available at [START_REF]Opus interactive audio codec[END_REF]. A set of samples in PCM format were used as input to the Opus encoder. Opus encoded the samples using the specified bit-rate and generated an Opus format audio file as output. The Opus decoder then took the encoded Opus audio file and decoded it to a Wave file in PCM format for comparison with the original audio sample. We have modified the Opus decoder to introduce a time-based random packet loss generator that, when given a desired packet loss rate X, each packet that is packetized from the Opus format audio has a chance of X% (i.i.d) of being dropped and replaced by an empty (null) payload packet. The decoded Opus audio, along with the original sample were input to PESQ-WB software and a call quality indicator for MOS was given.

It is not uncommon to have above 10% packet loss in a wireless connection [START_REF] Balakrishnan | Explicit loss notification and wireless web performance[END_REF], therefore we extended our analysis to a loss rate of up to 20% to have a better understanding of the audio quality degradation introduced by a larger range of packet loss rates. Packet loss rate experiments from 0% to 20% were conducted in 1% increments. For each audio sample and packet loss rate, experimental runs were repeated until the mean value over the set of experiments meets a confidence level of 99% with 1% margin of error. An initial set of 20 runs were completed before the first mean value is calculated, avoiding early termination of the experiment if the first few outcomes produce similar scores. After these 20 runs, the mean value is then calculated after every test run, until 99% of the output MOS values are in 1% error range of the mean value.

Repeating the experiments for a large number of tests ensures a smooth and a more reliable indication of degradation over different packet loss rates.

B. Experimental Results

The call qualities for each of 5 samples for each bit-rate at every packet loss rate point were calculated and shown in Figure 2. This figure not only shows impact of packet loss for each individual sample Figure 2(a-e), but also shows the MOS values averaged across all 5 samples Figure 2(f).

The results in Figure 2 have some variance from each other for different reasons. The 'original' sample results in (a) degrade faster than the others due to its different composition, in terms of more speech content contained in the sample. This is four sentences spoken by 2 males and 2 females in a single audio sample, leaving less silence, thus making it more sensitive to increasing packet loss. The results of the Female 1 sample in (b) indicate that it is more robust to packet loss, but the 8 kbps stream that is encoded from uncompressed audio drops faster than the stream transcoded from the already compressed 14 kbps and 20 kbps streams. This may be due to a combination of the speech pattern in the sample and the fact that in the directly encoded 8 kbps case, higher quality audio is lost, leading to a larger degradation overall. This experiment was repeated to verify this behaviour. However, further investigation of distribution of loss for the Female 1 sample is required. Comparing the Female 2 sample (c) with the Male 2 sample (e), the Female 2 sample has lower MOS values than the Male 2 sample for similar packet loss rates. This is mainly because PESQ tool is known to underestimate the MOS of female audio samples [START_REF] Côté | Analysis of a quality prediction model for wideband speech quality, the WB-PESQ[END_REF]. However, this situation is not always true, if we compare the Female 2 sample with Male 1 (d), the results of these two samples are well correlated.

A large number of tests based on a single test sample will not always ensure a smooth curve and is not always applicable to other samples. However, using the average of 5 samples from different sources with both Male and Female voices reduces the sample dependency effect. Figure 2 (f) shows average results of 5 samples. This average plot gives a good estimation of how Opus codec performs over packet loss rates from 0% to 20% in a more general context, without the bias of a single sample. Additionally, since the transcoded streams already have the effect of quality degradation from a previous encoding (the output of which was then used as input for transcoding), the curve of transcoded stream for 20 kbps to 14 kbps is of a slightly lower quality than directly encoded 14 kbps stream, but still much higher than the three 8 kbps streams. For these three curves, the directly encoded 8kbps stream performs slightly better than the streams transcoded from 20 to 8kbps and 14 to 8kbps respectively, as expected.

Another observation from the results is that, on average, no matter where the stream is transcoded from, tests with higher bit-rate always have better quality than those with a lower bit-rate. Furthermore, the 8 kbps mode in Opus, which would be employed in low bit-rate transmission modes, has a significant degradation in quality from the 14 kbps mode, much greater than the difference between 20 kbps and 14 kbps. While the loss rate increases, the difference between MOS values decreases significantly. However, the difference between each bit-rate is still noticeable when the MOS is in an acceptable human perception range (MOS above 2.0).

C. Opus MOS Fitting

Based on the results presented in the previous section, the performance of the Opus codec can be described using mathematic model, as shown in Figure 3. This can then be used in other situations to ascertain the call quality for a given packet loss / bit-rate combination. While the E-Model provides a method for estimating call quality when given network characteristics, such as delay, packet loss rate, jitter and the current codec, it is highly dependent on the codec used. The impairment introduced by the codec has to be ascertained and then standardized by a large experimental evaluation. Currently, there are only ITU standard narrowband codecs, along with a few non-ITU narrowband codecs that have been widely tested and their impairment factors standardized. Additionally, the wideband extension of E-Model [START_REF] Möller | Instrumental estimation of E-model parameters for wideband speech codecs[END_REF] requires that the packet-loss robustness factor (Bpl) corresponds to the codec, packet size and packet loss concealment (PLC) used. For our purposes, as the PLC technique can vary in the Opus codec, we used the previously detailed method of inserting an empty packet. For a more straightforward estimation of the quality for a given bit-rate / packet loss rate combination and These mappings are then used in the following simulation experiment to further study the effect of packet losses and quality degradation in a congested network environment and to derive the appropriate bit-rate switching thresholds.

IV. OPUS CODEC SIMULATION-BASED EVALUATION

The purpose of this experiment was to further evaluate the performance of the Opus codec by employing it in a congested network scenario. Given a bandwidth-limited link, as background traffic increases, the network becomes congested and as a result all packets transmitted over that link will compete for transmission, leading to packet loss. By analysing the performance of the different bit-rates and understanding the relationship between the degradation curves, while introducing congestion, the benefits of bit-rate adaptation can be assessed. ns-21 was used to simulate the network topology, applications (VoIP traffic) and to provide monitoring output. The reason for doing this is to verify the assumption that a lower bit-rate Opus stream has a lower packet loss rate than a higher bit-rate Opus stream for a given background traffic level. This demonstrates that switching to a lower bit-rate results in better call quality, as well as extra bandwidth savings.

A. Simulation setup

In order to model a real VoIP call scenario, a single call using Opus was simulated. This is then perturbed by background traffic to saturate a bandwidth-limited link. This background traffic was simulated as a constant bit-rate application, with a fixed packet size of 62 bytes, where the transmission interval between packets decreases as the required background traffic level increases for each experiment. The 62 byte packet size represents 20kbps VoIP traffic, where the VoIP payload per packet is 50 bytes and an additional 12 bytes are used to represent the RTP header in ns-2. As shown in Figure 4, Node 0 was used in this experiment to place the "monitored" call. Node 1 was used to simulate the source of background traffic. Node 0 and 1 send their traffic via Node 2 to Node 3. Node 0 and Node 1's connections to Node 2 are modelled as 2Mbps links. Node 2 then forwards their packets onto the 1 Mbps bottleneck link connected to Node 3. All links have a queue size of 50 packets and a drop tail policy enforced. Node 3 has two receivers, one for receiving the background traffic from Node 1, and one receiver for the monitored Opus call from Node 0. Each received or dropped packet is recorded, including the reception or dropping time, packet size, flow id, etc. The VoIP flow from Node 0 to Node 3 through Node 2 was monitored and its packet loss rate was calculated. Measurements for delay were performed, however the maximum delay encountered was 25ms, which should only have a minor effect on call quality. A brief experiment was conducted using the E-Model with parameters for another codec and the effect of delay was minimal (causing between 1% to 4% degradation in MOS). Jitter is considered in loss by using a limited buffer length. This will lead to packet loss when the delay added by jitter exceeds buffer length. The monitored VoIP flow started at 0 seconds and ran until the end of simulation at 50 seconds. Background traffic lasted for 30 seconds, starting at 10 seconds into the simulation, running to 40 seconds. The simulation was repeated for background traffic levels ranging from 0.97 Mbps to 0.999 Mbps in 0.5 kbps increments.

The packet loss was calculated for every newly received packet using a sliding average over the last 4 seconds from the current packet reception time. The authors of [START_REF] Clark | Modeling the effects of burst packet loss and recency on subjective voice quality[END_REF] found that the listener would not perceive the call quality degradation immediately if it drops instantaneously, but as time goes by the impairment would become noticeable and more annoying to the listener. There is a recency effect that a listener would remember call quality and start to notice the good-to-bad transition in about 5 seconds and 15 seconds for the bad-togood transition. Thus, if remedial action can be made in the first 4 seconds to maintain the call quality, this will not alter the quality of user experience.

As discussed previously, the Opus tools collection were used for the previous experiment. The output of the encoder is a variable bit-rate audio file, with a mean bit-rate corresponding to a target bit-rate. The OpusRTP tool, which can be used for the transmission of Opus content over RTP, produces a list of all the packets contained within the audio file, along with each packet size. Our simulation then generates packets of the exact size in the sample and then sends these packets every 20 ms (corresponding to the frame size). In this way, the simulated audio streams have the exact same parameters as the previously mentioned samples. Thus, the fitting described previously can then be used to calculate the corresponding call quality, given a packet loss rate for that bit-rate.

B. Results Analysis

As the experiment was repeated for different levels of background traffic, each experiment generates a varying packet loss pattern like the one shown in Figure 5. In this figure, we have shown where the median value is located. (The label corresponds to the time of occurrence for the median value and its value, respectively). This figure shows the packet loss rate under a constant level 0.994 Mbps background VoIP traffic. Here, we can observe an increase in packet loss rate as the links and consequently, buffers in the network become congested, leading to packets being dropped. Figure 5 shows the performance for one particular background traffic level and clearly shows the packet loss behaviors of the 3 different bitrates in our experiment.

As can be seen in Figure 5, the 20kbps stream begins to lose packets at 11.38 seconds and 14 kbps stream loses packets slightly later at 12.08 seconds. However, the 8 kbps stream maintains its 0% packet loss rate until 14.32 seconds (4.32 seconds after the background traffic begins). It can also be noted that the rate of increase for packet loss for the 8 kbps stream is much lower than that of the higher bit-rates. This means that it takes more time to reach to its peak packet loss rate for a given background traffic level.

Figure 6 shows the packet loss curve for increasing levels of background traffic up to 0.999 Mbps, just below the link bandwidth of 1 Mbps. These results were the average result of the 5 tested audio samples at each simulated background traffic level. For each simulation, the median value of the packet loss rates as shown in Figure 5 were used. The 20 kbps stream starts to lose packets at 0.9775 Mbps of background traffic. The 14 kbps stream begins to lose packets at 0.9825 Mbps, while 8 kbps stream remains at 0% loss rate until the background traffic reaches 0.9895 Mbps. Furthermore, the rate of increase for each stream is different. The 20 kbps stream is more sensitive to background traffic as shown by the higher packet loss rate. The sensitivity to background traffic decreases as the stream bit-rate is lowered, with the stream of 8 kbps being least sensitive.

As the average of 5 samples were used, this leads to some variability in the levels of packet loss for a given background traffic level, as a result of the variable bit-rate of each sample's speech content. Our experiments also demonstrated that the ns-2 simulator sometimes produced a fixed pattern of packet losses. This is apparent in the significant drop for the 20 kbps stream (and less so, for 14 kbps) under 0.992 Mbps of background traffic. Upon further investigation, for background traffic with 62 bytes per packet and at a rate of 0.992 Mbps, it was found that these particular values produce exactly 2000 packets to be transmitted per second for the background traffic. This combination produces unusual results, in the case of 20kbps which has approximately 3% packet loss, while for the 14 kbps the observed packet loss is around 6%, much below observed packet loss rates for similar levels of background traffic. However, for all other background traffic levels, the combination of packet size and background traffic level results in an amount of packets with a fractional part, which then produce coherent results. It would appear that this behavior is linked to some factor within the ns-2 scheduling. To further validate our experimental approach, the background traffic packet size was incremented and decremented by 1 byte, which again produced correct results. For the purposes of our next experiment, the corresponding points at 0.992 Mbps were removed.

Most importantly, it can be observed in Figure 6 that for the same level of background traffic, streams with different bitrates suffer different packet loss rates. This leads to thresholds where the call quality for a lower bit-rate stream would be better than that of a higher bit-rate stream. From Figure 6, a mapping from the packet loss rate of the current bit-rate to the corresponding packet loss rate of another bit-rate can be derived. These packet loss rates can then be compared in terms of their corresponding speech quality (from Figure 3). This allows for the determination of thresholds where the call quality of one bit-rate exceeds that of another. In the figures below, we term 20 kbps, 14 kbps and 8 kbps as high, medium and low quality respectively. We summarize the methodology for threshold determination as follows:

1) Monitor the packet loss rate for the current bitrate. And using Figure 6, compute the corresponding packet loss rate that would be observed by using a lower bit-rate. 2) Using the fitting provided in Figure 3, compute the MOS for the current and the lower bit-rate. 3) If the MOS for the lower bit-rate is higher than that for the current bit-rate, inform the encoder to switch to the lower bit-rate. Figure 7 and 8 present the results for the above method, using the results obtained in our experiments. In both figures, the horizontal axes correspond to the packet loss rates experienced by 20 kbps and 14 kbps, respectively (i.e. these are the streams that the switching is made from). The corresponding packet loss rate for the lower quality stream being switched to (not shown here) will be lower, as explained above. In Figure 7, we can observe that as the packet loss rate of the higher quality stream exceeds approximately 0.8%, the quality of the medium quality stream becomes greater than that of the high quality stream. This trend continues as packet loss rates increase. For the case of a transition between medium and low quality (Figure 8), once the packet loss rate of the medium quality stream exceeds approximately 5.7%, the quality of the lower quality stream becomes greater. A similar methodology can be used to enable switching back to a higher quality. However, this requires additional information regarding network congestion (as a 0% packet loss rate in lower bit-rates can correspond to multiple packet loss rates in higher bit-rate) and temporal logic in order to avoid repeated switching between lower and higher bitrates over a short period of time.

V. CONCLUSION

This paper presented an analysis of the impact of packet loss on VoIP call quality for the Opus audio codec. From this analysis, a collection of fitting functions describing the relationship between packet loss rate and call quality for multiple bit-rates, were derived. Furthermore, this paper also investigated the performance of Opus in a congested network scenario, to understand the relationship between packet loss rates for different bit-rates (and the resultant call quality). The results of these experiments allowed us to determine that beyond approximately 0.8% packet loss rate for a 20 kbps stream, better quality can be achieved by switching to a 14 kbps stream. Similarly, when experiencing above approximately 5.7% packet loss for a 14 kbps stream, switching to a 8 kbps stream results in better quality.

To increase the applicability of these results, future work could include the analysis of the transcoded samples and samples from different languages. Focusing on Opus, future work could include the investigation of more bit-rates, frame sizes and the use of more complex packet loss concealment and forward error correction, as these were not used. While on the simulation environment, the use of different background traffic models could produce interesting results.

Fig. 1 .

 1 Fig. 1. Analysis Workflow

Fig. 2 .

 2 Fig. 2. MOS Results from PESQ-WB under Different Packet Loss Rates

Fig. 3 .

 3 Fig. 3. Opus Fitting Function

  Fig. 4. Simulation Topology

Fig. 5 .Fig. 6 .

 56 Fig. 5. Opus Stream Packet Loss under 0.994 Mbps Background Traffic

Fig. 7 .Fig. 8 .

 78 Fig. 7. Opus Stream Switching from High Quality to Medium Quality

http://www.isi.edu/nsnam/ns/

ACKNOWLEDGMENT

This research was partially funded by Science Foundation Ireland via grant 08/SRC/I1403 FAME SRC. This work was also supported by the Irish Research Council for Science, Engineering and Technology, co-funded by Marie Curie Actions under FP7; and by the Telecommunications Graduate Initiative which is funded by the Higher Education Authority under the Programme for Research in Third-Level Institutions Cycle 5 and co-funded under the European Regional Development Fund. This work was also supported, in part, by Science Foundation Ireland grant 10/CE/I1855.


Imane Horiya

Soufiene Djahel

Damien Magoni
email: magoni@labri.fr

John Murphy
email: j.murphy@ucd.ie

Messages Prioritization in IEEE 802.15.4 based WSNs for Roadside Infrastructure

Keywords: Wireless Sensor Networks (WSNs), Road Monitoring, Smart Cities, IEEE 802.15.4, Backoff, MAC protocol, Intelligent Transportation System (ITS)

Wireless Sensor Networks (WSNs) have gained wide-scale popularity for real-time events monitoring and detection due to their high accuracy and ease of deployment. Therefore, they have become increasingly prevalent solutions in several application domains such as health-care, transportation, etc. Many studies in the literature have focused on optimizing the energy consumption of the wireless sensors in order to ensure their autonomous operation for longer periods. Some applications of WSNs, however, have strict delay requirements due to the nature of the information being transmitted. This delay should be kept as short as possible to ensure timely and efficient reaction of the system, such as a Traffic Management System (TMS) dealing with an incident on the road. In this context, we propose in this work, two novel schemes to reduce the transmission delay of prioritized messages in WSNs deployed in road networks to report regular traffic as well as event-driven (i.e. incidents) information. These schemes improve the backoff computation mechanism at the MAC layer of IEEE 802.15.4 standard protocol, by providing an original dual mode operation mechanism which speeds up the transmission of event-driven messages, while keeping the transmission delay of periodic messages reasonably low. Simulation results show that our schemes succeed in reducing the transmission delay of event-driven messages and achieve a very high packets delivery ratio.

I. INTRODUCTION

Wireless Sensor Networks (WSNs) [START_REF] Akyildiz | Wireless sensor networks: a survey[END_REF] involve a large number of sensor nodes that collaboratively collect, process and report different events. This technology is becoming increasingly popular for realtime events monitoring and detection, and for events sensing paradigm in general, spanning different application domains such as remote patients monitoring, underwater monitoring and transportation etc. In these applications, data collection is recognized as a fundamental process that plays a key role in determining the overall efficiency of the monitoring system. Nevertheless, collecting data without carefully considering aspects of time delay in some specific applications can result in serious issues in the monitoring process, ranging from lower system performance to loss of human lives in emergency situations [START_REF] Wang | Networked wireless sensor data collection: Issues, challenges, and approaches[END_REF].

In most of WSNs based monitoring applications, the sensors continuously sense their environment and report the measured data periodically to the sink. However, there are a large number of other applications such as: gas or oil leakage detection, health monitoring to detect sudden change in patients vital signs, road traffic monitoring to detect random in-road incidents etc., where event-driven messages generation approach is more appropriate. These safety related applications that monitor and report emergency events occurrence require a very short transmission delay of the packets reporting such events, to ensure fast and efficient reaction from the system. Among the above applications, road traffic monitoring, particularly in the context of future smart cities, has recently attracted a lot of attention from the research community [START_REF] Mohan | Nericell: rich monitoring of road and traffic conditions using mobile smartphones[END_REF] due to the rapid growth of cities' population as well as their number of vehicles. This led to several ecological and economic problems especially in many industrialized countries. These problems require a substantial improvement of existing Traffic Management Systems (TMS) by, mainly, enhancing the efficiency of road monitoring equipment, specially in big cities where traffic congestion presents a real challenge and the need for urban as well as highway traffic monitoring grows.

WSN is a promising solution to improve the efficiency and deployment flexibility of current expensive road traffic monitoring equipment, such as induction loops, CCTV cameras etc. The application of WSNs technology in road traffic monitoring domain requires a high reliability for periodic messages transmission, and a very short delay for event-driven messages transmission, since these latter messages report critical information for drivers and passengers safety, hence the need of differentiated services between the different types of collected data.

In this paper, we consider the application of WSNs for real-time road events monitoring in a smart transportation context, with focus on the design of alternative solutions to ensure fast transmission of event-driven messages (i.e. reporting an incident on the road), while maintaining the end to end transmission delay of other regular messages (i.e. reporting periodic measurement of some parameters) at an acceptable level for the overall system performance. To this end, we slightly modify the sensors MAC layer by designing a simple yet efficient dynamic Backoff Interval Adaptation (BIA) scheme for IEEE 802.15.4 standard protocol (un-slotted mode) [START_REF] Committee | Std.802.15.4: standard for local and metropolitan area network, part 15.4: low-rate wireless personal area networks (lrwpans)[END_REF]. This scheme is further enhanced by proposing an original dual mode operation mechanism to ultimately achieve the desired goals. Notice that we use, throughout this paper, the terms event-driven messages and emergency messages to refer to messages generated upon detection of an incident on the road.

The remainder of the paper is organized as follows. Section II presents the most relevant works in the literature. Next, we provide a detailed description of the proposed solution in section III. In section IV, we present and discuss the obtained simulation results of our designed solution under various simulation scenarios. Finally, we discuss some future directions in section V.

II. RELATED WORK

It is foreseen that WSNs will play a key role in improving road monitoring system efficiency. To this end, some works in the literature have illustrated the advantages of applying this technology in road networks. The sensors on the road can be static or mobile depending on which application they are used for. In this section, we discuss some works, and illustrate the advantages of applying WSNs technology in smart transportation. The authors of [START_REF] Ergen | Pedamacs: Power efficient and delay aware medium access protocol for sensor networks[END_REF] have proposed PEDAMACS which is a TDMA (Time Division Multiplexing Access) based MAC protocol in WSNs for road monitoring purposes. PEDAMACS applies a scheduling algorithm that guarantees the delivery of all packets to the sink at the end of each scheduling phase. The synchronization overhead is one of its major drawbacks, in addition to its restriction to one hop transmission only. Therefore, this makes it unsuitable for multihop and event-driven messages transmission due to the delay critical nature of such messages. Moreover, this protocol is not cost effective as its deployment at large scale requires a large number of costly sophisticated gateways. Hence, PEDAMACS is not an ideal solution for developing countries as well as cities lacking sufficient financial resources to deploy costly road monitoring equipment.

Most recently, Pascale et al. [START_REF] Pascale | Wireless sensor networks for traffic management and road safety[END_REF] have shown the benefits of WSNs technology for ITS applications, and how the wireless communication can increase the flexibility of road network monitoring. However the main focus of this work is the effective traffic information acquisition and processing rather than effective data collection techniques.

A data collection process becomes critical when wireless technologies are used for system monitoring purposes. In such a system, the data is usually reported periodically to the sink [START_REF] Brahmi | Towards efficient data collection in wsns[END_REF]. However, the state of the network may change suddenly due to the occurrence of some incidents. In this case, event-driven messages need to be generated and transmitted as soon as the incident is detected, granting them the highest priority among other regular messages [START_REF] Brahmi | Improving emergency messages transmission delay in road monitoring based wsns[END_REF].

To manage this, numerous protocols using differentiated services have already been proposed in the literature. These protocols adapt the parameters of the standard IEEE802.15.4 according to the traffic type, for example, the authors of [START_REF] Koubaa | Improving the ieee 802[END_REF] proposed an enhancement of the Backoff algorithm by assigning different values to the three Backoff parameters (i.e., macMinBE, aMaxBE and CW) according to the type of traffic to be transmitted. Similarly, [START_REF] Ndih | An analytical model for the contention access period of the slotted ieee 802.15. 4 with service differentiation[END_REF] adapts the CW (Contention Window) value according to the traffic type. However, these solutions are beacon enabled while our proposed scheme is designed to work in beacon-less mode.

In addition to MAC protocol enhancement, other solutions have focused on designing novel clustering algorithms tailored to WSNs to further improve data collection efficiency. The ultimate goal of such clustering mechanisms is to reduce the number of transmitted messages, thereby increasing the network lifetime and reducing the end to end delay. For further reading on this theme the reader may refer to: [START_REF] Pham | Sccs: Spatiotemporal clustering and compressing schemes for efficient data collection applications in wsns[END_REF], [START_REF] Alshawi | Fuzzy chessboard clustering and artificial bee colony routing method for energy-efficient heterogeneous wireless sensor networks[END_REF], [START_REF] Khiati | Bod-leach: broadcasting over duty-cycled radio using leach clustering for delay/power efficient dissimilation in wireless sensor networks[END_REF]. It is important to mention here that the clustering approach is out of scope of our work as we are focusing on improving event-driven messages transmission delay in IEEE802.15.4 protocol operating in beacon-less mode.

To conclude, WSNs represent a breakthrough technology for traffic monitoring that combines low-cost small vehicle detectors (powered by a battery and/or energy harvesting system) with scalable self-configuring wireless networking as described in [START_REF] Tubaishat | Wireless sensor networks in intelligent transportation systems[END_REF] and [START_REF] Cheung | Traffic surveillance by wireless sensor networks: Final report[END_REF].

III. PROPOSED SOLUTION

In this section, we present an overview of the system model followed by a description of our proposed solution which consists of a novel backoff adaptation scheme for achieving an optimal balance between event-driven and periodic messages transmission delay.

The architecture of our system consists of one gateway (i.e. WSNs sink) that collects traffic data reports from a large number of sensors deployed on the roadside as well as under the road pavement, as shown in Figure 1. We assume that these sensors are equipped with permanent energy supply, thus the problem of energy consumption is neglected. The WSN gateway is deployed in one corner of the road intersection, and has an important role in the synchronization of the other sensors. It is also used for managing the priority of the different packets received by using two types of queues with different priority levels: High and Low levels, depending on the importance The sensors in our architecture are deployed to measure and report two types of data which can be distinguished according to their urgency level. The messages carrying this data are classified into two main categories:

• Class 1 (event-driven messages): these messages carry data regarding incidents detected by the sensors, such as accidents (i.e. cars crash), a stalled car in the road or any other emergency event reported by sensors mounted in passing cars, such as emergency braking detection, etc. This type of data requires a minimum transmission delay from the detector sensor to the sink (i.e. a small backoff value for fast access to the medium) as well as reliable transmission.

The occurrence of such events is random in time and space and the message carrying them have the highest priority at the gateway queue.

• Class 2 (periodic or regular messages): these messages are transmitted regularly and carry traffic and weather conditions related data. The weather conditions represent temperature, pressure and humidity etc. The data collected for traffic conditions are usually vehicles speed, traffic flow speed and volume, road occupancy level etc. These parameters are measured periodically and represent the lowest priority class (i.e. they are less critical for TMS efficiency).

The main objective of our work is to reduce the end to end transmission delay of the messages belonging to the Class 1 described above. To this end, we have designed a novel backoff adaptation scheme to meet the requirements of event-driven messages transmission.

Since we have to transmit different types of data with different priority levels, the challenge in this case is to speed up the channel access for a sensor reporting a detected emergency event. To face this challenge, we propose to adapt the Backoff Interval (BI) to the class of the message to be transmitted as explained, in detail, in the following sub-sections.

A. Backoff Interval Adaptation (BIA) scheme

To achieve our objective, we divide the backoff interval into two parts: the first part of the interval [0, 2 BE-1 ] is dedicated to eventdriven messages (Class 1), while the second half [2 BE-1 , 2 BE ] is reserved for the periodic or regular messages (Class 2), as shown in Figure 2. This scheme grants smaller backoff values for event-driven messages over the other types of messages, hence ensuring a lower end to end delay. The backoff selection mechanism follows a uniform distribution, in both classes 1 and 2, to give an equal transmission probability to all the sensors aiming to transmit the detected/received emergency events and minimize the collision probability.

Assuming a random variable X that represents the backoff delay; its value varies within the interval [0, 2 BE ]. We define X as follows:

X|C = 1 ∼ U ([a1, b1]) (1)
X|C = 2 ∼ U ([a2, b2]) (2)
Such that:

• a1 = 0 • b1 = a2 = 2 BE-1 • b2 = 2 BE
Where C refers to the class of the message to be transmitted over the wireless channel.

B. Mode switching based BIA

We improve the above BIA scheme by introducing two modes of operation in which the sensors use different BI's to transmit both event-driven and periodic messages. The idea behind this is to avoid penalizing the periodic messages when there are no event-driven message being sent or forwarded by the sensor or its immediate neighbors. To this end, we define two modes of operation: the Urgent Mode and the Normal Mode as illustrated in the Figure 3. As defined in section III-A, an event-driven message backoff is chosen from [0, 2 BE-1 ] while a periodic message backoff is chosen from the interval [2 BE-1 , 2 BE ]. This mode is referred to as the Urgent Mode used only in case of reception or generation of an event-driven message. We define a second mode, the Normal Mode, which is set in absence of event-driven messages. We choose to pick our backoff for periodic messages in this mode from the whole interval BI.

Algorithm 1 BIA + Urgent Mode switching. Forward the received message 20: end if

The random variable X of the class 2 in normal mode is defined as follows:

X|C = 2 ∼ U ([0, 2 BE ]) (3)
Figure 3: The backoff distribution used in mode switching based BIA.

1) Urgent Mode operation: the main challenge in using two different modes of operation is to define how long a sensor node should stay in urgent mode after receiving an event-driven message.

To this end, we need to design an accurate approach to dynamically set the Urgent Mode Duration (UMD) value. Accordingly, whenever a sensor node receives an event-driven message it switches its transmission mode from normal to the urgent mode, then it calculates the UMD value and remains in this mode until the expiration of this UMD. The Algorithm 1 illustrates the different cases where a sensor node switches between the two modes, as described in the following steps:

1) Each time an event-driven message is received, the node switches to the urgent mode, and computes the value of its TUMD.

2)

If a new message is received, we check the state of TUMD.

3) If TUMD has expired, and the received message is an eventdriven message, then the message will be sent under the urgent mode; if it is a periodic message, the backoff will use all the BI.

4) If TUMD has not expired yet, and the received message is of emergency type, TUMD will be updated. If it is a periodic message, it will then be sent under the urgent mode until TUMD expires, then the node will switch back to the periodic mode.

The major benefits of adopting these two modes by the sensors can be summarized in following:

1) Preventing the penalization of periodic messages when there is no event-driven message received; the periodic messages can draw their backoff from the full BI as defined in the periodic mode, instead of picking a backoff from [2 BE-1 , 2 BE ] as defined in BIA. 2) Another advantage of this scheme is that when the intermediate node receives an event-driven message, it has to switch to urgent mode. Let's consider a topology with three nodes A1, A2 and A3 as shown in Figure 4. The nodes A1 and A2 are in the same transmission range, while A3 is two hops away from A1.

If A2 receives an event-driven message from A1, then it will forward it to the next hop A3 and choose the backoff from the interval [0, 2 BE-1 ]. At the same time if A1 (A3) has to send a periodic message, then it will pick its backoff from the interval [0, 2 BE ]. In this case, the backoff of A1 (A3) can be smaller than the backoff of A2 and the periodic message will be sent before the urgent message. Therefore, this doesn't meet our objective which is: to send (forward) the urgent message with minimum delay". However, if the node A1 (A3) sets the appropriate value of UMD and waits till its expiration, the urgent message will be sent and forwarded by the hop node with minimal delay. The value of UMD is based on the observations of the previous monitoring periods (i.e., time windows) as shown in Figure 6. Let's divide the sensor's lifetime into periods {Ti} i≥0 . The periodic messages are sent periodically in each period, while the event-driven messages are generated upon detection of an emergency event on the road. Each sensor measures information regarding road traffic state, weather conditions, etc. and sends these readings periodically (i.e. at the end of each time period {Ti} i≥0 ) towards the gateway. Upon reception (generation) of an event-driven message, the U M Di value is updated according to the inter arrival time of the event-driven messages during Ti-1.

2) UMD calculation: we define the UMD value by taking a statistical characteristic (e.g., average, n-th percentile, etc) of the distribution of the intervals separating two consecutive eventdriven messages. Our mechanism obtains this distribution by storing the frequency of the inter-arrival time intervals of the event-driven messages collected during the previous time window of the sensor. These intervals can be aggregated for coping with memory limitations. We thus define the Emergency Events Inter-arrival Duration (EEID) as the time separating the occurrence of the m-th and m -1-th emergency events:

EEIDm = EEm -EEm-1 (4)
Once the EEIDs are collected for a given time window, we calculate the Cumulative Distribution Function (CDF) of those values (an example is shown in Figure 5). Then our mechanism sets the UMD value by taking the 75-th percentile value of the CDF of the EEID. This 75-th percentile threshold has been used in all the simulation results of Section IV. In the example of Figure 5, the UMD would be set to approximately 18,5 seconds. In this section, we present the chosen simulation topology, parameters setting and discuss the obtained results. The simulations are performed using the Ns2.35 network simulator [START_REF]The network simulator ns-2[END_REF] under which the performance of the proposed algorithms has been evaluated. To carry out the simulations, we have modified the existing implementation of the IEEE 802.15.4 protocol in ns-2 by adding new functions to the file 802.15.4csmaca.cc. The primary metrics to be evaluated in these simulations are the End-to-End (E2E) transmission delay and the Packet Delivery Ratio (PDR) of both event-driven and periodic messages. A. Simulation setup 1) WSN topology: we have applied our proposal on a freeway topology, where we have set up a single gateway and deployed several sensors transversally and in parallel to the road. An example of this configuration is shown in Figure 7. The distance between the road-side sensors is set to 10 meters while the in-road sensors are spaced by 3.33 meters. Due to the short distance between the nodes we have used the FreeSpace propagation model and set the carrier sense and receiver threshold distances to 4 meters. The chosen value for the UMD is equal to the 75-th percentile of the measured EEID. In this configuration, all the sensors, except the gateway, transmit or forward two categories of messages: periodic and event-driven packets. The packets of the first category are generated periodically with an interval varying from 15 to 120 seconds following a CBR traffic pattern, while the event-driven packets are generated following a Poisson distribution. Notice that the emergency events occur randomly during the simulation time and their proportion is set to 4 % of the total number of generated periodic messages. The packet size of the periodic and event-driven messages is fixed to 63 bytes and 64 bytes respectively, and both of them are transmitted at 40 kbps. Other simulation parameters are summarized in the Table I.

2) Modeling emergency events inter-arrival time: we assume that the emergency events occurrence times follow a Poisson distribution. The Poisson distribution is the most common choice for modeling discrete events which occur randomly. Thus the time duration between two emergency events is given by an exponential distribution as shown below. Consider N a discrete random variable which models the number of emergency events during a time window T . We denote by n ≥ 0 the different possible realizations of N . The random variable N follows a Poisson distribution with the parameter λ such that:

P[N = n] = exp(-λ) λ n n! (5)
where,

• P[N = n]: probability that n emergency events occur.

• N : random variable representing the occurrence of emergency events during a given time window.

• λ: Poisson parameter, the expected emergency events during each time window.

To calculate λ, we assume that we have k observations n1, . . . , n k representing different numbers of emergency events which have occurred during the time window T1, . . . , T k . Then, λ is estimated with the sample mean:

λ = 1 kT k i=1 ni (6)
Let us consider the emergency event times as a random variable Xm (m ≥ 0) that represents the occurrence time of the mth emergency event. We define the Emergency Events Inter-arrival Time (EEIDm = Xm -Xm-1) as the time interval separating the occurrence of the m-th and m -1-th emergency events. It is then acknowledged that the random variable EEIDm follows an exponential distribution with parameter λ. Therefore we have:

E[EEIDm] = 1 λ (7)
In our simulations, we have thus generated emergency events whose inter-arrival time intervals do follow an exponential distribution.

B. Analysis of the simulation results

In our simulation, we compare the two proposed algorithms, BIA and (BIA+UM), with the standard IEEE802.15.4 algorithm. Notice here that UM means that the urgent mode switching mechanism is enabled. The histograms plotted in Figure 8 compare the average E2E delay of all the messages (periodic and event-driven) under various values of the transmission interval of periodic packets (i.e. Inter Packets Transmission Interval (IPTI)). In this scenario, we set the event-driven messages' ratio to a fixed value equals to 4 % and the network size to 50 nodes, while we vary the IPTI of periodic messages from 15 to 120 seconds. We run our simulations with the standard algorithm and then with BIA and (BIA+UM) algorithms. The results depicted in Figure 8(b) reveal that our two algorithms achieve a shorter average E2E delay of event-driven messages compared to the standard algorithm. This is due to the higher priority granted to event-driven messages in our algorithms through the use of a smaller BI. On the other hand, the results in Figure 8(a) show that the E2E delay of BIA can be equal or slightly higher than the standard in some cases, for example when the IPTI is equal to 20, 30 and 120 seconds. However, (BIA+UM) achieves always shorter delay than both the standard and BIA, which clearly highlights the efficiency of the proposed urgent mode switching mechanism. This efficiency of (BIA+UM) decreases with the increase of IPTI as the larger value of IPTI leads to less traffic load on the network, which reduces the collision probability and thus speeds up the transmission of both categories of messages. On the other hand, a small value of IPTI leads to a considerable increase of the traffic load, which consequently increases the E2E delay for both categories of messages.

Notice also that, as opposed to our two algorithms, the E2E delay of event-driven messages sent using the standard algorithm is larger than the E2E delay of periodic messages sent by the same algorithm. The corresponding PDR of this scenario, as shown in Figure 9, shows that the significant improvement brought by the (BIA+UM) scheme does not reduce the PDR value as it is similar to that achieved by the standard algorithm in most cases. It is worth to mention that the lack of a priority mechanism tailored for event-driven messages in the standard algorithm leads to an increase of their transmission delay compared to the periodic messages. The results in Figure 8 highlight this fact since the achieved delays of event-driven messages are higher than those of the periodic messages, especially for the IPTI values equal to 15, 20, 30 and 60 seconds.

Figures 10(a) and 10(b), show the impact of the network size on the average E2E transmission delay for periodic and event-driven messages, respectively. With the increase of the network size, the number of hops separating each node to the sink increases. The results plotted in these figures show how the E2E delay increases with the increase of the network size. Despite this increase, our algorithms deliver the event-driven messages faster than the standard (see Figure 10(b)). A lower delay is also observed for periodic messages using the (BIA+UM) algorithm (see Figure10(a)) compared to that achieved by the BIA algorithm. The corresponding PDR of this scenario is plotted in Figure 11 from which we can observe that the PDR of our schemes is almost equal to 87 % when the network size is lower than or equal to 75, and decreases under 85 % when the network size increases beyond 75 nodes. Indeed, increasing the network size automatically increases the traffic load on the network which in turn saturates it and leads to more collisions and loss of packets.

In some cases, a slight increase in the delay of periodic messages can be observed, for example when the network size is equal to 75 and 100 nodes (see Figure 10(a)). As the periodic messages are usually carrying information that do not have strict delay requirements, prioritizing the event-driven messages can lead to the increase of the E2E delay of these periodic messages. However, the E2E delay of event-driven messages using the standard algorithm, for the same values (i.e. 75 and 100 nodes), is higher than the BIA and (BIA+UM) algorithms. Since the objective of our work is to achieve a lower E2E delay for event-driven messages delivery, the slight increase of the E2E delay of the periodic messages is a small price to pay.

So far, we have discussed the performance improvements of our proposed algorithms compared to the standard one. We can conclude that our proposed (BIA+UM) algorithm achieves a significant improvement over the standard algorithm in terms of E2E delay of event-driven messages, and keeps almost the same E2E delay for periodic messages as the one achieved by the standard algorithm. Moreover, it ensures a similar PDR to the standard algorithm.

V. CONCLUSION AND FUTURE WORK

In this paper, we have proposed two algorithms to improve the latency of event-driven (emergency) messages in WSNs-based road traffic monitoring. More precisely, we reduced the transmission delay of the messages carrying critical information and kept their delivery ratio as high as possible. The first solution consists in adapting the Backoff Interval to assign small backoff time to the messages reporting critical events in order to favor their transmission over other periodic messages. The second algorithm is an enhancement of the previous one, and consists in designing two transmission modes: urgent and normal. The urgent mode is used only in case of generation or reception of event-driven messages, while the normal mode is set in absence of these messages. We have also introduced the Urgent Mode Duration (UMD) which is the required time for a sensor node to stay in the urgent mode before it switches back to the normal mode. This technique allows us to avoid penalizing the periodic messages when there is no emergency activity. Our algorithms have been implemented in ns-2 and the obtained results have proven their efficiency under different values of input parameters such as the transmission interval of periodic messages and the size of the network. As for future work, we plan to investigate data aggregation techniques based on spatial correlation in WSNs in order to reduce the traffic load in the network, and thus increase the delivery ratio when the network becomes saturated.

Figure 1 :

 1 Figure 1: WSNs deployed in road networks for traffic flow monitoring and emergency events detection and reporting

Figure 2 :

 2 Figure 2: The backoff distribution used in the BIA.

1 : 2 :

 12 if (New message received) then Check state of T U M D 3: if (T U M D NOT expired) then BI c1 = [0, b i+1 × 2] 13: Set BI c2 = [b i+1 × 2, 2 BE ]

Figure 4 :

 4 Figure 4: Example illustrating the benefits of using the Urgent Mode Duration (UMD).

Figure 5 :

 5 Figure 5: Example of a Cumulative Distribution Function of the EEIDs

Figure 6 :

 6 Figure 6: The variation of UMD value based on the EEID during WSN lifetime.

Figure 7 :

 7 Figure 7: The road network topology used in our simulation

Figure 8 :

 8 Figure 8: Impact of inter-packets transmission interval on Average End-to-End delay: Proportion of event driven messages=4%, Network size=50

Figure 9 :

 9 Figure 9: Impact of inter-packets transmission interval on Packets Delivery Ratio: Proportion of event-driven messages = 4%, Network size = 50

Figure 10 :

 10 Figure 10: Impact of Network size on Average End-to-End delay: Proportion of event-driven messages = 4%, Inter-packets transmission interval = 15 s

Figure 11 :

 11 Figure 11: Impact of Network size on Packets Delivery Ratio: Proportion of event-driven messages = 4%, Inter-packets transmission interval = 15 s

Table I :

 I Summary of simulation parameters

	Parameters	Value
	Transmission range	10 m
	Traffic type	CBR
	Routing Protocol	AODV
	Propagation model	FreeSpace
	Total number of sensors	25, 50, 75, 100
	Size of event-driven messages	64 Bytes
	Size of periodic messages	63 Bytes
	Data rate	40 kbps
	Transmission frequency of periodic msgs	15s, 20s, 30s, 60s, 90s, 120s
	Proportion of event-driven msgs	4%
	Simulation time	600 seconds
	No. of simulation runs

ACKNOWLEDGMENTS

This work was supported, in part, by Science Foundation Ireland grant 10/CE/I1855 to Lero -the Irish Software Engineering Research Centre (www.lero.ie). This work was also supported by the Telecommunications Graduate Initiative (TGI) which is funded by the Higher Education Authority under the Programme for Research in Third-Level Institutions (PRTLI) Cycle 5 and co-funded under the European Regional Development Fund (ERDF).


Semih Turkaya

Renaud Toussaint

Fredrik Kvalheim Eriksen

Olivier Lengliné

Guillaume Daniel

Eirik G Flekkøy

Knut Jørgen Måløy

NOTE: Localization Based On Estimated Source Energy Homogeneity

Acoustic signal localization is a complex problem with a wide range of industrial and academic applications. Herein, we propose a localization method based on energy attenuation and inverted source amplitude comparison (termed estimated source energy homogeneity, or ESEH). This inversion is tested on both synthetic (numerical) data using a Lamb wave propagation model, and experimental 2D plate data (recorded with 4 accelerometers sensitive up to 26 kHz). We compare the performance of this technique with classic source localization algorithms: arrival time localization, time reversal localization, and localization based on energy amplitude. Our technique is highly versatile, and out-performs the conventional techniques in terms of error minimization and cost (both computational and financial).

Source localization of acoustic signals is fundamental for a broad range of academic and industrial applications, from robotics to medicine; from telecommunications to geoscience [START_REF] Gershman | Signal Processing[END_REF][START_REF] Valin | IROS 2003. Proceedings. IEEE/RSJ[END_REF][START_REF] Elnahrawy | Sensor and Ad Hoc Communications and Networks[END_REF][START_REF] Malioutov | Signal Processing[END_REF][START_REF] Zhu | Postoperative Cancer Imaging:Practical and Innovative Approaches[END_REF][START_REF] Fink | AIP Conference Proceedings[END_REF][START_REF] Garnier | [END_REF] . Even though it is trivial to locate impulsive, non-dispersive signals without any reflections 8 , as the signal and propagating medium get more complex this task becomes more difficult. In this paper, a new approach of localization based on the signal energy is presented. It is possible to implement this estimated source energy homogeneity (ESEH) method into the authors' previous work 9 to localize microseismic events in aerofracturing of a porous medium in a Hele-Shaw Cell 10 , or other types of 2D experiments such as fracture propagation experiments in plexiglass 11 or crack propagation in paper 12 . Furthermore, it is possible to implement this method into a 3D medium at a larger scale which then can be used in the industrial applications such as geothermal activities [START_REF] Cornet | Seismicity Associated with Mines, Reservoirs and Fluid Injections[END_REF][START_REF] Evans | [END_REF][15] , well stimulation 16 etc.

We here present a set of experimental and numerical results that compare different methods of localization: Arrival Time Delay Localization (ATL) [START_REF] Carter | Acoustics, Speech, and Signal Processing Newsletter[END_REF][START_REF] Smith | Acoustics, Speech, and Signal Processing[END_REF][START_REF] Brandstein | Acoustics, Speech, and Signal Processing, Proceedings[END_REF][START_REF] Brandstein | Speech and Audio Processing[END_REF][START_REF] Yao | Selected Areas in Communications[END_REF][START_REF] Reed | Acoustics, Speech, and Signal Processing, Proceedings[END_REF] , Energy Based Localization (EBL) [START_REF] Hu | Multimedia Signal Processing[END_REF][START_REF] Sheng | Information Processing in Sensor Networks[END_REF] , Time Reversal Localization (TRL) [START_REF] Fink | AIP Conference Proceedings[END_REF][START_REF] Garnier | [END_REF]25 (see Supplementary Material S1), and ESEH.

A glass (or plexiglass) plate having dimensions 80 cm × 40 cm × 1 cm is used for experiments. A 4.5 mm diameter steel ball is dropped from 2 -3 cm height above the plate on different locations. The signal generated by the impact is recorded with a set of 4 miniature piezoelectric accelerometers (Brüel & Kjaer -4374) with an optimal a) Electronic mail: turkaya@unistra.fr sensitivity in the (1 Hz -26 kHz) frequency range. The recorded signal is amplified and conditioned using a Brüel & Kjaer Nexus Charge Amplifier -Type 2692-A. Then, the signals are transmitted to the computer using a Ni-DAQ mx PCI-6133 acquisition card.

This new method relies on the principle that the source energy, after correction from travel path-related attenuation, should be equal (or almost equal) at every sensor location. The energy spreading due to distance for plates can be defined as

E m = E
2πRh where E m is the source energy E spread to a receiver m at a distant R where h is the plate thickness. In this new approach, the energy is calculated using the equation 26,27 :

E s (r s , r n ) = ∫ ωNyq 0 2πR(n)ρhc(ω) |a(ω)| 2 ω 2 e α(ω)R(n) dω, (1)
where E s (r s , r n ) is the energy of the source seen from the sensor number n at position r n , if the source is at position r s , ρ is the mass density of the plate, c(ω) is the group velocity over different ω (angular frequency) at which the energy is traveling 27 , a(ω) is the acceleration of the plate after Fourier transform, R(n) = ||r n -r s || is the distance between the source and the receiver n and ω N yq is the Nyquist frequency (ω N yq = π dt where dt is a discrete time step). The part e α(ω)R represents correction due to the material based attenuation which is equal to 1 in the case of glass plate 27 . For plexiglass plate for the frequencies lower than the cutoff frequency ω c = ω(1/h), this attenuation coefficient is equal to α(ω) = 1 m -1 , and for the frequencies higher than cutoff frequency it is α(ω) = 7.64 × 10 -4 ω 2/3 m -127 . Defining an average operator as

⟨A⟩ = 1 N ∑ N n ′ =1 A(n ′ ). and using the normalized source energy Ψ s (r s , r n ) = E s (r s , r n )/max(E s (r s , r n )) where max(E s (r s , r n ))
is the maximum over the N sensors, we can formulate the standard deviation of the energy recorded at N different sen-

sors as σ(r s ) = √ 1 N ∑ N n=1 (Ψ s (r s , r n ) -⟨Ψ s (r s , r n )⟩) 2 .
The minimum of this standard deviation, σ(r s ) over the plate will indicate the position of the source. This method is based on the direct wave (signal without the arrival of reflected waves from the sides). Therefore, it is necessary to carefully define the time window prior to the arrival of reflection so as to achieve high quality estimates of the source position. We define a direct wave window ranging from the impact duration of the source by using hertzian mechanics (30 µs and 96 µs for the glass and plexiglass plates respectively) [START_REF] Johnson | Contact Mechanics[END_REF][START_REF] Farin | [END_REF] up to the time of arrival of the reflected wave i.e. τ source < L/V R , where L is the length of the raypath of the closest reflected wave (97 µs and 375 µs for the glass and plexiglass plates respec-tively). We used window sizes 50 µs on glass and 200 µs on plexiglass for the experimental cases. The Rayleigh wave velocity is V R glass ≈ 3100 m/s and V R plexi ≈ 800 m/s on glass and plexiglass plates 27 .

Tests on synthetic data using hertzian contact load during shocks [START_REF] Johnson | Contact Mechanics[END_REF][START_REF] Farin | [END_REF] table I it can be seen that the effect of uncertainty due to the estimation of the source energy in the conventional method leads to some estimation error even in the simplest case. In the infinite cases where the reflections are not included, energy based methods are more precise. A clear definition of the primary signal means that ESEH performs well in all circumstances. ATL is comparable to ESEH when the medium is non-dispersive; however, with increased dispersivity the performance of ATL decreases due to the attendant uncertainty in the wave velocity. In table II it is possible to compare computational costs for each method in every signal generation context:

This table is obtained by measuring the time spent during the estimation process with different methods. The window size of the signal is optimized for the cases to better include the direct wave. As a result, some of the less complex cases have longer signals and thus, take more time to estimate. From table II it can be seen that ATL is the cheapest method while EBL is the most expensive.

We tested experimentally the effect of the ball size (1 mm, 5 mm and 10 mm) and stiffness of the plate (polyamide, glass and steel) of the signals. We observed that these properties do not affect localization results significantly. The average estimation error for different sampling rates for a set of experiments using a 5 mm steel ball hitting on a plexiglass plate are presented in Figure 1. On the other hand, due to the lower Rayleigh wave velocity (≈ 800 m/s) in plexiglass, direct wave is clearer. This allows energy based methods to work in this case with a resolution ≈ 3.3 ± 1.0 cm, which is calculated by averaging the difference between the real and estimated source position for all the experiments (including the human error on targeting the predefined source position). Analysis of the experiments with different spatial resolution (by changing the grid from 1 cm to 1 mm) has a minor effect on the resolution of the data, but it increases the computational cost 70 times (see Supplementary Material S3). The conventional energy based localization method can be optimized by having a linearly spaced grid of 10 points between the maximum and the minimum possible source energy (see Supplementary Material S4).

The sampling rate of the signal has a significant effect on the estimation process: the smaller the sampling rate, the higher the error on localization. However, EBL and ESEH are the most stable techniques and provide better results over the range of sampling rates tested.

To see the effect of signal to noise ratio in localization, Gaussian white noise with different amplitude are added to the input data. In figure 2 it can be seen that the average error from ATL is the largest when the signal quality is poor. Here, ESEH and EBL have very similar responses. Moreover, no dependence on the propagation medium (i.e. glass or plexiglass) has been observed for the decay of the localization error with respect to the signal to noise ratio (see Supplementary Material S5). To see the effect of array geometry on the resolution we placed the sensors in different positions over the plate in the simulations. Based on our investigations, we found out that a 'T' shaped sensor placement gives the best results (≈ 10% better estimation) (see Supplementary Material S6).

The theoretical formulation of ESEH can be used in 3D media by changing the cylindrical energy spreading (with a decay of the energy in 1/R) to spherical spreading (for deep sources: E m = E 4 3 πR 2 or for superficial sources: E m = E 2 3 πR 2 ) and changing the material based viscosity , i.e. attenuation (from 2D glass or plexiglass used in this research to the selected 3D medium). The two main advantages of employing a 3D medium are that (1) the signals reflected from the sides are-generally-clearly distinguishable (or not existing at all when boundaries are sufficiently distant) , and (2) the waves are body waves, meaning that the medium is non-dispersive. We thus, anticipate improved resolution in a 3D medium compared to a system of plates.

The proposed method, ESEH, appears to be the best compromise with respect to location accuracy and computational cost among the set of methods tested in this study. Particularly, if the primary signal can clearly be defined, ESEH is very convenient to use. Despite being slower than ATL and TRL, it is more robust when the signal is noisy, dispersive or fast propagating. This method can be easily applied in 2D environments such as touchscreens or in 3D in the petroleum industry, seismology, or medicine.

See supplementary material S1 for the explanation of the different localization methods used in this study, S2 for detailed information about the numerical simulation, S3 for the details of spatial resolution of EBL, S4 for the optimization of the source energy grid in EBL, S5 for details of the signal to noise ratio comparison, and S6 for the details of the different array geometries compared.

We would like to thank Alain Steyer and Miloud Talib for the technical support and Maxime Farin for discussions during this work. This project has received funding from the European Union's Seventh Framework Programme for research under grant agreement no 316889, from the REALISE program of the Alsatian research network, from the Universities of Oslo and Strasbourg via a gjesteforsker program and an IDEX Espoirs award. We also thank Jamie I. Farquharson for his help in language to make the article easier to understand.

FIG. 1 .

 1 FIG. 1. Figure showing the decay of the average error on plexiglass plate with different sampling rates in different methods. Signals with lower sampling rates are obtained by decimating the experimentally recorded signal with 1 MHz sampling rate.

FIG. 2 .

 2 FIG. 2. Figure showing the effect of the signal to noise ratio (added artificially) of the signal over the estimation quality in different methods on glass plate.

  are conducted to check different methods (ATL, TRL, EBL, and ESEH) in different conditions before testing in physical experiments (see Supplementary Material S2). During the localization estimations, we used Rayleigh wave velocity V R as the wave velocity. However, it is possible to implement different group velocities for different frequencies in ESEH which decreases the error around ≈ 10 mm. In table I, the average error of the different cases of signal generation are presented in this order: infinite and non-dispersive plate, infinite and dispersive plate by taking into account different velocities over the frequency spectrum, finite and non-dispersive plate by taking into account the reflected waves from the boundaries, and finite and dispersive plate by taking into account both. Signals for 18 various source locations are generated and localized using different methods. From

TABLE I .

 I Table showing the average distance between the real source position and the estimated position (i.e. error) in mm for different cases in the signal generation.

	Mean Error, Glass Plate (mm)	ATL TRL EBL ESEH
	Infinite, Non-Dispersive	0	0	7	0
	Infinite, Dispersive	45 26	35 4
	Finite, Non-Dispersive	2	2	20 5
	Finite, Dispersive	35 27	50 36
	Experimental	21 29	48 33
	Mean Error, PlexiGlass Plate (mm) ATL TRL EBL ESEH
	Infinite, Non-Dispersive	0	0	7	0
	Infinite, Dispersive	30 61	27 11
	Finite, Non-Dispersive	0	0	21 3
	Finite, Dispersive	36 37	48 40
	Experimental	48 34	34 30

TABLE II .

 II Table showing the computational time in miliseconds for different cases.

	Mean Computational Cost (ms) ATL TRL EBL ESEH
	Infinite, Non-Dispersive	6	31	5567 125
	Infinite, Dispersive	6	31	5567 125
	Finite, Non-Dispersive	6	43	6983 257
	Finite, Dispersive	6	22	4760 90