Skip to content

Signal Example — Signal Composition & Filtering

Interactive multi-signal composer demonstrating how complex waveforms are built from simple sine waves, how noise affects a signal, and how filters shape the frequency content.

Signal Example 2

What it shows

RowPlotDescription
1–3Signal 1–3Individual sine waves (y-axes linked for direct amplitude comparison)
4NoiseAdditive Gaussian noise
5Combined SignalSum of all signals plus noise; a red overlay shows the filtered version when a filter is active
6Frequency DomainPower spectrum (amplitude²) of the combined signal (or the filtered signal when a filter is active)

The x-axes of all five time-domain plots are linked — panning or zooming one panel updates all of them simultaneously. The y-axes of Signal 1–3 are also linked, so amplitude changes remain visually comparable across all three.

Things to Try

  • Start with a single signal (Amp > 0 for Signal 1 only) and observe its clean spectral peak.

  • Add a second frequency to show how signals superpose in the time domain and produce two peaks in the spectrum.

  • Increase noise and watch the spectral floor rise until the signal peaks are buried — a direct illustration of the signal-to-noise problem in EEG.

  • Enable the LP filter and sweep its cutoff to demonstrate how filtering removes high-frequency content while preserving low-frequency structure.

  • Enable the HP filter and set a low cutoff (e.g. 0.1–1 Hz) to show how slow drifts are removed — a common preprocessing step in EEG.

Controls

Each signal row has its own frequency, amplitude, and phase controls in the left panel.

ControlRangeDescription
Freq (×3)0–80 HzFrequency of each sine wave
Amp (×3)0–10Amplitude of each sine wave
Phase (×3)−π to πPhase offset of each sine wave
Noise0–2Standard deviation of additive Gaussian noise
☐ LP Filter0–100 HzLow-pass filter cutoff
☐ HP Filter0–2 HzHigh-pass filter cutoff (typical EEG values: 0.1–1 Hz)

See Also

Code

julia
using EegFun
EegFun.signal_example_composition()