Engee documentation

EngeeDSP.spectrumAnalyzer

Creates a spectrum analyzer object.

Library

EngeeDSP

Description

An object EngeeDSP.spectrumAnalyzer displays the frequency spectrum of the signals in the time domain. The spectrum analyzer represents the frequency spectrum in the form of a spectrum or a spectrogram. The object performs the spectrum calculation using the filter bank method and the method of averaged modified Welch periodograms. For more information, see Algorithms. The spectrum analyzer can display the signal power spectrum in three units: W, dBm and dBW. For more information about power conversion between these three units, see Transfer of power from one unit of measurement to another.

To create a spectrum analyzer object, follow these steps:

  1. Create an object EngeeDSP.spectrumAnalyzer and set its properties.

  2. Call the object with arguments as if it were a function.

To learn more about how to work with system objects, see Engee System Objects.

Syntax

Creation

scope = EngeeDSP.spectrumAnalyzer(name = value) — creates a system object EngeeDSP.spectrumAnalyzer with the specified property Name, set to the specified value Value. You can specify additional arguments as a name-value pair in any order (Name1=Value1,…,NameN=ValueN).

Using

  • scope(signal) — displays the frequency spectrum of the input signal signal in the time domain in the spectrum analyzer.

    scope(signal)
  • scope(signal1,signal2,…​,signalN) — displays the frequency spectrum of multiple input signals signal1,signal2,…​,signalN in the time domain in the spectrum analyzer. Each signal is interpreted as a separate channel.

    scope(signal1,signal2,signal3)

Arguments

Input arguments

signal — input signal

+ scalar | vector | the matrix

Details

An input signal or visualization signals specified as a scalar, vector, or matrix. The number of channels in each signal can be different, but the frame size of each signal must be the same.

Типы данных

Float64, Float32, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64

Support for complex numbers

Yes

Features

# Size — chart sizes

Details

The graph sizes are set as a tuple of integers, for example, (800, 600).

# FFTLength — FFT length
Int64 integer

Details

The length of the FFT that the spectrum analyzer uses to calculate the spectrum is set as a positive integer.

Dependencies

To use this property, specify FFTLengthSource = "property".

# YLimits — axis limits

Details

Axis limits they are set as a tuple of real numbers. Default value (-80, 20).

# CenterFrequency — the central frequency for calculating the spectrum
Real number

Details

The center of the frequency range in which the spectrum is calculated and plotted is set as a real scalar in Hz. The total frequency range determined by Span and by this property, it must be within Nyquist frequency range.

Dependencies

To use this property, specify FrequencySpan = "span-and-center-frequency".

# TimeSpanSource — the source of the time interval of the spectrogram
String

Details

The source of the time interval of the spectrogram. Possible values:

  • "auto" — the spectrogram displays 100 lines of the spectrogram at any given time.

  • "property" — the spectrogram uses the duration in seconds specified in the property TimeSpan.

The specified time interval must be at least twice as long as the duration of the number of samples required to update the spectrum.

# FrequencySpan — frequency range mode
String

Details

Frequency range mode. Possible values:

# FrequencyScale — scale for frequency display
String

Details

Scale to display the frequency. Possible values:

  • "linear" (default) — use a linear scale to display frequencies along the axis ;

  • "log" — use a logarithmic scale to display frequencies along the axis .

You cannot assign a value to this property. "log" If the value is PlotAsTwoSidedSpectrum = true.

# FrequencyResolutionMethod — the method of frequency resolution of the spectrum analyzer
String

Details

The method of frequency resolution of the spectrum analyzer. Possible values:

  • "rbw" (by default) — properties RBWSource and RBW the frequency resolution (in Hz) of the analyzer is controlled;

  • "num-frequency-bands" — properties FFTLengthSource and FFTLength they control the frequency resolution. This value can only be set if Method = "filter-bank";

  • "window-length" — property WindowLength controls the frequency resolution. This value can only be set if Method = "welch".

# LineWidth — line width
Real number

Details

The width of the lines on the graph, set as a positive scalar. The default value is 1.5.

# ViewType — view to display
String

Details

