Engee documentation

toi

The intersection point of the third order.

Library

EngeeDSP

Syntax

Function call

  • oip3 = toi(x) — returns the Third-Order Intercept point (TOI) at the output, in decibels (dB), of the real sinusoidal two-tone input signal x. The calculation is performed using a periodogram of the same length as the input signal using a Kaiser window with .

  • oip3 = toi(x,fs) — sets the sampling rate fs. Meaning fs the default value is 1.

  • oip3 = toi(pxx,f,"psd") — sets the input signal as a one-way spectral power density (SPM) pxx a real signal. Argument f — frequency vector corresponding to the vector of estimates pxx.

  • oip3 = toi(sxx,f,rbw,"power") — sets the input signal as a one-way power spectrum sxx a real signal. Argument rbw — the frequency resolution in which each power estimate is integrated.

  • oip3,fundpow,fundfreq,imodpow,imodfreq = toi(___) — also returns power fundpow and the frequencies fundfreq the two main sinusoids. It also returns power imodpow and the frequencies imodfreq the lower and upper intermodulation components. In this syntax, you can use any input arguments from the previous syntax options.

  • toi(___, out=:plot) — plots the signal spectrum and annotates the lower and upper main components and intermodulation components . The higher harmonics and intermodulation components are not marked. TOI is displayed above the chart.

Arguments

Input arguments

# x is a real sinusoidal two—tone signal

+ vector

Details

A real sinusoidal two-tone signal defined as a row vector or column vector.

Типы данных

Float64, Float32

# fs — sampling rate
1 (default) | 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 the unit of time is seconds, then the sampling frequency is measured in hertz.

Типы данных

Float64, Float32

# pxx — unilateral assessment of SPM

+ vector

Details

A one-sided estimate of the power spectral density, given as a real non-negative row vector or column vector.

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

Типы данных

Float64, Float32

# f — cyclic frequencies

+ vector

Details

Cyclic frequencies corresponding to a one-sided SPM assessment pxx, specified as a row vector or column vector. The first element f must be equal to 0.

Типы данных

Float64, Float32

# sxx — power spectrum

+ vector

Details

The power spectrum, defined as a non-negative real row vector or column vector.

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

Типы данных

Float64, Float32

# rbw — frequency resolution

+ scalar

Details

Frequency resolution, set as a positive scalar. The frequency resolution is the product of the frequency resolution of the discrete Fourier transform and the equivalent noise bandwidth of the window.

Типы данных

Float64, Float32

Output arguments

# oip3 is the intersection point of the third order

+ scalar

Details

The output intersection point of the third order of a sinusoidal two-tone signal, returned as a real scalar expressed in dB. If the second fundamental tone is the second harmonic of the first fundamental tone, then the lower part of the intermodulation component is at zero frequency. In such cases, the function returns NaN.

Типы данных

Float64, Float32

# fundpow — the power of the main sinusoids

+ vector string

Details

The power contained in the two main sinusoids of the input signal, returned as a two-element real vector string.

Типы данных

Float64, Float32

# fundfreq — frequencies of the main sinusoids

+ vector string

Details

The frequencies of the two main sinusoids of the input signal, returned as a two-element real vector string.

Типы данных

Float64, Float32

# imodpow — power of intermodulation components

+ vector string

Details

The power contained in the lower and upper intermodulation components of the input signal, returned as a two-element real vector string.

Типы данных

Float64, Float32

# imodfreq — frequencies of intermodulation components

+ vector string

Details

The frequencies of the lower and upper intermodulation components of the input signal, returned as a two-element real vector string.

Типы данных

Float64, Float32

Examples

The intersection point of the third order of a two-tone nonlinear signal with noise

Details

Let’s create a two-tone sinusoid with frequencies kHz and kHz, sampled with frequency 48 kHz. Let’s make the signal nonlinear by applying it to a polynomial. Add some noise. Let’s set the default settings of the random number generator to get reproducible results. Calculate the intersection point of the third order. Let’s make sure that intermodulation components occur at frequencies kHz and kHz.

import EngeeDSP.Functions: polyval, randn, toi

using Random
Random.seed!(123)

fi1 = 5e3
fi2 = 6e3
Fs = 48e3
N = 1000
x = sin.(2π * fi1 / Fs * (1:N)) + sin.(2π * fi2 / Fs * (1:N))
y = polyval([0.5e-3 1e-7 0.1 3e-3], x) + 1e-5 * randn(1, N)

myTOI, Pfund, Ffund, Pim3, Fim3 = toi(y, Fs)
println("myTOI = ", myTOI)
println("Fim3 = ", Fim3)
myTOI = 1.3977501986380254
Fim3 = [4000.196234482638 6999.864782145359]

Literature

  1. Kundert, Kenneth S. «Accurate and Rapid Measurement of IP2 and IP3.» Designer’s Guide Community. May, 2002. https://designers-guide.org/analysis/intercept-point.pdf.