The RTA window allows Real Time Analyser (RTA) or spectrum analyser plots
to be generated, updating as the input signal is analysed. It is shown
by pressing the RTA button in the toolbar of the main REW window.

The RTA trace is activated by pressing the record button in the top right hand corner of the graph area, after which it will continuously analyse blocks of input samples and display the frequency spectrum of each block. Sometimes the analyser would be used without a test signal, for example to look at the frequency content of background noise, but more often it would be used together with the REW generator or an external generator or signal source. If the generator is playing a pink noise signal (or even better, pink Periodic Noise) the RTA display will show the frequency response of the room, updated live so that the effects of changing EQ settings can be immediately seen.

Playing a sine wave test tone on the generator allows the levels of the tone and its harmonics to be observed on the analyser and distortion percentages to be calculated, whilst using the dual tone generator allows intermodulation distortion measurements.

The RTA plot shows the currently selected measurement as a reference
and the live RTA or spectrum. A Peak trace is also available, which is reset
by the *Reset Averaging* button. If Inverse C compensation is being applied
the icon is shown after the trace value. If Mic/Meter calibration file or soundcard
calibration file have been loaded they are applied to the results.
The current Input RMS value is shown to the left of the record button,
in dB SPL or dBFS according to the setting of the Y axis. This figure excludes
any DC content in the signal. A and C weighted values are shown below the unweighted
rms figure. If clipping is detected in the input the RMS value turns red.

The controls for the plot are shown below.

The *Mode* can be set to Spectrum for a spectrum analyser plot or
to various RTA resolutions from 1 octave to 1/48 octave. The difference between
spectrum and RTA modes is how the information is presented. In spectrum mode
the frequency content of the signal is split up into bins that are all the
same width in Hz. For example, with a 64k FFT length and 48 kHz sample rate
the bins are 0.732 Hz wide. The plot shows the energy in each of those bins.
In RTA mode the bin widths are an octave fraction, so their width in Hz varies
with the frequency. For example, a 1 octave RTA plot has bins that are 70.7 Hz
wide at 100 Hz (from 70.7 Hz to 141.4 Hz) and 707 Hz wide at 1 kHz (from 707 Hz
to 1.414 kHz). The plot shows the combined energy at each frequency within
each bin. This is closer to how our ears perceive sound. The different presentations
mean signals with a spread of frequency content will look different on the plot.
The best known examples are white noise and pink noise. White noise has the same
energy at each frequency. On a spectrum plot, which shows the energy at each
frequency, the white noise plots as a horizontal line. On an RTA plot it
appears as a line that rises with increasing frequency, as each RTA bin gets
wider it covers more frequencies and so has more energy. The bin widths
double with each doubling of frequency so the energy also doubles, which
adds 3 dB on the logarithmic plots we use to show level. White noise sounds
quite 'hissy', we perceive it as having more energy at higher frequencies.

Pink noise has energy that falls 3 dB with each doubling of frequency. On a spectrum plot it is a line that falls at that 3 dB per octave rate, on an RTA plot it is a horizontal line as the energy in the signal is falling at the same rate as the bins are widening. We perceive pink noise as having a uniform distribution of energy with frequency.

Single tones are a special case, they will appear at the same level on either style of plot as their energy is all at one frequency, so on a spectrum plot they show as a vertical line, on an RTA plot they show (typically) as a bar of the width of the bin at their frequency, but the height of the bar is the same as the height of the line on the spectrum as all the energy is at that one frequency.

In Spectrum or RTA modes the plot can either draw lines between the centres
of the FFT bins or draw horizontal bars whose width matches the FFT bin or
RTA octave fraction width, this is controlled by the *Use bars on spectrum*
and *Use bars on RTA* check boxes.

In Spectrum mode smoothing can be applied to the trace according to the setting
of the *Smoothing* box. Smoothing is not applicable for RTA modes.