The view to display. Possible values:

  • "spectrum" (default) — displays the frequency spectrum of the signals;

  • "spectrogram" — display of the signal spectrogram. The spectrogram shows the change in the frequency composition of the signal over time. Each line of the spectrogram represents one periodogram.;

  • "spectrum-and-spectrogram"— Simultaneous display of the spectrum and spectrogram.

# AxesLayout — the location of the axes
String

Details

The location of the axes. Possible values:

  • "vertical" — allows you to position the spectrum above the spectrogram;

  • "horizontal" — allows you to place two views side by side.

Dependencies

To use this property, specify ViewType = "spectrum-and-spectrogram".

# PlotAsTwoSidedSpectrum — building a two-way spectrum
Logical

Details

Constructing a two-way spectrum. Possible values:

  • true (by default) — calculate and plot a two-way spectrum. If the input signal is complex, you must set this property to true;

  • false — calculate and construct a one-sided spectrum. If this property matters false, the input signal must have a real value.

If this property matters false, the spectrum analyzer uses an overlap of spectra. Axis values twice the amplitude that would have been if this property had been important. true, except for 0 and Nyquist frequencies. The one-way spectral power density (SPM) contains the full signal power in the frequency range from DC to half the Nyquist frequency.

# OverlapPercent — percentage of overlap between the previous and next data segment
Real number

Details

The percentage of overlap between the previous and current buffered data segments, specified as a scalar in the range [0,100). The overlap creates a window segment that the object uses to calculate the spectrum.

Dependencies

To use this property, specify Method = "welch".

# TimeSpan — time interval
Real number

Details

The time interval for displaying the spectrogram in seconds, set as a positive scalar. It is necessary to set a time interval at least twice as long as the duration of the number of samples required to update the spectrum.

Dependencies

To use this property, specify ViewType = "spectrogram" or ViewType = "spectrum-and-spectrogram" and TimeSpanSource = "property".

# YLabel — axis signature
String

Details

Axis signature .

# RBW — resolution band
Real number

Details

The resolution bandwidth (RBW) in Hz, set as a positive scalar. Specify a value to ensure that there are at least two RBW intervals in the specified frequency range. The ratio of the total range to RBW satisfies this condition.:

The value must be less than half of the frequency range specified by the parameter FrequencySpan.

RBW controls the spectral resolution of the displayed signal. The RBW value defines the interval between the frequencies that can be distinguished. A lower value provides higher spectral resolution and reduces noise levels. That is, the spectrum analyzer can distinguish between frequencies located closer to each other. However, this leads to an increase in the scan time.

For more information, see Resolution Band (RBW).

Dependencies

To use this property, specify RBWSource = "property".

# VBWSource — the source of the video band
String

Details

The source of the video band (video bandwidth, VBW). Possible values:

  • "auto" — the spectrum analyzer adjusts the VBW so that the equivalent forgetting coefficient is 0.9;

  • "property" — the spectrum analyzer corrects VBW using the value specified in the property VBW.

Dependencies

To use this property, specify AveragingMethod = "vbw".

# FFTLengthSource — the source of the FFT length
String

Details

The source of the FFT length. Possible values:

  • "auto" (by default) — the value FFTLength = 1024;

  • "property" — the number of FFT points is equal to the value specified in the property FFTLength.

# ShowGrid — show the grid on the graph
Logical

Details

Possible values:

  • true (by default) — show the grid.

  • false — do not show the grid.

Dependencies

To use this property, specify ViewType = "spectrum" or ViewType = "spectrum-and-spectrogram".

# Colormap — the palette of graphics
String

Details

Possible values:

  • "jet" (by default);

  • "bone";

  • "cool";

  • "copper";

  • "gray";

  • "hot";

  • "parula".

Dependencies

To use this property, specify ViewType = "spectrogram" or ViewType = "spectrum-and-spectrogram".

# ForgettingFactor — the forgetting rate
Real number

Details

The forgetting coefficient for exponential weighting averaging, set as a positive scalar in the range [0,1].

Dependencies

To use this property, specify AveragingMethod = "exponential".

# FrequencyOffset — axis offset
Real number

Details

The offset applied to the frequency axis (axis ), is set as a scalar in Hz.

The total range should be within Nyquist frequency range. You can manage the total range in various ways by setting the property FrequencySpan.

# RBWSource — frequency band source by resolution
String

Details

