sfdr
Dynamic range, free from parasitic components.
| Library |
|
Syntax
Function call
-
r = sfdr(x)— returns a dynamic range free of spurious components (Spurious-Free Dynamic Range, SFDR)rin dB of a real sinusoidal signalx. Functionsfdrcalculates the power spectrum using a modified periodogram and a Kaiser window with . The average value is subtracted fromxbefore calculating the power spectrum. The number of points used in calculating the discrete Fourier transform (DFT) is equal to the length of the signalx.
-
r = sfdr(x,fs,msd)— returns SFDR, taking into account only the parasitic components that are separated from the main (carrier) frequency by the minimum distance between the parasitic components.msd, specified in cycles/unit of time. The sampling rate isfs. If the carrier frequency isFc, then all the parasitic components in the interval(Fc−msd,Fc+msd)they are ignored.
-
r = sfdr(sxx,f,"power")— returns the SFDR of the one-way power spectrum of a real-valued signalsxx. Argumentf— a vector of frequencies corresponding to power estimates insxx. The first elementfmust be equal to0. The algorithm removes all the power, which decreases monotonously as it moves away from the constant component of the cell.
-
r = sfdr(sxx,f,msd,"power")— returns SFDR, taking into account only the parasitic components that are separated from the main (carrier) frequency by the minimum distance between the parasitic components.msd. If the carrier frequency isFc, then all the parasitic components in the interval(Fc−msd,Fc+msd)they are ignored. If the function input issfdrThe power spectrum is supplied, indicatingmsdIt can prevent high levels of side lobes from being identified as parasitic constituents.
-
sfdr(___, out=:plot)— plots the signal spectrum in the current graph window. Different colors are used to display the main component, the value of the constant component, and the rest of the spectrum. The SFDR is shaded and its value is displayed above the graph. The main harmonic and the largest parasitic component are also noted.
Arguments
Input arguments
# x is a real sinusoidal signal
+
vector string | column vector
Details
A real sinusoidal signal defined as a row vector or column vector. The average value is subtracted from x before obtaining the power spectrum for calculating SFDR.
| Типы данных |
|
#
fs —
sampling
rate
1 (by default) | positive scalar
Details
The sampling frequency of the signal in cycles/unit of time, set as a positive scalar. If the unit of time is seconds, fs measured in Hz.
| Типы данных |
|
# msd — minimum distance between parasitic components
+
0 (by default) | positive scalar
Details
The minimum number of discrete Fourier transform (DFT) bins that should be ignored when calculating SFDR, set as a positive scalar. This argument can be used to ignore parasitic components or side lobes that occur near the fundamental frequency. For example, if the carrier frequency is Fc, then all the parasitic components in the range (Fc−msd,Fc+msd) they are ignored.
| Типы данных |
|
# sxx — one-way power spectrum
+
vector-row or vector-column of positive numbers
Details
A one-way power spectrum for use in SFDR calculation, specified as a row vector or column vector.
The power spectrum should be expressed in linear units, not in decibels.
| Типы данных |
|
Output arguments
# r is a dynamic range free of parasitic components
+
the real scalar
Details
The dynamic range, free of spurious components, in dB, returned as a real scalar. The dynamic range free of parasitic components is the difference in dB between the power at the peak frequency and the power at the next highest frequency (parasitic component). If the input data is a time series, power estimates are obtained from a modified periodogram using a Hamming window. The length of the DFT used in the periodogram is equal to the length of the input signal x. If you want to use a different power spectrum as the basis for SFDR measurement, you can enter your power spectrum using the flag "power".
| Типы данных |
|
# spurpow — the power of the largest parasitic component
+
the real scalar
Details
The power of the largest parasitic component in dB, returned as a real scalar.
| Типы данных |
|
# spurfreq — frequency of the largest parasitic component
+
the real scalar
Details
The frequency of the largest parasitic component in Hz, returned as a real scalar. If the sampling frequency is not specified as an input argument, the function sfdr assumes a sampling rate 1 Hz.
| Типы данных |
|
Examples
SFDR sinusoids
Details
Define the SFDR for the tone 10 MHz with amplitude 1, sampled at the frequency 100 MHz. On the first harmonic (20 MHz) there is a parasitic component with an amplitude of .
import EngeeDSP.Functions: sfdr
deltat = 1e-8
fs = 1 / deltat
t = 0:deltat:1e-5-deltat
x = cos.(2 * π * 10e6 * t) + 3.16e-4 * cos.(2 * π * 20e6 * t)
r = sfdr(x, fs)[1]
70.00625834763413
Let’s output the spectrum of the signal. We will specify the fundamental harmonic, the value of the constant component, the parasitic component and the SFDR.
sfdr(x, fs, out=:plot)
Minimum distance between parasitic components
Details
Define the SFDR for the tone 10 MHz with amplitude 1, sampled at the frequency 100 MHz. On the first harmonic (20 MHz) there is a parasitic component with an amplitude of . Let’s skip the first harmonic using the minimum distance between the parasitic components. 11 MHz.
import EngeeDSP.Functions: sfdr
deltat = 1e-8
fs = 1 / deltat
t = 0:deltat:1e-5-deltat
x = cos.(2 * π * 10e6 * t) + 3.16e-4 * cos.(2 * π * 20e6 * t) + 0.1e-5 * cos.(2 * π * 25e6 * t)
r = sfdr(x, fs, 11e6)[1]
120.00000000390743
Let’s output the spectrum of the signal. We will specify the fundamental harmonic, the value of the constant component, the parasitic components and the SFDR.
sfdr(x, fs, 11e6, out=:plot)
Frequency and power of the largest parasitic component
Details
Let’s define the frequency in MHz of the largest parasitic component. The input signal is a tone 10 MHz with amplitude 1, sampled with frequency 100 MHz. On the first harmonic (20 MHz) there is a parasitic component with an amplitude of .
import EngeeDSP.Functions: sfdr
deltat = 1e-8
t = 0:deltat:1e-6-deltat
x = cos.(2 * π * 10e6 * t) + 3.16e-4 * cos.(2 * π * 20e6 * t)
r, spurpow, spurfreq = sfdr(x, 1 / deltat)
spur_MHz = spurfreq / 1e6
20.0
Additional Info
Distortion measurement functions
Details
Functions sfdr, sinad and snr The response of a weakly linear system excited by a sine wave is measured.
When setting the input data in the time domain, the function sfdr builds a periodogram using the Kaiser window with a large attenuation of the side lobes. To find the fundamental frequency, the algorithm searches for the largest nonzero spectral component on the periodogram. Then it calculates the central moment of all neighboring intervals, monotonically decreasing as they move away from the maximum. For detection, the main frequency must be at least in the second frequency bin. If a harmonic is located in a monotonously decreasing region next to another one, its power is considered to belong to the larger harmonic. This large harmonic may or may not be the main one. The algorithm ignores all the power, which decreases monotonously as it moves away from the constant component.
Function sfdr It fails if the fundamental frequency is not the most powerful spectral component of the signal.
Make sure that the frequency components are sufficiently spaced to take into account the width of the side lobes of the Kaiser window. If this is not possible, you can use the flag "power" and calculate the periodogram with a different window.