DSP Algorithms for RF Systems

Trending

New Book!

The third edition of DSP for Beginners: Simple Explanations for Complex Numbers! Includes a new chapter on sampling.

Calculate Average Signal Power
June 1, 2024

Table of Contents

Introduction

Average signal power is important in calculating performance metrics such as signal to noise (SNR) ratio. Read on for how to derive and calculate the average signal power for a finite-length, discrete-time signal. Be sure to check out the post on deriving power and energy for a discrete-time signal.

More DSP blogs:

Signal Power Derivation

The average power of a signal x[n] is defined as

(1)   \begin{equation*}P_{x} = \mathbb{E} \{ x[n]  x^*[n] \}.\end{equation*}

The expectation operator \mathbb{E} \{ \cdot \} operates as an average or mean. For simplicity, and to make this practical for real-world RF systems, it is assumed that x[n] is N samples long beginning at time n=0. Therefore the expectation from (1) can be expanded according to

(2)   \begin{equation*}\begin{split}P_{x} & = \mathbb{E} \{ x[n] x^*[n] \} \\& = \frac{1}{N} \sum_{n=0}^{N-1} x[n] x^*[n]  \\& = \frac{1}{N} \sum_{n=0}^{N-1} |x[n]|^2.\end{split}\end{equation*}

Examples of Signal Power with Math

Assume x[n] is a constant value A over N samples according to

(3)   \begin{equation*}x[n] = \begin{cases}A, & 0 \le n < N-1 \\0, & \text{otherwise}.\end{equation*}

The average power of signal x[n] is therefore 

(4)   \begin{equation*}\begin{split}P_{x} & = \frac{1}{N} \sum_{n=0}^{N-1} A \cdot A \\& = \frac{1}{N} \sum_{n=0}^{N-1} A^2 \\& = \frac{1}{N} \cdot N \cdot A^2 \\& = A^2.\end{split}\end{equation*}

Assume y[n] is a complex sinusoid with frequency \omega and amplitude A,

(5)   \begin{equation*}y[n] = \begin{cases}A e^{j\omega n}, & 0 \le n < N-1 \\0, & \text{otherwise}.\end{equation*}

The average power is therefore 

(6)   \begin{equation*}\begin{split}P_{y} & = \frac{1}{N} \sum_{n=0}^{N-1} A e^{j\omega n} A e^{-j\omega n} \\& = \frac{1}{N} \sum_{n=0}^{N-1} A^2 e^{j \omega n - j \omega n} \\& = \frac{1}{N} \cdot N \cdot A^2 \\& = A^2.\end{split}\end{equation*}

Calculating Power with Python

The average power for a complex sinusoid with with amplitude A = 3 is calculated according to (6),

(7)   \begin{equation*}|A|^2 = |3|^2 = 9.\end{equation*}

Equations (6) and (7) are verified using simulation. The following code creates a complex sinusoid  of N=1024 samples with amplitude A = 3 and a random frequency \omega and then computes the average power:

import numpy as np
# build a complex sinusoid
A = 3
omega = np.random.uniform(-np.pi,np.pi)
n = np.arange(0,1024)
complexSinusoid = A*np.exp(1j*omega*n)
# calculate average power
averagePower = np.mean(np.abs(complexSinusoid)**2)
print('avg power = ' + str(np.round(averagePower,2)))

Running the script produces:

avg power = 9.0

which aligns with the mathematical calculation.

Conclusion

This blog describes the average power mathematically, provides a derivation for the average power of a complex sinusoid and verifies the result using a Python simulation.

More DSP blogs:

Leave a Reply