Qu

The measurement, the analysis, and the figure — in one file.

Qu is an array language for signals, spectra and impedance. It reads what your instrument wrote, computes what you need, and produces the PDF that goes in the paper — with nothing copied by hand in between.

# A noisy tone: measure it, clean it, plot it.
fs = 1000
t  = (0 to 999) / fs
y  = sin(2 * pi * 50 * t) + 0.2 * randn(1000, seed = 1)

lp = butter(4, "low", 120, fs)
z  = filtfilt(lp, y)

theme("publication")
plot(t, z, color = "#0072BD", lw = pt(0.8))
xlabel("time $t$ [s]")
savefig("figure.pdf")

Why it exists

The usual arrangement is to prototype in one language, plot in another, and type the numbers into the manuscript by hand. Every one of those steps is a place where a result can change without anyone noticing.

One file

No transcription step

The figure is program output. Re-run it and you get the same figure, from the same data, by the same route.

Print-ready

PDF that carries its fonts

Embedded, subset fonts and real maths in labels — variables italic, operators upright, the way LaTeX sets them. Also SVG and TikZ.

Instrument data

Reads what you already have

MATLAB .mat natively, CSV with the provenance headers instruments emit, raw binary arrays and structs.

Three things it will not do

Stated so you can hold the language to them.

Never

Ignore what you wrote

A keyword argument the function does not read is an error, not something quietly dropped. Checked from the code itself, so it cannot drift.

Never

Change your variables

A function cannot write to its caller's names. Assignment binds locally; say global when you mean otherwise.

Never

Guess

Where Qu could assume or say so, it says so. A wrong answer that looks right is the failure this language is organised against.

Checked against the tools it replaces

Ports of real analyses, run on the same inputs as their reference implementations.

AnalysisReferenceResult
Per-tone impedance uncertaintyNumPy all six reported figures reproduce exactly
Kramers-Kronig fit with automatic parametersNumPy every number exact, and 4× faster
Non-negative and nonlinear least squaresSciPy matches to the digit, bounds included
Complex linear algebraNumPy matches; L·U and Q·R reproduce to 1e−12

Version 0.3.0, and honest about it. One implementation, few users, and a specification that runs ahead of the engine in places — the builtin index is the authority on what exists. It is used for real work; it has not yet been used for yours.