Arbab Latif

DSP Copilot: LLM Agent for Signal Processing

An LLM agent that does signal processing on your CSV or WAV files. Ask in plain English, for example to remove 50 Hz hum and show the spectrum. It chooses the tools, runs them, plots the results and explains what it did.

View the code on GitHubFull results

live requests passed, measured on the output signals
6 of 6
heart rate from a synthetic ECG with a true rate of 72
72.0 bpm
automated tests
46
Amplitude spectrum of an ECG before and after removing 50 Hz hum
Spectrum before and after the agent removed 50 Hz hum from a synthetic ECG.

Problem

Routine signal analysis needs specialist knowledge: which filter to use, how to set it, and how to tell whether it worked. A general chatbot can talk about this, but it cannot touch your data and may invent numbers.

Approach

  • The language model plans and explains, and it does no maths.
  • The model can call 8 fixed tools and never writes or runs code. Numbers come from NumPy and SciPy.
  • Arguments are checked first, so a cutoff above Nyquist goes back to the model as an error it can correct.
  • Signals stay local: the model sees summaries and results, never the samples.
  • The interface lists every call with its arguments, result and plots.

Results

  • Checks measure the signals the agent actually produced, not what it says it did.
  • The first live run also scored 6 of 6, yet two answers were wrong. Reading the answers by hand exposed four problems, all traced to how the tools reported results or handled input.
  • The lesson: passing checks on the output does not validate the explanation.

Limitations

  • Six requests, one run each, all on clean synthetic signals.
  • Explanations are not fully machine-checked, so trust the tool trace over the prose.
  • Only Gemini has been tested live.
  • This is not a medical device. The ECG is synthetic and the heart-rate tool is a demonstration.

Built with

  • Python
  • NumPy
  • SciPy
  • Streamlit
  • Tool calling
  • Gemini
  • Anthropic
  • OpenAI

Related projects