FFTScope Block
Frequency spectrum analyser — shows overlaid FFT magnitude of one or more signals
Open FFTScope in BlockWerk →# FFT Scope
Description
The FFT Scope displays the frequency spectrum of one or more signals using the Fast Fourier Transform (FFT). It is a sink block — it has no output ports and does not affect simulation results.
Connect up to several signal lines to the single Signal input port. All connected signals are analysed simultaneously and displayed as overlaid, color-coded spectra.
Typical uses:
- Identify the dominant frequency of an oscillator or controller output
- Verify that a filter attenuates the correct frequency band
- Detect harmonics and spectral leakage from non-linear systems
- Inspect the phase relationship between two signals
---
Display Modes
Use Display Mode to switch the Y-axis scale:
| Mode | Y-axis | Best for | | ---------------------- | --------------------------- | ------------------------------------------------------------ | | Magnitude (dB) | Logarithmic (dB) | General-purpose; highlights weak peaks alongside strong ones | | Magnitude (linear) | Linear amplitude | Comparing raw amplitude ratios | | Phase (°) | Phase angle, −180° to +180° | Inspecting the phase of each frequency component |
> Tip: In Phase mode, the tooltip still shows the dB magnitude so you can verify that a phase reading comes from a real spectral peak rather than noise.
---
Analysis Modes
| Mode | When it runs | Frequency resolution | | ----------------------------- | -------------------------------------------- | ---------------------------------- | | Window — last N samples | Live (during simulation) and post-simulation | sampleRate / fftSize Hz/bin | | Full record — all samples | Post-simulation only | sampleRate / totalSamples Hz/bin |
Use Full record when your signal contains very low frequencies. For example, if the simulation runs for 100 s at 100 Hz, Full record gives 0.01 Hz resolution compared to 0.098 Hz for a 1024-point window.
The FFT size parameter is hidden in Full record mode because it is not used.
---
Parameters
| Parameter | Default | Description | | ---------------------- | -------------------- | ------------------------------------------------------------------- | | Title | Frequency Spectrum | Label shown in the block header | | Display Mode | Magnitude (dB) | Y-axis scale: dB, linear, or phase | | Analysis Mode | Window | Whether to use a rolling window or the full simulation record | | FFT Window Size | 1024 | Samples per FFT (256 / 512 / 1024 / 2048). Only used in Window mode | | Max Frequency (Hz) | 0 | Upper frequency limit; 0 = auto (Nyquist = sampleRate / 2) |
Advanced Options
These parameters are found under the Advanced tab in the block's properties panel:
| Parameter | Default | Description | | ------------------- | ------- | ----------------------------------------------------------------------------- | | Window Function | Hann | Spectral window applied before the FFT to reduce leakage | | Peak Hold | off | When enabled, a dashed line marks the per-bin maximum seen so far | | Show Legend | on | Show a signal-color legend (only visible when multiple signals are connected) | | Show Grid | on | Draw grid lines on the plot |
---
Window Functions
The window function is multiplied with the time-domain signal before the FFT to reduce spectral leakage — the smearing of energy from a strong peak into neighboring bins.
| Window | Leakage | Main-lobe width | Choose when… | | --------------- | -------- | --------------- | --------------------------------------------------------- | | Hann | Low | Moderate | Default; good balance for most signals | | Hamming | Very low | Slightly wider | Narrow-band sinusoids | | Blackman | Minimal | Wide | Precise amplitude measurement of a single tone | | Rectangular | High | Narrowest | Transient or burst signals where leakage is not a concern |
---
Frequency Resolution
The spacing between adjacent bins (the minimum frequency difference the FFT can distinguish) is:
Δf = sampleRate / fftSize (Window mode)
Δf = sampleRate / N (Full record mode, where N = total recorded samples)
Example: At 1 000 Hz sample rate with a 1024-point FFT:
Δf = 1000 / 1024 ≈ 0.98 Hz/bin
To resolve two tones separated by 1 Hz you need at least 1 000 samples.
---
Toolbar
Hover over the block to reveal the toolbar (top-right corner):
| Button | Action | | ------ | -------------------------------------------------------------------------------------------------- | | ⏸ / ▶ | Freeze / Resume — hold the current spectrum while the simulation keeps running | | 🗑 | Clear — erase the spectrum and reset peak hold | | ⤢ | Full-screen analyzer — open an interactive uPlot-based window with zoom/pan and cursor readout |
---
Hover Tooltip
Move the mouse over the plot area to see a crosshair and tooltip:
- Frequency — exact frequency of the bin under the cursor (Hz)
- Magnitude — amplitude in dB for each signal
- Phase — phase angle in degrees (°) for each signal
Both magnitude and phase are always shown regardless of which Display Mode is active.
---
Remarks
- Window mode: Use for live frequency monitoring during simulation; the rolling FFT window updates continuously
- Full record mode: Use after simulation for maximum frequency resolution; the FFT spans the entire recorded dataset
- Windowing: The Hann window is a good default; use Blackman for precise amplitude measurements, Rectangular for transient analysis
- Nyquist limit: The maximum displayable frequency is sampleRate/2; signals above Nyquist are aliased and appear at incorrect frequencies
- Peak hold: Overlays the per-bin maximum across all FFT frames; useful for identifying the worst-case spectral content
Notes
- Frequency resolution improves with larger FFT sizes, but requires more recorded samples before a meaningful spectrum appears.
- If fewer samples have been recorded than the FFT size, the signal is zero-padded at the front (the spectrum is still computed, but with lower amplitude accuracy for those bins).
- Peak Hold is cleared automatically when a new simulation starts.
- The Nyquist frequency (
sampleRate / 2) is the highest frequency that can appear on the X-axis. Signals above Nyquist are aliased and cannot be recovered. - In Phase (°) mode: a pure sine wave at frequency _f_ starting at _t = 0_ shows a phase of −90° at that frequency bin (by DFT convention). A cosine shows 0°.