The *FFT Length* determines the basic frequency resolution of the analyser,
which is sample rate divided by FFT length. The shortest FFT is 8,192 (often
abbreviated as 8k) which is also the length of the blocks of input data that are
fed to the analyser. An 8k FFT has a frequency resolution of approximately 6Hz
for data sampled at 48kHz. As the FFT length is increased the analyser starts to
overlap its FFTs, calculating a new FFT for every block of input data. The degree
of overlap is 50% for 16k, 75% for 32k, 87.5% for 64k and 93.75% for 128k. The
overlap ensures that spectral details are not missed when a Window is applied
to the data. The maximum overlap allowed can be limited using the *Max Overlap*
control below to reduce processor loading at higher FFT lengths.

The FFT resolution is also affected by the *Window* setting. Rectangular
windows give the best frequency resolution but are only suitable when the signal
being analysed is periodic within the FFT length or if a noise signal is being
measured. The Rectangular window should always be used with the REW
periodic noise signals.
Most other signals, e.g. sine waves from the REW generator or test tones on a CD,
typically would not be periodic in the FFT length. Using a rectangular window when
analysing such a tone would generate spectral leakage, making it difficult to resolve
the frequency details - the plot below shows an example of a 1kHz tone from an
external generator with a Rectangular window.

Here is the same tone analysed with a Hann window.

The window allows the harmonics of the tone to be resolved.
However, the tradeoff is that windows cause some spreading of the signal they
are analysing, which reduces the frequency resolution. To use a rectangular window
with the REW signal generator use the generator's
Lock frequency to FFT option.

The Hann window is well suited to most measurements, offering a good tradeoff between resolution and shoulder height. If very high dynamic range needs to be resolved (very small signals close to very large signals) use the 4-term or 7-term Blackman-Harris windows. If the spectral peak amplitudes must be accurately measured use the Flat Top window, this will provide amplitude accuracy of 0.01 dB regardless of where the tone being measured falls relative to the bins of the FFT. The other windows only show the spectral amplitude accurately if the tone is exactly on the centre of an FFT bin, if the tone falls between two bins the amplitude is lower, with the maximum error occurring exactly between two bins. This maximum error is 3.92dB for the Rectangular window, 1.42dB for Hann, 0.83dB for the 4-term Blackman-Harris and 0.4dB for the 7-term Blackman-Harris.

The spectrum/RTA plot can be updated for every block of audio data that is captured from the input, overlapping sequences of the chosen FFT length. This can present a significant processor load for large FFT lengths. The processor loading can be reduced by limiting the overlap allowed using this control.

The spectrum/RTA plot is updated by default for every block of audio data that is captured from the input. This can cause a significant processor load, particularly if the RTA window is very large or for large FFT lengths. The processor loading can be reduced by updating the plot less often, which is set by the Update Interval control. An update interval of 1 redraws the trace for every block, an interval of 4 (for example) only updates the trace on every 4th block.

The Peak Hold and Peak Decay controls set how long, in seconds, a peak value is held and how quickly, in dB per second, the peak values decay. If Peak Hold is set to 0 the peak values are not held at all. If Peak Decay is set to 0 the peak trace does not decay.

The Distortion High Pass and Low Pass are used to set the lowest and highest
frequencies that will contribute to the calculation of THD and THD+N. They are
only applied when the *Enable high pass* and *Enable low pass* boxes
are selected and the *Distortion* button is pressed. Either can be enabled
individually. When they are active the region of the plot which is excluded from
the calculations will be greyed out and the THD and THD+N figures will show the range
over which they have been calculated.

The RTA plot shows the energy within each octave fraction bandwidth. As the
RTA resolution increases, from 1 octave through to 1/48 octave, the octave
fraction bandwidths decrease and, for broadband test signals such as pink noise,
the energy in each octave fraction decreases correspondingly. Whilst the RTA is
correctly showing the actual level within each octave fraction, this variation of
trace level with RTA resolution can be awkward when using the RTA with a pink PN
noise signal to adjust speaker positions or equaliser settings. The
*Adjust RTA Levels* option offsets the levels shown on the RTA plot to
compensate for both the bandwidth variation as resolution is changed and the
difference between a sweep measurement at a given sweep level and a pink PN RTA
measurement at the same level, allowing direct comparison between RTA and sweep plots.
Whilst the levels shown are not the true SPL in each octave fraction, they are more
convenient to work with. **N.B.** This option should only be used with broadband test
signals, such as pink noise or pink PN.

