Engee documentation

bandpower

The power of the frequency band.

Library

EngeeDSP

Syntax

Function call

  • p = bandpower(x) — returns the average input power x. If x — the matrix, then bandpower calculates the average power in each column independently.

  • p = bandpower(x,Fs,freqRange) — returns the average power in the frequency range freqRange. To obtain power in the specified frequency range, you must enter a sampling frequency. Fs. Function bandpower uses a modified periodogram to determine the average power in the frequency range. freqRange.

  • p = bandpower(pxx,f,"psd") — returns the average power calculated by integrating the estimate pxx spectral power density (SPM). The integral is approximated by the rectangle method. Input argument f — the vector of frequencies corresponding to the estimates of the SPM in pxx. Parameter "psd" indicates that the input data is an estimate of the SPM, not time series data.

  • p = bandpower(pxx,f,freqRange,"psd") — returns the average power in the frequency range freqRange. If the frequencies in freqRange do not match the values in f, the closest values are used. The average power is calculated by integrating the estimate pxx spectral power density (SPM). The integral is approximated by the rectangle method. Parameter "psd" indicates that the input data is an estimate of the SPM, not time series data.

Arguments

Input arguments

# x — time series input data

+ vector | the matrix

Details

Time series input data, specified as a row vector, column vector, or matrix. If x is a matrix, then its columns are treated as independent channels.

Типы данных

Float64, Float32

Support for complex numbers

Yes

# Fs — sampling rate
1 (default) | positive scalar

Details

The sampling rate of the input data of the time series, set as a positive scalar.

Типы данных

Float64, Float32

# freqRange — frequency range for calculating the power of the frequency band

+ two-element real vector-row or column

Details

The frequency range for calculating the frequency band power, specified as a two-element real row vector or column vector. If the input signal is x contains counts, argument freqRange It must be in the following intervals:

  • Fs , if x the real value and even number;

  • Fs , if x the real value and odd number;

  • Fs Fs , if x the complex meaning and even number;

  • Fs Fs , if x the complex meaning and the odd one.

Типы данных

Float64, Float32

# pxx — SPM ratings

+ column vector | the matrix

Details

One-sided or two-sided estimates of the SPM, defined as a real-valued column vector or matrix with non-negative elements.

The power spectral density should be expressed in linear units, not in decibels. Use the function db2pow to convert decibel values to power values.

Типы данных

Float64, Float32

# f is a frequency vector for SPM estimates

+ a column vector with real elements

Details

A frequency vector defined as a column vector. Frequency vector f contains frequencies corresponding to the estimates of the SPM in pxx.

Типы данных

Float64, Float32

Output arguments

# p is the average power of the frequency band

+ a non-negative scalar

Details

The average bandwidth power returned as a non-negative scalar.

Типы данных

Float64, Float32

Algorithms

To determine the power of the frequency band, the function bandpower calculates an estimate of the power spectrum of the periodogram using the Hamming window.

The same frequency band power value bPow in the frequency range [fMin fMax] can be obtained from the signal x with sampling rate Fs in three ways.

Straight from the signal

bPow = bandpower(x,Fs,[fMin fMax])

From the periodogram of the signal

P,F = periodogram(x,hamming(length(x)),length(x),Fs);

bPow = bandpower(P,F,[fMin fMax],"psd")

From the estimation of the spectral power (SPM Welch) of the signal

P,F = pwelch(x,hamming(length(x)),[],length(x),Fs);

bPow = bandpower(P,F,[fMin fMax],"psd")

Because the function bandpower It uses an intermediate representation to convert the input signal from the time domain to the frequency domain. The returned bandwidth power may vary depending on the signal conversion method, the number of DFT points, and the window size.

Literature

  1. Hayes, Monson H. Statistical Digital Signal Processing and Modeling. New York: John Wiley & Sons, 1996.

  2. Stoica, Petre, and Randolph Moses. Spectral Analysis of Signals. Upper Saddle River, NJ: Prentice Hall, 2005.