<- Back to blog

On the averaging of RSSI and other logarithmic values


Basics of dBm

Engineers working in the wireless communication field often need to deal with physical values that differ by several orders of magnitude. To simplify calculations and make operations easier to follow, logarithmic units are often used. One such unit is dBm, which expresses the power level of a radio signal.

dBm is an absolute unit which shows how much bigger (in dB) certain value than 1 mW.

E.g., value of 0 dBm corresponds to a power which is 0 dB greater than 1 mW, thus it is 1 mW. Value of +10 dBm corresponds to a power level which is 10 dB greater than 1 mW, so it is 10 mW.

In general dBm value can be converted to mW using the following formula:

P mW = 1 mW × 10 ( P dBm / 10 )

Conversion from mW to dBm correspondingly:

P dBm = 10 × log 10 ( P mW 1 mW )

Averaging RSSI

Often dBm values are used to express RSSI - Received Signal Strength Indicator. It's a value that can be used for different purposes:

(Interactive. Use your mouse)

(Interactive. Use your mouse)

Some of the use-cases mentioned above don't require accurate RSSI measurements, but others require RSSI measurement error to be as small as possible. For example, when a software performs RSSI-based localization, the accuracy of RSSI measurements directly affects the accuracy of position estimation. One of the most common ways of reducing measurement error is averaging. The naive way of finding average RSSI is based on a well known formula:

RSSI avg_naive = sum(RSSI) num_elem

However, this approach is incorrect. The formula above can only be used to find average of linear units, for example signal power expressed in mW. But due to logarithmic nature of RSSI (which is usually expressed in dBm) the formula should be transformed to convert dBm to mW first. So the correct approach would be the following:

RSSI avg = 10 × log 10 ( RSSI avg_mW )

where

RSSI avg_mW = sum ( RSSI mW ) num_elem

and

RSSI mW = 1 mW × 10 ( RSSI / 10 )

Demonstration

By using a simple Python script we can find the error caused by naive RSSI averaging of two values. The error depends only on the difference between averaged values (i.e., the error of averaging pair of [-10 dBm, -20 dBm] is the same as the error of averaging [-20 dBm, -30 dBm]). The error shown on the plot is calculated as follows:

error = RSSI avg_mW - RSSI avg_naive_mW RSSI avg_mW

Plot demonstrating error of naive RSSI averaging of 2 values

Average RSSI calculator:

Summary