The source of the frequency band by resolution (resolution bandwidth, RBW). Possible values:

  • "auto" — the spectrum analyzer sets the RBW value in such a way as to provide an equivalent RBW value 1024 frequency intervals;

  • "property" — specify the resolution band directly using the RBW property.

Dependencies

To use this property, specify FrequencyResolutionMethod = "rbw".

# AveragingMethod — the spectrum averaging method
String

Details

The method of spectrum averaging. Possible values:

  • "vbw" — the video band method. The object uses a low-pass filter to smooth the curve and reduce noise. Use the properties VBWSource and VBW to specify the value of the video band.

  • "exponential" — weighted average of the counts. The object calculates the average value based on samples weighted by an exponentially decreasing forgetting coefficient. Use the property ForgettingFactor to specify a weighted forgetting rate.

For more information about averaging methods, see The averaging method.

# ColorLimits — color boundaries of the spectrogram

Details

The color boundaries of the spectrogram, defined as a tuple of real numbers. Default value (-80, 20).

Dependencies

To use this property, specify ViewType = "spectrogram" or ViewType = "spectrum-and-spectrogram".

# SpectrogramChannel — the channel for which the spectrogram is being constructed
Int64 integer

Details

The channel for which the spectrogram is being constructed is specified as a positive integer in the range [1, N], where N — the number of input channels.

Dependencies

To use this property, specify ViewType = "spectrogram" or ViewType = "spectrum-and-spectrogram".

# FullScaleSource — source of the dBFS scale factor
String

Details

The source of the dBFS scale factor. Possible values:

  • "auto" — the spectrum analyzer relies on the maximum value of the input data;

  • "property" — the property is being used FullScale.

Dependencies

To use this property, specify SpectrumUnits = "dBFS" or SpectrumUnits = "dBFS/Hz".

# SpectrumType — type of spectrum
String

Details

The type of spectrum to display. Possible values:

  • "power" (default) — power spectrum;

  • "power-density" — spectral power density. The spectral power density is the square of the amplitude of the spectrum normalized to the bandwidth. 1 Hz;

  • "rms" — the RMS value. Use this option to view the frequency of voltage or current signals.

When a new value is assigned, the value changes SpectrumUnits:

  • by "power" on "dBm";

  • by "power-density" on "dBm/Hz";

  • by "rms" on "Vrms".

# StopFrequency — the final frequency for calculating the spectrum
Real number

Details

The final frequency in the frequency range in which the spectrum analyzer calculates and plots the spectrum is given as a real scalar in Hz. The total range defined by this property and the property StartFrequency, must be within the range of Nyquist frequency range.

Dependencies

To use this property, specify FrequencySpan = "start-and-stop-frequencies".

# Title — chart signature
String

Details

The signature of the graph.

# SampleRate — Sampling rate of the input signal
Real number

Details

The sampling frequency of the input signal in Hz, set as a positive scalar.

# Span — the frequency range in which the spectrum is calculated
Real number

Details

The frequency range in which the spectrum analyzer calculates and plots the spectrum is set as a positive scalar in Hz. The total frequency range determined by CenterFrequency and by this property, it must be within Nyquist frequency range.

Dependencies

To use this property, specify FrequencySpan = "span-and-center-frequency".

# TimeResolutionSource — the time resolution source of each line of the spectrogram
String

Details

The time resolution source of each line of the spectrogram. Possible values:

  • "auto" (by default);

  • "property".

If for the parameters RBWSource and TimeResolutionSource the value is set "auto" Then RBW it is set in such a way that one frequency range contains 1024 the interval RBW. The time resolution is set to 1/RBW.

If for RBWSource the value is set "auto", and for TimeResolutionSource — value "property", then the time resolution becomes the main control element, and RBW is set to 1/TimeResolution Hz.

If for RBWSource the value is set "property", and for TimeResolutionSource — value "auto", then the main control element becomes RBW, and the time resolution is set to 1/RBW with.

If for RBWSource and TimeResolutionSource the value is set "property", then the specified time resolution value must be equal to or exceed the minimum achievable time resolution, determined by the ratio 1/RBW. Several spectrum calculations are combined into a single spectrogram line to obtain the required time resolution.

Dependencies

To use this property, specify ViewType = "spectrogram" or ViewType = "spectrum-and-spectrogram".

# ReferenceLoad — reference load for calculating power levels
Real number

