Skip to main content

Dead-simple, ultra-fast signal processing in C

Project description

doppler

Dead-simple, ultra-fast digital signal processing.

CI Docs PyPI Python License: MIT C99 Rust uv Ruff

doppler is a lean C99 signal processing library built for one goal: maximum throughput with minimum friction — from any language. The full DSP stack lives in one portable core with paper-thin Python bindings and a Rust FFI. No runtime surprises, no framework lock-in.

What's inside

  • NCO — 32-bit phase accumulator, 2¹⁶-entry LUT, AVX-512 batch generation, FM ctrl port
  • FIR filter — AVX-512 complex taps, CI8/CI16/CI32/CF32 input types
  • FFT — 1D and 2D, selectable backend (FFTW or pocketfft)
  • Polyphase resampler — continuously-variable rate, Kaiser-designed bank; DPMFS variant (608 B, L1-resident) for cache-sensitive pipelines
  • Halfband decimator — dedicated 2:1 decimator exploiting halfband symmetry; 375 MSa/s at 60 dB attenuation
  • SIMD arithmetic — SSE2/AVX2 complex multiply via dp_c16_mul
  • Signal streaming — low-latency ZMQ transport (PUB/SUB, PUSH/PULL, REQ/REP)
  • Circular buffers — double-mapped ring buffers for zero-copy, lock-free IPC (F32/F64/I16)
  • Multi-language — clean C ABI; Python bindings (NCO, FFT, streaming, buffers) and Rust FFI

Benchmarks

Measured on AMD Ryzen AI 7 350, Release build (-O3 -march=native). Re-run any suite with make blazing then the binary listed below.

NCO (dp_nco_*)

block=1 048 576 samples × 200 iterations./build/c/bench_nco_c

Rank Variant MSa/s Notes
🥇 u32 20 341 Raw phase only — store + add, no LUT
🥈 u32_ovf 3 028 Raw phase + carry bit (ADD + SETB)
🥉 cf32 2 094 Free-running IQ — AVX-512 16-wide gather
4 u32_ovf_ctrl 1 424 FM ctrl + raw phase + carry
5 u32_ctrl 1 095 FM ctrl + raw phase
6 cf32_ctrl 525 FM ctrl + IQ — LUT + ctrl overhead

FIR (dp_fir_execute_*)

taps=19 block=409 600 samples × 100 iterations./build/c/bench_fir_c

Input type MSa/s Notes
CI8 317 8-bit complex integer input
CF32 280 32-bit complex float input
CI16 235 16-bit complex integer input

Halfband decimator (dp_hbdecim_cf32)

block=65 536 samples × 400 iterations./build/c/bench_hbdecim_c

N taps Attenuation MSa/s (input)
10 40 dB 540
19 60 dB 375
37 80 dB 201
73 80 dB 105

The halfband structure halves the FIR multiply count by exploiting coefficient symmetry; the pure-delay branch costs one multiply instead of N.

FFT (dp_fft*)

FFTW backend, estimate plan, 1 thread, complex double — ./build/c/bench_fft_c

1D (fft1d_execute / fft1d_execute_inplace)

Size Out-of-place MSa/s In-place MSa/s
1 024 925 757
4 096 474 379
16 384 146 139

2D (fft2d_execute / fft2d_execute_inplace)

Size Out-of-place MSa/s In-place MSa/s
64 × 64 722 616
128 × 128 252 241
256 × 256 33 30

Ring buffer (dp_f32 / dp_f64)

Lock-free SPSC, 268 M samples, batch=4096 — ./build/c/bench_buffer_c

Type MSa/s GB/s
f32 (8 B/sample) 5 129 38.2
f64 (16 B/sample) 2 401 35.8

Quick example

C:

#include <doppler.h>
#include <dp/fft.h>
#include <complex.h>

size_t shape[] = {1024};
dp_fft_global_setup(shape, 1, -1, 1, "estimate", NULL);

double complex in[1024], out[1024];
/* ... fill in[] ... */
dp_fft1d_execute(in, out);

Python:

from doppler.fft import fft
import numpy as np

x = np.random.randn(1024) + 1j * np.random.randn(1024)
spectrum = fft(x)

Documentation

Full docs at doppler-dsp.github.io/doppler

Document Contents
Quick Start Build, install, run the examples (Docker quickstart included)
Build Guide CMake options, platform notes, Python setup, Docker details
Overview Architecture and full API reference
Examples C and Python code examples - FFT, SIMD, streaming

| CLAUDE.md | Development notes and project context (for contributors) |

Build

make          # build (Linux/macOS; MSYS2 on Windows)
make test     # run CTest suite

Or with Python bindings:

make && uv sync

See Build Guide for platform-specific instructions and all CMake options.

Licensing

The doppler source code is MIT-licensed.

If built with FFTW support (default), the resulting binary links against FFTW, which is licensed under the GNU General Public License (GPL). In this case, the distributed binary is covered by the GPL.

If built with -DUSE_FFTW=OFF, the pocketfft backend is used instead. pocketfft is BSD-3-Clause-licensed (see POCKETFFT_LICENSE) which is compatible with the MIT-license and so the resulting binary remains MIT-licensed with BSD-3-Clause licensed FFT features.

See Build Guide for details and the installed LICENSE files.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

doppler_dsp-0.2.7-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

doppler_dsp-0.2.7-cp313-cp313-macosx_14_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

doppler_dsp-0.2.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

doppler_dsp-0.2.7-cp312-cp312-macosx_14_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

File details

Details for the file doppler_dsp-0.2.7-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for doppler_dsp-0.2.7-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 00ea7e369b0a49d09c0b54039bde978cc8bccbe4e975f295ef1e59176e4ac404
MD5 96366ac603208dcc9565e184b0a86c84
BLAKE2b-256 076bedb6560548f2291b0e8fec7eb162e0d8b31dc5fe9133b5cbc7d95abbd489

See more details on using hashes here.

Provenance

The following attestation bundles were made for doppler_dsp-0.2.7-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on doppler-dsp/doppler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file doppler_dsp-0.2.7-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for doppler_dsp-0.2.7-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c595b6a8b0d6880baa8436163edba5810fa157ab11cd8c4dd008989e8e60b014
MD5 1c6941f3bb1b472d22b2301d2675e515
BLAKE2b-256 afde9bc420ecb5465b89b73a3db1f8f9ce9afdd5a376db8114c9c9201af27748

See more details on using hashes here.

Provenance

The following attestation bundles were made for doppler_dsp-0.2.7-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: release.yml on doppler-dsp/doppler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file doppler_dsp-0.2.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for doppler_dsp-0.2.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6798a0189df2d060d20795f4df84afa0fbaf4f9317c8496dc3b87b665b3b7ce9
MD5 125d065729bedbbd13d02e06939c3bde
BLAKE2b-256 5967cd59e1967a8906636ebcad033cba00eb5c198ca1f739e521ed6fad0887b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for doppler_dsp-0.2.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on doppler-dsp/doppler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file doppler_dsp-0.2.7-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for doppler_dsp-0.2.7-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 96c1fb224d42d55099d065aa5e6c93032796b019eee0c69ac4e8968b3e9e3baf
MD5 114721105cde45c6647956bea29a3c93
BLAKE2b-256 3f60fd63110ab6d670d5c11b1ceab2c66f81afd76862a00cbaeeac290295b775

See more details on using hashes here.

Provenance

The following attestation bundles were made for doppler_dsp-0.2.7-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: release.yml on doppler-dsp/doppler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page