# ADC & DAC Converter API
> ADC/DAC data-converter maths as an API, computed locally and deterministically. The resolution endpoint turns a bit depth into the number of quantization levels (2^N), the LSB step for a given reference voltage (in V, mV and µV), the full-scale range, the ideal signal-to-noise ratio (6.02·N + 1.76 dB) and dynamic range, and — given an input voltage — the digital output code. The sampling endpoint covers Nyquist: the minimum sample rate for a signal bandwidth (2·f_max), the Nyquist frequency for a sample rate (fs/2), whether a signal is adequately sampled, and the alias frequency a tone folds to, |f_in − round(f_in/fs)·fs|. The quantization endpoint gives the maximum quantization error (LSB/2), the rms quantization noise (LSB/√12), the ideal SNR, and the effective number of bits (ENOB = (SNR − 1.76)/6.02) from a measured SNR. Everything is computed locally and deterministically, so it is instant and private. Ideal for embedded, DSP, audio and instrumentation app developers, data-acquisition and converter-selection tools, and electronics education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is data-converter & sampling maths; for media bitrate and file size use a bitrate API and for AC reactance and resonance use a resonance API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/adc-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 40,000 calls/Mo, 8 req/s
- **Pro** ($24/Mo) — 250,000 calls/Mo, 25 req/s
- **Mega** ($75/Mo) — 1,500,000 calls/Mo, 80 req/s

## Endpoints

### Converter

#### `GET /v1/quantization` — Quantization & ENOB

**Parameters:**
- `bits` (query, optional, string) — Bit depth N Example: `12`
- `vref` (query, optional, string) — Reference voltage (V) Example: `5`
- `measured_snr_db` (query, optional, string) — Measured SNR (dB) for ENOB Example: `70`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/adc-api/v1/quantization?bits=12&vref=5&measured_snr_db=70"
```

**Response:**
```json
{
    "data": {
        "note": "Max quantization error = LSB/2, rms noise = LSB/√12. ENOB = (SNR − 1.76)/6.02.",
        "lsb_v": 0.001220703125,
        "inputs": {
            "bits": 12,
            "vref_v": 5,
            "measured_snr_db": 70
        },
        "enob_bits": 11.3355,
        "ideal_snr_db": 74,
        "max_quantization_error_v": 0.000610351563,
        "rms_quantization_noise_v": 0.000352386639
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:09.838Z",
        "request_id": "86495119-ad7b-4f0c-8332-75654763e48a"
    },
    "status": "ok",
    "message": "Quantization",
    "success": true
}
```

#### `GET /v1/resolution` — Bit resolution

**Parameters:**
- `bits` (query, required, string) — Bit depth N Example: `12`
- `vref` (query, optional, string) — Reference voltage (V) for LSB Example: `5`
- `voltage` (query, optional, string) — Input voltage (V) to get the code Example: `2.5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/adc-api/v1/resolution?bits=12&vref=5&voltage=2.5"
```

**Response:**
```json
{
    "data": {
        "note": "levels = 2^N, LSB = Vref/2^N, ideal SNR = 6.02·N + 1.76 dB.",
        "lsb_v": 0.001220703125,
        "inputs": {
            "bits": 12,
            "vref_v": 5
        },
        "levels": 4096,
        "lsb_mv": 1.220703125,
        "lsb_uv": 1220.703125,
        "max_code": 4095,
        "output_code": 2048,
        "full_scale_v": 5,
        "ideal_snr_db": 74,
        "input_voltage_v": 2.5,
        "dynamic_range_db": 72.2472
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:09.951Z",
        "request_id": "e9290bd4-f9b8-4883-aa89-6ea1962020af"
    },
    "status": "ok",
    "message": "Resolution",
    "success": true
}
```

#### `GET /v1/sampling` — Nyquist & aliasing

**Parameters:**
- `max_frequency` (query, optional, string) — Highest signal frequency (Hz) Example: `20000`
- `sample_rate` (query, optional, string) — Sample rate fs (Hz) Example: `44100`
- `input_frequency` (query, optional, string) — Input tone (Hz) for the alias Example: `30000`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/adc-api/v1/sampling?max_frequency=20000&sample_rate=44100&input_frequency=30000"
```

**Response:**
```json
{
    "data": {
        "note": "Nyquist: sample at ≥ 2× the highest signal frequency. A tone above fs/2 folds to |fin − round(fin/fs)·fs|.",
        "inputs": {
            "sample_rate_hz": 44100,
            "max_frequency_hz": 20000,
            "input_frequency_hz": 30000
        },
        "aliased": true,
        "nyquist_rate_hz": 40000,
        "adequately_sampled": true,
        "alias_frequency_hz": 14100,
        "nyquist_frequency_hz": 22050
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:10.079Z",
        "request_id": "3a84fa4c-466e-4789-90ef-c546b1135671"
    },
    "status": "ok",
    "message": "Sampling/Nyquist",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/adc-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Bits are whole numbers; voltages in volts, frequencies in hertz. Vref is optional — supply it to get LSB and quantization figures.",
        "service": "adc-api",
        "formulae": {
            "lsb": "Vref / 2^N",
            "enob": "(SNR − 1.76) / 6.02",
            "alias": "|f_in − round(f_in/fs)·fs|",
            "levels": "2^N",
            "ideal_snr": "6.02·N + 1.76 dB",
            "nyquist_rate": "2 · f_max",
            "rms_quantization_noise": "LSB / √12"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/sampling": "Nyquist rate, Nyquist frequency and alias frequency.",
            "GET /v1/resolution": "Bits → levels, LSB step, full-scale range, ideal SNR and the code for a voltage.",
            "GET /v1/quantization": "Quantization error/noise, ideal SNR and ENOB from a measured SNR."
        },
        "description": "ADC/DAC data-converter calculator: bit resolution (levels, LSB, ideal SNR, dynamic range), Nyquist sampling and aliasing, and quantization error / noise / ENOB."
    },
    "meta": {
        "timestamp": "2026-06-04T18:38:10.186Z",
        "request_id": "6f1e244f-74af-44e2-b31d-d76ee383f938"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/adc-api
OpenAPI spec: https://www.oanor.com/api/adc-api/openapi.json