Details

The load that the spectrum analyzer uses as a reference for calculating power levels is indicated as a positive scalar in ohms.

Dependencies

To use this property, specify SpectrumUnits = "dBFS" or SpectrumUnits = "dBFS/Hz".

# Method — spectrum calculation method
String

Details

The method of calculating the spectrum. Possible values:

  • "filter-bank" (by default) — using a filter bank to calculate the power spectrum. Compared to the Welch method, this method has a lower noise level, better frequency resolution, less spread of the spectrum, and requires fewer samples to update. For more information, see Spectrum Calculation — filter bank.

  • "welch" — using the method of averaged modified Welch periodograms. For more information, see Spectrum calculation — the Welch method.

When changing this property, the value FrequencyResolutionMethod changes to "rbw".

# ShowLegend — show or hide the legend on the chart
Logical

Details

Legend on the chart:

  • false (by default) — do not show the legend.

  • true — show the legend.

# LineStyle — Line type
String

Details

Possible values:

  • "-" — solid line;

  • "--" — dotted line;

  • "-." — dashed dotted line;

  • "-.." — Dashed dotted line with two dots;

  • ":" — dotted line;

# WindowLength — window length
Int64 integer

Details

The length of the window in samples that the object uses to calculate the spectrum, set as an integer greater than 2. This property controls the frequency resolution.

Dependencies

To use this property, specify Method = "welch" and FrequencyResolutionMethod = "window-length".

# VBW — the value of the video band
Real number

Details

The video band value, set as a positive scalar, is less than or equal to SampleRate/2.

Dependencies

To use this property, specify AveragingMethod = "vbw" and VBWSource = "property".

# TimeResolution — time resolution of each line of the spectrogram
Real number

Details

The time resolution of each line of the spectrogram in seconds, set as a positive scalar.

Dependencies

To use this property, specify ViewType = "spectrogram" or ViewType = "spectrum-and-spectrogram" and TimeResolutionSource = "property".

# StartFrequency — the initial frequency for calculating the spectrum
Real number

Details

The initial frequency in the frequency range in which the spectrum analyzer calculates and plots the spectrum is set as a real scalar in Hz. The total range defined by this property and StopFrequency, must be within Nyquist frequency range.

Dependencies

To use this property, specify FrequencySpan = "start-and-stop-frequencies".

# SidelobeAttenuation — attenuation of the side lobes
Real number

Details

The attenuation of the side lobes of the window in decibels (dB) is indicated as a positive scalar value greater than or equal to 45.

Dependencies

To use this property, specify Window = "chebyshev" or Window = "kaiser".

# Window — window function applied to accumulated data
String

Details

A window function applied to the accumulated data. Possible values:

  • "hann" (by default) — for more information, see hann;

  • "hamming" — for more information, see hamming;

  • "blackman-harris" — for more information, see blackmanharris;

  • "chebyshev" — for more information, see chebwin;

  • "flat-top" — for more information, see flattopwin;

  • "kaiser" — for more information, see kaiser;

  • "rectangular" — for more information, see rectwin.

Dependencies

To use this property, specify Method = "welch".

# FullScale — the full dBFS scale
Real number

Details

The full dBFS scale, set as a positive scalar.

Dependencies

To use this property, specify FullScaleSource = "property".

# SpectrumUnits — units of measurement of the spectrum
String

Details

Units of measurement of the spectrum.

Possible values:

# ShowColorbar — show or hide a colored stripe
Logical

Details

The color bar on the chart:

  • false (default) — do not show the color bar.;

  • true — show a colored stripe.

Dependencies

To use this property, specify ViewType = "spectrogram" or ViewType = "spectrum-and-spectrogram".

Methods

Common to all system objects

step!

The calculation step. Returns an object CairoMakie.Figure. You can call it in two ways:

  • direct challenge: step!(scope, args…​);

  • calling via a functor: scope(args…​).

release!

Allow changing the value of the system object property.

Specific to EngeeDSP.spectrumAnalyzer

setup!

Called at the first step, can be called directly: step!(scope, args…​).

display

Re-draw the graph.

getSpectrumData

Return the dictionary with the last displayed data. Possible keys:

  • "spectrum";

  • "spectrogram";

  • "frequencies";

  • "times".