If this option is selected the distortion data panel includes the phase of
each harmonic relative to the fundamental.

If this option is selected the RTA uses a 64-bit FFT to process the incoming
data instead of 32-bit. This is useful when analysing purely digital 24-bit data paths
to view behaviour below -160 dBFS. It has no visible effect when analysing signals
that have an analog connection at any point along the data path or when dealing with
16-bit data, as in those cases noise and quantisation effects far exceed any numerical
limitations of 32-bit processing. Here are some examples showing the difference the
64-bit FFT makes when analysing undithered and dithered 24-bit data over an S/PDIF
loopback connection from REW's signal generator producing a 1 kHz sine wave at -20 dBFS.
Note that the 2nd harmonic spike at -173 dBFS in the dithered data appears to be an
artefact of data handling within the S/PDIF loopback connection (via Windows 10). The
vertical divisions are at 20 dB intervals, the bottom of the plot is at -220 dBFS.

The plot can be set to show the live input as it is analysed or to show
the result of averaging measurements, according to the selection
in the *Averaging* control. Selecting a number for averages results
in that many measurements being averaged to produce the result, with the oldest
measurement being removed from the average as each new measurement is added.
There are several *Exponential* averaging modes, which give greater
weighting to more recent inputs. The figure shown in the selection box
is the proportion of the old value which is retained when a new measurement
is added, the higher the figure the more heavily averaged the display becomes.
There is also a *Forever* averaging mode which averages
all measurements with equal weight since the last averaging reset.

The *Reset Averaging* button above the graph restarts the averaging
process (keyboard shortcut Alt+R). Averaging is needed when measuring with
pink noise or when there is noise in the signal being measured. Note that
if measuring a response using pink noise the best results are obtained using
REW's periodic noise
signals, which can be exported as wave files from the signal generator to
produce a test disc for the system to be measured if direct connection to
the PC running REW is not possible.

The *Save* button converts the current display into a measurement
in the measurements pane (keyboard shortcut Alt+S). It is converted in the
current mode of the analyser, so if the analyser is in Spectrum mode the
measurement shows the spectrum, if it is in RTA mode it shows the RTA result.
The saved measurements can be used as references for subsequent spectrum/RTA
measurements. If distortion data is available it is copied to the comments
area of the saved measurement.

When the *Distortion Panel* button (keyboard shortcut Alt+D) is selected
the analyser calculates and displays harmonic or intermodulation distortion figures for the
input, including THD, N (noise and non-harmonic distortion), THD+N and the
relative levels of the 2nd to 9th harmonics.

**Harmonic distortion results are only valid when the system being monitored
is driven by a sine wave at a single frequency.** If the REW signal generator
is playing a sine signal the generator frequency is used as the fundamental
frequency of the input, otherwise the highest peak is used to determine the
fundamental. The fundamental and its level are displayed. In calculating the power
for the fundamental and harmonics the energy in the FFT bins within the relevant
span of the nominal frequencies appropriate for the RTA window selection is summed
and then corrected according to the window's equivalent noise bandwidth.

The THD figure is based on the number of harmonics whose levels are displayed and is calculated from the sum of those harmonic powers relative to the power of the fundamental. Individual harmonic figures are also calculated from their power relative to the power of the fundamental. The THD+N figure is calculated from the ratio of the input power minus the fundamental power to the total input power (note that it is possible for THD+N to be lower than THD using these definitions). The N figure is calculated from ratio of THD+N minus THD to the total input power. The upper limit for data used in distortion calculations is 95% of the Nyquist frequency (i.e. 95% of half the sample rate) or the Distortion Low Pass, if enabled. The lower limit is the first FFT bin or the distortion High Pass, if enabled.

The example below shows data for a 1 kHz sine input. The positions of the harmonics
are shown on the spectrum or RTA plot. The Distortion High Pass and Distortion Low
Pass have been set to 20 Hz and 20 kHz respectively, hence results are based on
data from the span 20 Hz to 20 kHz.

