# heliaDSP

Signal processing for Ambiq silicon.

heliaDSP is a signal-processing library optimized for Ambiq silicon. It extends
Arm CMSIS-DSP with new operations, Ambiq's fixes, Helium kernels by default on
Cortex-M55, and compact FFT tables that reduce flash. Call the same `arm_*` functions from your
CMake, neuralSPOT-X or Zephyr firmware.

[Get started](https://ambiqai.github.io/helia-dsp/getting-started/overview/)
[Explore the functions](https://ambiqai.github.io/helia-dsp/reference/)
v

01
Filters, transforms, statisticsFIR and biquad filters, FFTs and MFCC features, matrix operations, statistics and classifiers.

02
Helium on Cortex-M551.5 to 2.7 times fewer cycles than the portable kernels on Apollo510.F32F16Q31Q15Q7

03
One build foundationCMake · neuralSPOT-X · Zephyr

See the measurements on Apollo510 ↗

Function reference ↗
Cycles and flash ↗
Helium toolchains ↗
Helium contracts ↗
Build integration ↗

Functions
From the sensor to the model's input

An application filters, transforms and summarizes its signals before a model
sees them, and often after. heliaDSP supplies that signal processing, beside
heliaCORE's neural-network kernels: the CMSIS-DSP function groups in floating
point and fixed point, with Helium kernels for many of them.

Filtering
FIR filters, including decimating, interpolating, lattice and sparse forms; biquad cascades in direct forms I and II; LMS adaptive filters; convolution and correlation.

Transforms and features
Complex and real FFTs at power-of-two lengths, MFCC features for audio front ends, and window functions.

Matrix and vector
Matrix multiplication, matrix-vector products, inverse, Cholesky and LDLᵀ decompositions, and element-wise vector arithmetic.

Statistics and classifiers
Mean, variance, RMS, extrema and entropy; vector distances; Gaussian naive Bayes and SVM classifiers.

Complex and fast math
Complex magnitude and products, sine, cosine, square root, exponential and logarithm, and quaternion operations.

Interpolation and control
Linear, bilinear and cubic-spline interpolation, and PID controllers.

[Explore the function reference](https://ambiqai.github.io/helia-dsp/reference/)
[Why heliaDSP](https://ambiqai.github.io/helia-dsp/guide/why/)

Ambiq operations
Operations CMSIS-DSP does not provide

heliaDSP adds operations under helia_* names. Each has a portable
reference implementation that defines correct output, optimized scalar and Helium
implementations checked against it, and measurements on Apollo510.

helia_dwt_*
Discrete wavelet transform
Forward and inverse periodic DWT in f32, bior4.4 and Coif5 wavelets, matching PyWavelets' periodization mode.
3.3× fewer cycles, Helium against scalar
Forward, 320 samples, six levels: 46,894 → 14,354 cycles

helia_window_stats_*
Window statistics
Count, mean, variance, RMS, minimum and maximum of an f32 window in one traversal, with an error bound for each statistic.
2.2× fewer cycles than four CMSIS-DSP calls
Mean, standard deviation, min and max of 320 samples: 2,266 → 1,011 cycles

[Explore the operations](https://ambiqai.github.io/helia-dsp/reference/)

Helium on Apollo510
Fewer cycles for the same signal chain

On targets whose CPU has Helium, the handwritten vector kernels are the default,
and ATfE 22.1.0 is the qualified compiler. Against the portable kernels compiled with GCC,
heliaDSP's previous default, the measured functions took 2.3 to 3.9 times fewer
cycles, with every output checked against a float64 reference.

FIR, 32 taps, 256 samples
3.9× fewer cycles
22,144 → 5,703 cycles

Real FFT, 2048 points
2.9× fewer cycles
105,458 → 36,065 cycles

Biquad, 4 stages, 480 samples
2.8× fewer cycles
36,653 → 13,152 cycles

Matrix-vector, 160 × 160
2.7× fewer cycles
122,635 → 45,009 cycles

f32, Apollo510 EVB at 96.6 MHz, -O2; median cycles per call. Placing the matrix in tightly coupled memory instead of shared SRAM cut the Helium matrix-vector cycles by a further 2.0 to 2.35 times, and per-length FFT initializers cut a 512-point real FFT's flash from 87.6 KB to 9.3 KB.

[View all measurements](https://ambiqai.github.io/helia-dsp/guide/measurements/)
[Toolchain requirements](https://ambiqai.github.io/helia-dsp/guide/toolchains/)
[What Helium builds require of callers](https://ambiqai.github.io/helia-dsp/guide/contracts/)

Build integration
One signal-processing library. Your build system.

Link one target, include arm_math.h and call the arm_*
functions. Every path builds the same library from the same qualified CMSIS-DSP commit.

- [CMake](https://ambiqai.github.io/helia-dsp/getting-started/cmake/): For a CMake firmware or host build. Add heliaDSP with add_subdirectory() and link helia_dsp.
- [neuralSPOT-X](https://ambiqai.github.io/helia-dsp/getting-started/neuralspot-x/): For applications built with Ambiq’s SDK. Add the helia-dsp module; the board supplies the Helium flags.
- [Zephyr](https://ambiqai.github.io/helia-dsp/getting-started/zephyr/): For Zephyr applications. Add the modules to your workspace and enable CONFIG_HELIA_DSP.
[Choose your integration](https://ambiqai.github.io/helia-dsp/getting-started/overview/)
[Relationship to CMSIS-DSP](https://ambiqai.github.io/helia-dsp/guide/cmsis-dsp-relationship/)
