explaingit

z-yiwei/signal-playground

25TypeScriptAudience · researcherComplexity · 3/5ActiveLicenseSetup · easy

TLDR

A browser tool for learning signals and DSP where you type a LaTeX expression and see the time-domain signal plus one of eleven transforms like DFT, STFT, or Laplace.

Mindmap

mindmap
  root((signal-playground))
    Inputs
      LaTeX expression
      Sliders
      Window choice
    Outputs
      Time-domain plot
      Frequency plot
      Transform card
    Use Cases
      Teach DSP basics
      Explore aliasing
      Inspect spectra
    Tech Stack
      TypeScript
      Vite
      Plotly
      KaTeX

Things people build with this

USE CASE 1

Plot the spectrum of a custom LaTeX-defined signal in the browser

USE CASE 2

Demonstrate aliasing or beat frequency from the built-in teaching presets

USE CASE 3

Compare windowing effects using Hann, Hamming, or Blackman on the same signal

USE CASE 4

Self-host the static demo on GitHub Pages for a class

Tech stack

TypeScriptVitePlotlyKaTeXmathjs

Getting it running

Difficulty · easy Time to first run · 5min

Runs entirely in the browser with no backend, so the only setup is opening the live demo or running Vite locally.

MIT licensed: free to use, modify, and ship commercially as long as the copyright notice stays in the source.

In plain English

Signal Playground is a browser-based tool for learning and playing with signals and their frequency spectra. It is aimed at students and researchers in electrical engineering and computer science who study topics like signals and systems or digital signal processing. The author points out that most textbooks only show static plots and most online tools either hide the math or hide the controls, so this project tries to sit between those two extremes. There is a live demo hosted on GitHub Pages. The user defines a signal by typing a LaTeX expression such as sin(2 pi 5 t) + e^(-t). The page renders the formula with KaTeX, evaluates it with mathjs, and immediately shows the time-domain signal and the chosen transform. You can switch between continuous signals x(t) and discrete signals x[n], and the list of available transforms filters itself to match. Eleven transforms are built in, including DFT and FFT, DTFT, DFS, DCT-II, DST-I, CTFT, CTFS, STFT, Hilbert, Z-transform, and Laplace. Four window functions are available: rectangular, Hann, Hamming, and Blackman. The interface includes a cheatsheet drawer with definitions, properties, and common transform pairs, plus a card for each transform that shows its math, input requirements, output meaning, and common pitfalls. Each parameter has both a slider for rough control and a numeric textbox for precise values, and the textbox accepts values outside the slider range. Ten teaching presets cover aliasing, beat frequency, square-wave spectra, chirp spectrograms, DCT energy compaction, and similar topics. The project is built with Vite and TypeScript, uses Plotly for the plots and KaTeX for the math, runs entirely in the browser with no backend, and is released under the MIT license.

Copy-paste prompts

Prompt 1
Add a new transform card for the Wavelet transform to signal-playground
Prompt 2
Add an export button that downloads the current time and frequency plots as PNGs
Prompt 3
Wire up a URL-state encoder so a signal expression can be shared via link
Prompt 4
Add a noise generator preset that mixes Gaussian noise into the input signal
Prompt 5
Replace mathjs with a faster custom parser for the LaTeX expression evaluator
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.