Lesson 06 • Real-Time Analysis, Stimuli & Non-Linearity
Lesson 6 — RTA, Signal Generator and Distortion
Log sweeps deconvolve linear room transfer functions, but they are the wrong instrument for live EQ iteration, background-noise rating, CEA-2010 limit testing, and sub-−100 dB electronics characterization. This lesson covers REW’s FFT/RTA engine, periodic vs. random excitation, coherent averaging, calibrated SPL logging, Signal Generator stimulus engineering, and rigorous distortion interpretation across sweeps, live tones, multitone, and Stepped Sine.
01 • Engineering Rationale
What this is for
In professional acoustic and electroacoustic workflows, a logarithmic sine sweep is not universally optimal. Sweeps excel at high-SNR linear transfer-function extraction and time-windowed reflection analysis, yet they break down or become inefficient in five daily scenarios where the RTA, Signal Generator, and SPL Meter/Logger take over:
- Zero-latency live EQ and boundary tuning: Paired with Pink Periodic Noise matched to the FFT length, the RTA delivers a stationary, low-variance fractional-octave response (up to 1/48 octave) that updates continuously as you move a subwoofer, adjust trim, or sweep a parametric filter.
-
Separating harmonic non-linearity from noise, hum, and mechanical buzz: A log sweep only reports harmonic distortion (up to the 9th harmonic) and THD over a frequency-rising noise floor. The RTA Distortion Panel and Stepped Sine engine expose
THD+N,N(non-harmonic distortion + noise),N+D,TD+N,IMD,SNR, andENOB—letting you immediately tell whether a −60 dB floor is driver excursion, mains hum, cabinet rattle, or DAC quantization error. - High-precision low-distortion bench characterization: With dither enabled, Rectangular windowing on bin-locked tones, and coherent averaging, REW pushes uncorrelated measurement noise far below the harmonic floor—making Stepped Sine and Multitone viable for verifying preamps, DACs, DSP crossovers, and amplifier clipping thresholds.
- Standardized compliance and limit testing: Built-in 1-octave NC / NR / NCB / PNC room-noise rating curves, CEA-2010 subwoofer burst overlays, CTA-2034 filtered noise, and J-test digital jitter stimuli eliminate external test-CD dependencies.
-
Continuous acoustic monitoring and exposure logging: The SPL Meter and SPL Logger track instantaneous SPL,
Leq,SEL, and peak/overload history across A, C, and Z weightings—essential for thermal compression verification, long-term room noise profiling, and repeatable level control across measurement sessions.
Boundary Condition: What the RTA Cannot Do
An RTA displays the combined steady-state energy of source plus room reflections. It does not compute a transfer function or impulse response, cannot apply IR time windowing, and cannot separate direct sound from early boundary cancellations. Use the RTA for live magnitude convergence, stationary noise/rating checks, and non-linear stimulus analysis; always return to timed log sweeps when phase, excess group delay, ETC, or crossover time alignment matters.
macOS Bench & Live RTA Reality Check
On macOS, REW runs exclusively on Java audio drivers (no ASIO or WASAPI exclusive), and REW’s internal volume sliders are disabled. Before opening the RTA or Signal Generator for calibrated distortion work, lock your interface to 24-bit (or 32-bit if exposed) and the target sample rate in Audio MIDI Setup (44.1/48 kHz for acoustic work; up to 192 kHz—or higher up to 1536 kHz hardware-dependent in REW V5.30+—for wide-bandwidth electronics harmonics). Manage analog gain exclusively via Audio MIDI Setup or the interface hardware mixer, and never change sample rate without re-verifying your soundcard calibration file.
02 • Concrete REW Procedures
Steps
Execute the three workflows below according to the measurement objective. Do not reuse a stationary periodic-noise RTA configuration for asynchronous moving-mic work or ultra-low-THD electronics testing—windowing, FFT length, dither, and averaging rules change fundamentally between tasks.
Workflow A — Live Stationary RTA with Pink Periodic Noise (Zero-Leakage Tuning)
- Confirm clock topology first: Verify in Preferences → Soundcard that input and output reside on the same physical audio interface (shared master clock). If using a USB measurement mic with a separate DAC/AVR output, skip to the asynchronous branch in Step 4.
- Open the RTA window (Cmd+Alt+R or toolbar RTA) and click the Controls gear icon.
-
Select display mode and resolution:
Choose RTA 1/12 octave (or 1/24 / 1/48 octave) for EQ shaping, 1/3 octave for broadband spectral balance, 1 octave if overlaying room noise curves (
PNC,NCB,NC,NR), or Spectrum for narrowband bin inspection (spurs, mains hum, harmonics). -
Lock FFT length and window function:
- Single-clock periodic workflow: Set FFT Length to
64k(0.73 Hz/bin at 48 kHz; 1.37 s frame) or32k(1.46 Hz/bin; faster visual response). Set Window to Rectangular. Set Averaging toNoneor a shortExponentialconstant. - Separate-clock / USB mic or Moving Mic workflow: Set Window to Hann (never Rectangular), enable high Max Overlap (e.g. 50%–75%+), and switch Averaging to Forever (or long RMS/Exponential averaging) to drive down random-signal variance.
- Single-clock periodic workflow: Set FFT Length to
-
Configure the Signal Generator: Open Generator, select the Noise group, and pick Pink Periodic Noise (single-clock) or Pink Random Noise (dual-clock / moving mic). For Pink Periodic Noise, set its Sequence Length to match the RTA’s exact FFT length (
64k↔64k). Set output level conservatively (e.g.,−20 dBFSto−12 dBFS) and verify headroom in Level Meters so peaks never clip. - Start playback and capture: Start the Signal Generator, press the red Record button in the RTA window, optionally enable the Peak trace to catch transient excursions, and click Save Current whenever you want to push a snapshot directly into REW’s main measurement list for overlay comparison.
Workflow B — Calibrated SPL Meter & SPL Logger Configuration
-
Verify SPL calibration chain: Confirm your USB mic calibration file includes its
Sens Factor = ...header (or your analog rig is calibrated against an external SPL meter/calibrator, or carries a knownSensitivity -XX.XX dBFSoffset). Remember that any gain change in Audio MIDI Setup or on an analog preamp invalidates SPL calibration. - Open SPL Meter: Select weighting—C-weighting for subwoofer/broadband system checks, A-weighting for perceived noise floor and compliance, or Z-weighting (unweighted) for true sub-bass and flat acoustic energy.
- Select time constant and high-pass: Choose Slow (1 s) for steady-state calibration noise or Fast (125 ms) for dynamic program material/bursts. Engage the High-Pass filter if infrasonic HVAC rumble contaminates A/C readings. Monitor Min / Max / Peak, Leq, SEL, and the Overload indicator.
-
Launch SPL Logger for time-series capture: Click Logger from the SPL Meter panel. Start logging to record
SPL,Min/Max,Peak,Leq, andSELcontinuously over time (e.g., tracking 15-minute background noise or thermal compression during high-SPL testing). - Export records: Stop logging and click Save to text to archive timestamped SPL/Leq/SEL logs for client reports or post-processing.
Workflow C — High-Precision Distortion Analysis (Live RTA & Stepped Sine)
- Establish the electrical floor first (electronics or rig verification): For voltage-referenced bench testing, calibrate FS sine Vrms in Soundcard preferences so the RTA and Distortion Panel display calibrated Vrms / dBu / dBV alongside dBFS. Loop output to input (phantom power OFF, direct monitoring MUTED) to verify your interface’s native THD+N floor before attaching the DUT.
-
Configure the Signal Generator stimulus:
- Single-tone THD / THD+N / ENOB: Select Tones → Sine, enable Lock frequency to RTA FFT (bin-centered fundamental), and enable Dither (mandatory for clean low-level distortion testing).
- Intermodulation (IMD): Select Dual tone, Triple tone, or Quad tone (e.g., SMPTE 60 Hz + 7 kHz or CCIF 19 kHz + 20 kHz).
- Broadband complex non-linearity (TD+N): Select Multitone with Linear, Octave, Decade, or NID spacing.
- Digital jitter: Select Tones → J-test.
- Subwoofer max clean output: Select Tones → CEA-2010 burst and enable the CEA-2010 overlay in the RTA window.
-
Open the RTA Distortion Panel: Switch the RTA mode to Spectrum, choose an appropriate FFT length (
32k–128k+ depending on low-frequency bin separation and desired FFT processing gain), select Rectangular window for bin-locked single-clock tones (or a low-sidelobe window if clocks are asynchronous), and open the Distortion readout panel. - Engage Coherent Averaging when measuring harmonics near the noise floor: In RTA controls, enable Coherent averaging. REW phase-aligns each FFT frame to the fundamental before averaging, suppressing uncorrelated noise while preserving phase-locked harmonic distortion components.
-
Run Stepped Sine for frequency- or level-swept precision: Open the Stepped Sine dialog inside the RTA window. Choose Stepped Sine vs Frequency (or vs Level), set start/end frequency, points per octave (PPO), settle time, FFT length, and averages. Run the measurement to generate a full main-window Distortion graph containing fundamental, harmonics H2–H9,
THD,THD+N, andN—completely free of the rising noise floor inherent to log-sweep distortion.
open -a REW.app --args -api
curl -s http://127.0.0.1:4735/rta/levels
curl -s http://127.0.0.1:4735/spl-meter/1/levels
curl -s http://127.0.0.1:4735/stepped-measurement/progress
03 • Diagnostic Interpretation
Reading the output
Raw RTA traces and distortion percentages mislead quickly if you ignore stimulus spectral slope, FFT bin gain, noise-floor masking, or the distinction between harmonic and non-harmonic energy. Read every plot through both its spectral shape and its underlying mathematical estimator.
RTA & Stimulus Slope Laws
Before interpreting any spectral tilt in the RTA window, verify the pairing between display mode and stimulus:
| Stimulus | Energy Distribution | Appearance in Narrowband Spectrum (FFT Bins) | Appearance in Fractional-Octave RTA | Primary Use Case |
|---|---|---|---|---|
| Pink Periodic Noise | Equal energy / octave (repeats every N samples) |
Slopes down −3 dB/octave | Flat (0 dB/oct), zero frame-to-frame jitter when bin-locked | Live stationary EQ adjustment, fast loudspeaker magnitude checks on single-clock rigs |
| Pink Random Noise | Equal energy / octave (stochastic) | Slopes down −3 dB/octave (high variance without avg) | Flat after temporal/spatial averaging | Moving Mic Measurement (MMM), dual-clock (USB mic + AVR) live tuning |
| White Periodic / Random | Equal energy / Hz | Flat (0 dB/oct) | Slopes up +3 dB/octave | High-frequency tweeter/electronics bandwidth checks (mind HF driver thermal limits) |
| CTA-2034 / Speaker & Sub Cal | Band-limited / weighted pink noise | Band-limited −3 dB/oct slope | Band-limited flat passband | Calibrated channel-level matching without exciting out-of-band roll-offs |
Distortion Panel & Distortion Graph Metrics — Exact Engineering Meanings
| Metric | Definition | Stimulus Context | Diagnostic Interpretation |
|---|---|---|---|
| H2 – H9 | Individual harmonic components (2nd through 9th order) | Log Sweep, Live Sine, Stepped Sine | Dominant H2 indicates asymmetric non-linearity (suspension/Bl offset, single-ended stage). Dominant H3 / H5 signals symmetric clipping, excursion/motor limit, or crossover/port overload. |
| THD | Root-sum-square of harmonics relative to fundamental | Log Sweep, Live Sine, Stepped Sine | Pure harmonic distortion only. Blind to mains hum, thermal noise, quantization spurs, or mechanical rattles that are not integer multiples of f1. |
| THD+N | Harmonics plus all in-band noise and non-harmonic distortion | Live Sine (RTA), Stepped Sine | Gold-standard single-figure fidelity metric for electronics. If THD+N ≫ THD, your limitation is noise, hum, or non-harmonic spurs—not harmonic non-linearity. |
| N | Noise and non-harmonic distortion (fundamental & harmonics removed) | Live Sine (RTA), Stepped Sine | Isolates broadband noise floor, 50/60 Hz power-supply hum, clock spurs, and cabinet/room buzzes independent of harmonic orders. |
| N+D | A-weighted noise plus distortion | Live Sine (RTA) | Perceptually weighted noise + distortion; depresses low-frequency mains hum/rumble relative to midrange audibility. |
| TD+N | Total Distortion plus Noise across all non-stimulus bins | Multitone (Linear, Octave, Decade, NID) | Captures simultaneous harmonic and intermodulation products across the entire passband in one real-time frame. |
| IMD | Intermodulation Distortion sum/difference sidebands | Dual, Triple, or Quad tone | Exposes Doppler distortion in multi-way drivers and high-frequency slew/non-linearity that single-tone THD misses when harmonics fall above Nyquist. |
| SNR / ENOB | Signal-to-Noise Ratio; Effective Number of Bits | Live Sine (RTA) | ENOB translates THD+N (SINAD) into equivalent ideal converter resolution: ENOB = (SINAD_dB − 1.76) / 6.02. A 24-bit interface with −104 dB THD+N delivers ~17.0 effective bits. |
Fast Diagnostic Checklist: Valid Data vs. Measurement Artifacts
- Valid harmonic trace: H2/H3 sit at least 10–15 dB above the plotted noise floor, scale predictably when drive level increases by +6 dB (typically H2 rises ~+6 dB relative to fundamental in weakly non-linear regimes, H3 ~+12 dB), and disappear when the signal is verified in electrical loopback.
- Noise-floor masking (false distortion): A harmonic trace smoothly mirrors the upward slope of the log-sweep noise floor above 1–2 kHz, or drops by 6 dB in relative terms when you raise playback SPL by 6 dB. You are reading ambient/preamp noise, not DUT distortion—switch to Stepped Sine or increase sweep length (+3 dB SNR per doubling).
- Mic capsule or ADC overload masquerading as speaker THD: Sudden, sharp onset of high-order odd harmonics (H3, H5, H7, H9) across the band while input headroom drops near 0 dB or the SPL Meter overload indicator trips. Verify input headroom is green (6–40 dB) and check mic max-SPL rating before condemning the driver.
- Spectral leakage “skirts” inflating THD+N and N: Broad skirts around a sine peak or blurred low-frequency bins when using a Rectangular window on a non-bin-locked tone or dual-clock USB mic setup. Either lock the generator frequency to the RTA FFT on a shared clock or switch to a Hann/low-sidelobe window.
-
Room noise compliance & CEA-2010 pass/fail: In 1-octave RTA mode, read the highest curve tangent across octave bands for
NC / NR / NCB / PNCroom rating. During subwoofer burst testing, use the CEA-2010 overlay with the Peak trace active so REW automatically checks each harmonic against the CEA-2010 threshold at peak burst level.
04 • Advanced Theory & Edge Cases
Deeper detail
Deeper Detail • DSP & Electroacoustics FFT Mathematics, Periodic Clock Synchrony, Coherent Averaging, Farina Deconvolution & Stimulus Engineering
1. FFT Resolution, Windowing Trade-offs & Dual-Clock Failure Modes
REW’s RTA computes an N-point FFT whose linear bin spacing is fixed by
Δf = fs / N. At fs = 48 kHz, a 64k
(65,536-sample) FFT provides Δf = 0.732 Hz and spans 1.365 s per
frame. Increasing N improves frequency resolution and lowers the per-bin broadband noise
floor by 3 dB per doubling (FFT processing gain), while proportionally slowing time
responsiveness.
Why Pink Periodic Noise + Rectangular Window works—and exactly when it fails:
A Periodic Noise sequence of length N is mathematically periodic over the exact FFT capture
frame: every sinusoid comprising the noise executes an integer number of cycles inside the frame. Under a
Rectangular window (no taper), the Dirichlet kernel nulls land identically on every
adjacent FFT bin, yielding zero spectral leakage, zero scalloping loss, and deterministic
bin magnitudes on the very first complete steady-state frame.
However, this exact bin orthogonality requires zero sample-clock drift between DAC and ADC. On macOS, Java drivers allow separate input and output devices (for instance, HDMI out to an AVR paired with a USB UMIK-1). Two independent crystal oscillators typically differ by 20–100 ppm. At 10 kHz, a 50 ppm clock offset shifts the received frequency by 0.5 Hz—more than half an FFT bin in a 64k capture—destroying bin alignment, injecting spectral leakage skirts, and corrupting Rectangular-window amplitude accuracy. Whenever DAC and ADC do not share a clock (or the microphone is in motion), abandon Rectangular windowing: apply a tapered window (e.g., Hann), enable overlap, and average.
2. Coherent Averaging Mechanics
Standard magnitude (RMS) averaging reduces the variance (jitter) of the noise floor, making the noise line smoother, but it does not lower the mean noise floor level—a harmonic buried 3 dB below the bin noise floor stays buried forever under RMS averaging.
Coherent averaging solves this in the complex frequency domain: REW locks to the phase
of the fundamental tone in each FFT frame, rotates the complex harmonic bins accordingly, and averages
complex vectors across M frames. Phase-coherent harmonics sum linearly in amplitude
(+20·log10(M)), whereas uncorrelated random noise sums only in power
(+10·log10(M)). Normalized to the fundamental, the noise floor drops by
3 dB per doubling of coherent averages (e.g., 16 coherent averages → −12 dB
noise-floor reduction; 64 averages → −18 dB).
Operational caveat: Coherent averaging only preserves signals strictly phase-locked to the
fundamental. Uncorrelated interference (e.g., 60 Hz mains hum when testing with a 1 kHz tone)
will also attenuate during coherent averaging—so always inspect both non-coherent Spectrum (for true
N and mains spurs) and coherently averaged Spectrum (for ultra-low harmonic floors).
3. Why Log-Sweep Distortion Has a Rising Noise Floor vs. Stepped Sine
During a logarithmic sine sweep from f1 to f2 over
duration T, the sweep spends equal time per octave—meaning its energy density matches pink
noise (−3 dB/octave). When REW deconvolves the recorded sweep with the inverse
filter to produce the impulse response, Farina’s property cleanly maps the k-th harmonic
to a negative arrival time ahead of t = 0:
Δt_k = − T · ln(k) / ln(f2 / f1)
Because the inverse deconvolution filter must boost high frequencies at +3 dB/octave to
flatten the pink-weighted sweep into a white impulse, any flat white noise floor in the ADC, preamp, or
room is tilted upward at +3 dB/octave in the deconvolved spectrum. Moreover, at
higher harmonic orders (H4–H9), the spacing ln(k+1) − ln(k) shrinks rapidly,
causing adjacent harmonic impulse responses—and their room-reverb tails—to overlap in negative time unless
sweep length is very long.
Stepped Sine avoids deconvolution entirely: at each discrete frequency step, the
generator outputs a full-power steady-state sinusoid and the RTA evaluates a narrowband FFT around the
fundamental and its harmonics. The measurement noise floor remains flat across frequency,
harmonic bins cannot cross-contaminate via IR tail overlap, and REW computes full THD+N and
N alongside H2–H9. The only cost is measurement time.
4. Signal Generator Stimulus Engineering & Dither Discipline
- Mandatory Dither for Low-Distortion Tests: Truncating a digital sine or multitone to 16-bit or 24-bit without dither produces quantization error strongly correlated with the signal, manifesting as artificial harmonic distortion spikes and spurs in the RTA. Enable Dither in the Signal Generator for all distortion and loopback characterization.
-
Multitone Spacing (Linear, Octave, Decade, NID): Linear spacing crowds high-frequency
visual resolution; Octave and Decade spacing balance log-axis coverage. NID spacing
positions tones to minimize coincident harmonic/intermodulation bin overlaps, allowing clean separation
of
TD+Nacross the audio band in a single capture. Watch crest factor: summing dozens of tones dramatically increases peak-to-RMS ratio, requiring lower RMS level to stay clear of digital FS. -
Dual / Triple / Quad Tone IMD: High-frequency single-tone THD tests fail above
fs / 6(8 kHz at 48 kHz) because H3 exceeds Nyquist and is removed by the anti-aliasing filter. A dual-tone test (e.g., 19 kHz + 20 kHz) places the 2nd-order difference product at 1 kHz and 3rd-order products at 18 kHz / 21 kHz—squarely inside the audio passband. - Why Tone Bursts & CEA-2010 Bursts Are Not Low-THD Stimuli: Short-duration bursts (like CEA-2010 6.5-cycle shaped bursts) are engineered to test peak mechanical/thermal subwoofer output without melting voice coils. Their short temporal envelope inherently broadens spectral width in the FFT, restricting dynamic range for ultra-low distortion measurements. Use bursts exclusively for high-SPL limit testing with the CEA-2010 overlay.
- Companion Live Diagnostics: Keep Relative Gain and Phase open when checking inter-channel gain/phase tracking at the generator frequency, Scope (CH1, CH2, Math) open to visually catch asymmetric clipping or DC offset before it damages a driver, and Frequency Meter to verify actual received sample-clock frequency on dual-clock rigs.
05 • End-to-End Field Procedure
Worked example
Goal: A powered two-way studio monitor exhibits subtle mid-bass “grittiness” above
moderate monitoring levels. Determine whether the defect originates from the audio interface/preamp path,
woofer mechanical non-linearity (H2 vs. H3), cabinet resonance/buzz (non-harmonic N), or
crossover-region intermodulation—and quantify the monitor’s clean SPL ceiling.
Steps
-
Establish the electrical rig floor (Loopback baseline): Disconnect mic, disable 48 V phantom power, mute direct monitoring, and connect interface Output 1 → Input 1. In Generator, select 1 kHz Sine at
−3 dBFS, enable Lock frequency to RTA FFT, and enable Dither. In RTA, select Spectrum,64kFFT, Rectangular window, and open the Distortion Panel. Confirm interface loopbackTHD+N < −95 dB(ENOB > 15.5) and check for 60/120 Hz spurs inN. -
Verify room background noise floor: Reconnect the mic at 0.5 m, switch RTA to 1 octave mode, enable NC noise curve overlay, and mute the generator. Confirm ambient noise sits below
NC-25(ensuring adequate acoustic SNR at 85 dB SPL). -
Set repeatable SPL with SPL Meter & Logger: Play Pink Periodic Noise (
64k, matching RTA FFT) and open SPL Meter (Z-weighted, Slow) + SPL Logger. Adjust monitor input trim / interface mixer to hit 85.0 dB SPL while maintaining 18–24 dB input headroom in Level Meters. Start the SPL Logger to track drift during testing. - Run baseline 256k Log Sweep (fast overview): Measure 30 Hz–20 kHz at 85 dB SPL. Inspect the main Distortion graph: note any H2/H3 rises below 300 Hz and verify where the rising sweep noise floor begins masking H3/H5 (typically above 1.5–3 kHz).
-
Run Stepped Sine at 85 dB and 95 dB SPL: Open RTA → Stepped Sine (40 Hz–10 kHz, 12 PPO,
32kFFT, Rectangular window, dither ON, 4 coherent averages). Run first at 85 dB SPL, then increase output by +10 dB (95 dB SPL) while watching SPL Meter overload and Scope for waveform clipping. CompareH2,H3,THD,THD+N, andNbetween both levels in Overlays → Distortion. -
Targeted live RTA + Dual-Tone IMD probe at the anomaly: Park the Signal Generator on a single sine at the worst low-mid frequency identified by Stepped Sine (e.g., 115 Hz) in live RTA Spectrum mode to inspect
Nvs.THD. Then switch to Dual Tone (115 Hz + 1.2 kHz, 4:1 ratio) to quantify sidebandIMDat 95 dB SPL.
Expected Output
| Test Stage | THD | THD+N | N (Noise / Non-Harmonic) | Dominant Spectral Feature |
|---|---|---|---|---|
| 1. Electrical Loopback (1 kHz, −3 dBFS) | −104.2 dB (0.0006%) | −98.6 dB (0.0012%) | −99.9 dB (ENOB 16.1) | Clean rig floor; no 60/120 Hz ground-loop spurs |
| 2. Stepped Sine @ 85 dB SPL (115 Hz) | −46.5 dB (0.47%) | −45.8 dB (0.51%) | −54.1 dB | H2 (−47.2 dB) > H3 (−55.0 dB); smooth acoustic behavior |
| 3. Stepped Sine @ 95 dB SPL (115 Hz) | −32.1 dB (2.48%) | −27.4 dB (4.27%) | −29.2 dB (spiked +24.9 dB!) | H3 jumps +19 dB (−36 dB), PLUS non-harmonic spray between 600 Hz–2.5 kHz |
| 4. Stepped Sine @ 95 dB SPL (3 kHz) | −58.4 dB (0.12%) | −55.0 dB (0.18%) | −57.7 dB | Stepped Sine reveals true clean tweeter (Log Sweep falsely showed −44 dB due to rising floor) |
| 5. Dual-Tone IMD (115 Hz + 1.2 kHz @ 95 dB) | — |