Qu

enob_estimate

Builtin index · Signal processing

result = enob(x, [tones=|freqs=], [fs=|rate=], [bins=], [leak=0])

Input: x, tones, fs, bins, leak · Output: result

What it is

x: a length-N real vector, same optional keywords as snr above. Returns a single number, bits — effective number of bits, inverting 6.02·bits + 1.76 on the measured SINAD. What a converter actually delivers, as opposed to what its datasheet says. enob_estimate(bits, crest_factor) is the separate closed-form estimator, documented in the next row.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = enob(x, [tones=|freqs=], [fs=|rate=], [bins=], [leak=0])
x vectorx: a length-N real vector, same optional keywords as snr above.
tones optional (default |freqs=)not documented yet
fs optional (default |rate=)not documented yet
bins optionalnot documented yet
leak optional (default 0)not documented yet
result scalar or Num
Returns a scalar Num, in bits.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

fs = 1000
n = 0:1:1023
t = n / fs
f0 = 99 * fs / 1024          # exactly 99 cycles in the record -- coherent sampling

clean = sin(2*pi*f0*t)
x = clean + 0.01 * sin(2*pi*3*f0*t) + 0.001 * randn(1024, seed=3)

r = sinad(x)     # full breakdown: r.sinad, r.enob, r.snr, r.thd, r.sfdr

print("THD  = {thd(x)} dB")
print("SNR  = {snr(x)} dB")
print("SINAD = {r.sinad} dB, ENOB = {r.enob} bits, SFDR = {sfdr(x)} dB")
print("ENOB (from thd/sinad breakdown) = {enob(x)} bits")

# closed-form estimates: what an ideal N-bit converter would show for a

# signal of a given crest factor, no record needed -- the number sinad(x)

# above is checked against. Signature is (bits, crest_factor).

est_sinad = sinad_estimate(12, sqrt(2))    # 12-bit ADC, sine-wave crest factor

est_enob  = enob_estimate(12, sqrt(2))
print("ideal 12-bit ADC: SINAD = {est_sinad} dB, ENOB = {est_enob} bits")
output
THD  = -39.98542 dB
SNR  = 56.858996 dB
SINAD = 39.897111 dB, ENOB = 6.335068 bits, SFDR = 39.986015 dB
ENOB (from thd/sinad breakdown) = 6.335068 bits
ideal 12-bit ADC: SINAD = 74 dB, ENOB = 12 bits

from signal-processing

How it works

sinad_estimate(bits, crest_factor) -- the SINAD an ideal converter of that resolution would show for a signal of that crest factor, without needing a record. SINAD ~= 6.02 N + 1.76 - 20 log10(CF / sqrt(2)) This is the estimate the measured sinad(...) exists to be checked against, and it is what makes crest factor a resolution problem: every doubling costs 6 dB, which is one bit.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.

See also

enob — documented in the same entry.