toi
The intersection point of the third order.
| Library |
|
Syntax
Function call
-
oip3,fundpow,fundfreq,imodpow,imodfreq = toi(___)— also returns powerfundpowand the frequenciesfundfreqthe two main sinusoids. It also returns powerimodpowand the frequenciesimodfreqthe 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.
| Типы данных |
|
#
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.
| Типы данных |
|
# 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.
| Типы данных |
|
# 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.
| Типы данных |
|
# 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.
| Типы данных |
|
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.
| Типы данных |
|
# 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.
| Типы данных |
|
# 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.
| Типы данных |
|
# 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.
| Типы данных |
|
# 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.
| Типы данных |
|
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
-
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.