**Intermodulation distortion results are only valid when the system being
monitored is driven using REW's Dual Tone
test signal.** The generator provides preset signals for SMPTE, DIN and CCIF
intermodulation measurements and a 'Custom' option allowing a user-selected pair
of frequencies at a 1:1 or 4:1 ratio. When the signals are in 1:1 ratio the IMD
figure is calculated from the level at f2-f1 (also called Difference Frequency
Distortion or DFD), the reference level for the percentage figure is **twice**
the level at f2. For signals with 4:1 ratio the IMD is calculated from the 2nd
order (d2) and 3rd order (d3) components, the reference level for the percentage
figure is the level at f2. REW displays the overall IMD figure and, where appropriate,
the individual d2 and d3 levels, labelled as follows:

Component | Freq |
---|---|

d2L | f2 - f1 |

d2H | f2 + f1 |

d3L | f2 - 2*f1 |

d3H | f2 + 2*f1 |

When the *Stepped Sine Measurement* button is pressed a dialog appears to configure
and run a stepped sine distortion measurement.

REW's signal generator is used to produce the measurement frequency. **Note**
that the currently applied signal generator settings are used, so dither will only be
applied if selected (it is selected by default and is recommended). The frequency
can be stepped in intervals of between 1 and 96 points per octave over the selected
span. To avoid scalloping loss effects the test frequencies use the closest FFT bin
frequency, that ensures the peaks of the fundamental and all harmonics are captured
in the plots.

At each frequency step all the distortion data is captured, when all points have
been captured a new measurement is generated. The levels of the fundamental (brown),
2nd harmonic (red) and 3rd harmonic (orange) are shown on the RTA graph while the
measurement progresses. If the *Stop* button is pressed a measurement is
generated from the data collected up to that point. Stepped sine measurements
typically take many minutes. The *Pause* button pauses the measurement, turning
off the signal generator. Press it again to resume the measurement. The *Back*
button removes the last point measured and re-measures it. *Back* can be used
when the measurement is running or paused. *Cancel* discards the measurement.

If *Capture spectrum at each frequency* is selected a 96 PPO log spaced copy of
the spectrum data at each measurement frequency will be captured. That spectrum data can
be viewed on the Waterfall or
Spectrogram graphs or
exported to a text file. Note that
exported spectrum data should not be used to try and calculate distortion levels as
it does not have sufficient frequency resolution to accurately calculate the energy in
each harmonic.

If *Stop measurement if excessive clipping occurs* is selected the measurement
will be stopped if more than 30% of the samples in an input block are clipped. That
corresponds to an input level about 2 dB above the clipping threshold.

The minimum start frequency depends on the FFT length and the sample rate - for example, for an 8192 point FFT and 44.1 kHz sample rate the minimum start frequency is approx 60 Hz, for a 32768-point FFT at 44.1 kHz the minimum start is approx 15 Hz. The spreading effect of the RTA window would obscure the 2nd harmonic level at frequencies lower than the minimum and prevent a valid reading of distortion. The measurement frequencies are chosen so that they correspond to bin frequencies for the selected FFT length, this prevents window scalloping loss from affecting the amplitudes of the fundamental or harmonics.

At the beginning of each measurement the noise floor is captured and used to (optionally) mask distortion results that are below the noise floor (see the distortion graph help).

The progress bar shows the approximate time remaining to complete the measurement. Stepped
sine measurements are faster when using ASIO drivers as the input and output buffers are smaller
than when using Java drivers, hence less time is required for the buffers to flush through when
changing frequency. The distortion results can be viewed on the Distortion graph. Note that, as
with the log sweep distortion measurements, **calibration files are not applied** to the stepped
sine distortion results, but they are included in the SPL values for the resulting measurement.

Although much, much slower than a log sweep the stepped sine measurement captures N (noise
and non-harmonic distortion) and THD+N (neither is available with a log sweep) and can measure
low distortion levels more accurately than a sweep, particularly at high frequencies and for higher
harmonics. This makes it well suited to measuring the distortion of electronic components. The plots
below show a soundcard loopback measurement at -12 dBFS measured with stepped sine (64k FFT, 24 ppo)
and with 8 repetitions of a 1M log sweep. Note the rise in the levels of harmonics with frequency when
measuring with the sweep. This reflects the rise in the noise floor of the device (as can be viewed with
the RTA in RTA mode), the sweep cannot separate distortion from noise as well as the stepped sine
measurement.