Engee documentation

obw

The width of the occupied frequency band.

Library

EngeeDSP

Syntax

Function call

  • bw = obw(x) — returns 99% of occupied frequency band bw The input signal x.

  • bw = obw(x,Fs) — returns the occupied frequency band, expressed in units of sampling frequency Fs.

  • bw = obw(pxx,f) — returns 99% of occupied frequency band of power spectral density estimation (SPM) pxx. Frequencies f correspond to the estimates in pxx.

  • bw = obw(sxx,f,rbw) — calculates the occupied frequency band of the power spectrum estimation sxx. Frequencies f correspond to the estimates in sxx. The function uses frequency resolution rbw to integrate each power estimate.

  • bw = obw(___,freqLims,p) — sets the frequency range in which the occupied frequency band is calculated. This syntax can include any combination of input arguments from the previous syntaxes, provided that the second input argument is either Fs, or f. If the second input argument is passed as empty, obw uses a normalized frequency. This syntax also defines p as a percentage of the total signal power contained in the occupied bandwidth.

  • bw,flo,fhi,power = obw(___) — also returns the lower and upper limits of the occupied band and the power in the occupied band.

  • obw(___, out=:plot) — plots the SPM or power spectrum in the current graph window and signs the frequency band.

Arguments

Input arguments

# x — input signal

+ vector | the matrix

Details

An input signal specified as a vector or matrix. If x — vector, it is considered as a single channel. If x — the matrix, obw calculates the occupied frequency band independently for each column. x must be a finite number.

Типы данных

Float32, Float64

# Fs — sampling rate
positive real scalar

Details

The sampling frequency, set as a positive real scalar. The sampling rate is the number of samples per unit of time. If time is measured in seconds, then the sampling frequency is indicated in hertz.

Типы данных

Float32, Float64

# pxx — spectral power density

+ vector | the matrix

Details

The spectral power density (SPM), defined as a vector or matrix with real non-negative elements. If pxx — one-sided evaluation, then it must correspond to the real signal. If pxx — the matrix, obw calculates the occupied frequency band of each column pxx regardless.

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

Типы данных

Float32, Float64

# f — frequencies

+ vector

Details

Frequencies specified as a vector.

Типы данных

Float32, Float64

# sxx — power spectrum estimation

+ vector | the matrix

Details

An estimate of the power spectrum, defined as a vector or matrix with real non-negative elements. If sxx — the matrix, obw calculates the occupied frequency band of each column sxx regardless.

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

Типы данных

Float32, Float64

# rbw — frequency resolution

+ positive scalar

Details

Frequency resolution, set as a positive scalar. The frequency resolution is the product of two quantities: the frequency resolution of the discrete Fourier transform and the equivalent noise bandwidth of the window used to calculate the SPM.

Типы данных

Float32, Float64

# freqLims — frequency limits

+ two-element vector

Details

The limiting frequencies specified as a two-element vector of real values. If the argument is freqLims if not specified, then obw uses the entire frequency band of the input signal.

Типы данных

Float32, Float64

# p — percentage of power

+ 99 (by default) | positive scalar

Details

The percentage of power given as a positive scalar of 0 before 100. Function obw calculates the frequency difference between the points where the integrated power intersects and percent of the total power in the spectrum.

Типы данных

Float32, Float64

Output arguments

# bw is the width of the occupied frequency band

+ scalar | vector

Details

The width of the occupied frequency band, returned as a scalar or vector.

  • If the sampling rate is specified, then bw it has the same units of measurement as Fs.

  • If the sampling frequency is not specified, then bw it has units of measurement of rad/count.

# flo,fhi — frequency band boundaries

+ scalars | vectors

Details

Frequency band boundaries returned as scalars or vectors.

# power — power stored in the frequency band

+ scalar | vector

Details

The power stored in the frequency band, returned as a scalar or vector.

Algorithms

To determine the occupied frequency band, the function obw calculates an estimate of the spectral power density of a periodogram using a rectangular window, and integrates it using the midpoint rule. The occupied frequency band is the frequency difference between the points where the integrated power intersects 0.5% and 99.5% of the total power in the spectrum.

The same value of the occupied frequency band bw can be obtained from the signal x with sampling rate Fs in three ways.

Straight from the signal

bw = obw(x,Fs)

From the periodogram of the signal

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

bw = obw(P,F)

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

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

bw = obw(P,F)

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