Examples

A spectrum analyzer for a single-sided power spectrum

Details

Creating an object EngeeDSP.spectrumAnalyzer and set its properties.

import EngeeDSP:spectrumAnalyzer

Fs = 100e6

scope = spectrumAnalyzer(SampleRate=Fs,AveragingMethod="exponential",PlotAsTwoSidedSpectrum=false,RBWSource="auto",SpectrumUnits="dBW")
spectrumAnalyzer(
	SpectrumType = "power"
	ViewType = "spectrum"
	Method = "filter-bank"
	SpectrumUnits = "dBW"
	ReferenceLoad = 1
	FullScaleSource = "auto"
	FullScale = 1
	OverlapPercent = 0
	FrequencyResolutionMethod = "rbw"
	WindowLength = 1024
	RBWSource = "auto"
	RBW = 9.76
	FFTLengthSource = "auto"
	FFTLength = 1024
	SampleRate = 1.0e8
	Window = "Hann"
	SidelobeAttenuation = 60
	FrequencyOffset = 0
	FrequencySpan = "full"
	Span = 10000.0
	CenterFrequency = 0
	StartFrequency = -5000.0
	StopFrequency = 5000.0
	PlotAsTwoSidedSpectrum = false
	AveragingMethod = "exponential"
	ForgettingFactor = 0.9
	VBWSource = "auto"
	VBW = 10
	SpectrogramChannel = 1
	TimeResolutionSource = "auto"
	TimeResolution = 0.001
	TimeSpanSource = "auto"
	TimeSpan = 0.1
	Size = (800, 500)
	Title = ""
	YLabel = ""
	YLimits = "auto"
	AxesLayout = "vertical"
	ShowColorbar = true
	ShowGrid = true
	Colormap = "jet"
	ShowLegend = false
	ColorLimits = "auto"
	LineWidth = 1.5
	LineStyle = "-"
	FrequencyScale = "linear"
)

Let’s draw a one-sided power spectrum created from the sum of fixed real sinusoids with different amplitudes and frequencies.

fSz = 5000
t = (0:fSz-1)/Fs

sin1 = sin.(2π * 5e6 * t)
sin2 = 1e-1 * sin.(2π * 15e6 * t)
sin3 = 1e-2 * sin.(2π * 25e6 * t)
sin4 = 1e-3 * sin.(2π * 35e6 * t)
sin5 = 1e-4 * sin.(2π * 45e6 * t)

for idx in 1:250
    y_total = sin1 + sin2 + sin3 + sin4 + sin5 + 0.0001 * randn(fSz)
    scope(y_total)
end

scope |> display

release!(scope)

spectrumanalyzer 1

Additional Info

Transfer of power from one unit of measurement to another

Details

The spectrum analyzer provides three units for measuring spectral power density: W/Hz, dBm/Hz and dBW/Hz. The corresponding units of power measurement are W, dBm, and dBW. In electrical applications, you can also view the RMS value of a signal in V (RMS value), DBMQ, or dBV. The default spectrum type is the power in dBm.

transfer power from Watts to dBW and dBm

The power in dBW is determined by the formula:

The power in dBm is determined by the formula:

For a sinusoidal signal with an amplitude of 1 The power of the one-way spectrum in Watts is determined by the formula:



The corresponding power in dBm is calculated using the formula:





For a white noise signal, the spectrum is flat for all frequencies. Consider a white noise signal with variance 1e-4. Thus, the power per unit of bandwidth ( ) is equal to 1e-4. For a one-way spectrum in the range the total white noise power in watts is determined by the formula:



where

  • — this is the sampling frequency of the input signal;

  • is the ratio of total bandwidth to bandwidth resolution ( ).

For a one-way spectrum, the total bandwidth is half the sampling frequency. Consider the sampling rate 44100 Hz and bandwidth resolution 21.53 Hz. At these values, the total white noise power in Watts is 0.1024 Tue.

The white noise power in dBm can be calculated using the formula:



transfer power from Watts to full-scale dB

If you set the spectral units to dBFS and the full scale (FullScaleSource) to the mode "auto", then the power in dBFS it will be calculated as follows:

where

  • — power in watts;

  • for double precision and floating point signals — this is the maximum value of the input signal;

  • for fixed-point or integer signals — this is the maximum value that can be represented.

If you set the full scale (FullScaleSource) to the mode "property", then the power in dBFS it will be calculated as follows:

where — property value FullScale.

For a sinusoidal signal with an amplitude of 1 The power of the one-sided spectrum in Watts is determined by the formula:



The corresponding power in dB of full scale is calculated using the formula:



transfer power from dBm to RMS value in

The power in dBm is determined by the formula:

The voltage (RMS value) is calculated using the formula:

In the previous example equal to 26.9897 dBm. Meaning calculated as:

Algorithms

Spectrum Calculation — filter bank

Details

If for Method set the value "filter-bank" then the spectrum analyzer will use a filter bank to calculate the power spectrum.

The filter bank separates the broadband input signal with sampling rate for multiple narrowband signals with sampling rate .

Variable represents the number of frequency bands in the filter bank. In the spectrum analyzer is equal to the number of data points required to achieve the specified resolution band value (RBW) or 1024, depending on which value is greater.

After the spectrum analyzer divides the broadband input signal into several narrow bands, it calculates the power in each narrow frequency band using the following equation:

where is each value it is a calculation of power in a narrow frequency band, and — the length of the narrowband signal for .

Power values in all narrow frequency bands (denoted by ) form a vector :

The spectrum analyzer averages the current vector with previous vectors using one of the sliding averaging methods: over the video band or exponential weighting. The result of the averaging operation forms a vector for calculating the spectrum. For more information about averaging methods, see The averaging method.

spectrumanalyzer 2

The spectrum analyzer uses the RBW value (Hz) or the number of frequency bands to determine the length of the input frame.

If specified FrequencyResolutionMethod = "rbw", and for RBWSource the value is set:

  • "auto" — the spectrum analyzer determines the appropriate resolution band to ensure the presence of 1024 bandwidth resolution intervals in a given frequency range. In this case, the spectrum analyzer calculates RBW using the formula:

  • "property" — the spectrum analyzer calculates the number of samples using the formula:

    where

    • — the sampling frequency of the input signal, set by the property SampleRate in Hz;

    • — specified in RBW The value of the resolution band must be such that there are at least two RBW intervals in the specified frequency range. The ratio of the total range to RBW must be greater than two:

      ;

    • — the range in which the spectrum analyzer calculates and plots the spectrum.

If specified FrequencyResolutionMethod = "num-frequency-bands", then the resulting resolution bandwidth will be:

Spectrum calculation — the Welch method

Details

If for Method set the value "welch", then the calculation of the power spectrum is an averaged modified periodogram.

The algorithm of the spectrum analyzer consists of the following steps:

  1. Buffers the input data into data segments consisting of points. Each data segment is divided into overlapping data segments, each with a length of , overlapping on points. The data segments can be represented as follows:

    • If , then the overlap is 50%.

    • If , then the overlap is 0%.

  2. Applies a window to each of the overlapping data segments in the time domain.

    If as a resolution method FrequencyResolutionMethod value selected "window-length", then you can specify the length of the data window using the property WindowLength.

    If as a resolution method FrequencyResolutionMethod value selected "rbw", then the algorithm determines the length of the data window using the following equation: .

    It then splits the input signal into several data segments processed using the window.

    Most window functions have a greater impact on the data in the center of the segment than on the data at the edges, resulting in information loss. To reduce this loss, individual data segments are usually overlapped in time. For each segment processed using the window, a periodogram is calculated by calculating the discrete Fourier transform. Then the square of the modulus of the result is calculated and divided by :

    where is the normalization factor for the power in the window function and is defined as:

    The window can be set in the property Window.

  3. The spectrum analyzer calculates and plots the power spectrum, power spectral density, and RMS value using a modified periodogram calculation method.

    To determine the calculation of the power spectrum for the Welch method, the spectrum analyzer averages the results of the periodograms for the latter data segments. Averaging reduces the variance compared to the original one -a point segment of data. For more information about averaging methods, see The averaging method.

    • The spectrum analyzer calculates the spectral power density using:

    • The power spectrum is the product of the spectral power density and the resolution band:

    • The spectrum analyzer displays the power in the form of a spectrogram in the mode "spectrogram". Each line of the spectrogram represents a periodogram. The time resolution of each line is , which is the minimum achievable resolution. To achieve the required resolution, it may be necessary to combine several periodograms. Then, using interpolation, non-integer values are calculated. . On the spectrogram screen, time scrolls from top to bottom, so the most recent data is displayed at the top of the screen. The offset shows the time at which the center of the most recent line of the spectrogram was located.

The spectrum analyzer uses a certain number of samples to calculate the spectrum. This value is directly related to the resolution band ( ) using the following equation:

or with the length of the window ( ) using the equation:

where

If as a resolution method FrequencyResolutionMethod value selected "rbw", then the window length is determined by the formula:

If as a resolution method FrequencyResolutionMethod value selected "window-length" the algorithm uses the window length value specified in the property WindowLength.

Percentage of overlap (Op)

Details

Percentage of overlap — this is the value specified in the property OverlapPercent.

As the percentage of overlap increases, the spectrum analyzer requires fewer new input samples to calculate a new spectral update.

0%

100

50%

50

80%

20

Normalized Effective Noise Bandwidth (NENBW)

Details

Normalized Effective Noise Bandwidth, ) is a window parameter that measures the noise characteristics of the window. Meaning It is determined using the window length and its coefficients and is given by the following equation:

where denotes the vector of window coefficients, and — the length of the window. For more information about how the algorithm determines the window length, see Spectrum calculation — the Welch method.

The lowest value has a rectangular window equal to 1. All other windows are more important. . For example, the Hanna window has a value approximately 1.5.

Resolution Band (RBW)

Details

Resolution Band controls the spectral resolution of the displayed signal. Meaning defines the interval between the frequencies that the spectrum analyzer can resolve. A lower value provides higher spectral resolution and reduces noise levels, meaning the spectrum analyzer can resolve frequencies located closer to each other. However, this leads to an increase in the scan time.

The resolution band can be set using the property RBW in Hz.

If specified FrequencyResolutionMethod = "rbw", and for RBWSource the value is set:

  • "auto" — the spectrum analyzer determines the appropriate resolution band to ensure the presence of 1024 bandwidth resolution intervals in a given frequency range. In this case, the spectrum analyzer calculates RBW using the formula:

  • "property" — the spectrum analyzer calculates the number of samples using the formula:

    where

    • — the sampling frequency of the input signal, set by the property SampleRate in Hz;

    • — specified in RBW The value of the resolution band must be such that there are at least two RBW intervals in the specified frequency range. The ratio of the total range to RBW must be greater than two:

      ;

    • — the range in which the spectrum analyzer calculates and plots the spectrum.

If specified FrequencyResolutionMethod = "num-frequency-bands", then the resulting resolution bandwidth will be:

Nyquist frequency range

Details

When constructing a two-way spectrum, when PlotAsTwoSidedSpectrum = true, the Nyquist frequency range is in Hz.

When PlotAsTwoSidedSpectrum = false Nyquist frequency range in Hz.

The averaging method

Details

The spectrum analyzer calculates a moving average using one of the following methods:

  • The video band spectrum analyzer uses a low—pass filter in the time domain to smooth out noise in the signal. Video Band Filter ( ) smooths the curve and reduces noise, and the spectrum analyzer applies this filter to the data before displaying it.

    The video band is the bandwidth of a low—pass filter that a spectrum analyzer uses to average or smooth out noise in a signal before displaying it. The spectrum analyzer calculates the video band using the following formula:

    where

    • — the coefficient of forgetting;

    • — resolution band, for more information, see Resolution Band (RBW);

    • — normalized effective noise bandwidth, for more information, see Normalized Effective Noise Bandwidth (NENBW).

      The video band does not affect the noise level (noise threshold), but only increases the signal-to-noise ratio and smoothes the noise curve. When decreasing the value The signal-to-noise ratio is improving.

      The cutoff frequency of the video band filter is determined by the formula:

      where

    • — sampling rate of the input signal;

    • — the number of FFT points.

  • Exponential — The moving average algorithm uses exponential weighting to update the weights and recursively calculate the moving average for each incoming vector. using the following recursive equations:



    where

    • — the coefficient of forgetting;

    • — the weight factor applied to the current vector ;

    • — current vector ;

    • — the moving average up to the previous vector ;

    • — the influence of previous vectors on average;

    • — a moving average that includes the current vector .