blah blah blah

Theory of Operations

TODO: add figures from lecture notes.


Figure [fig-quantization-psd]. Quantization power spectral density


Figure [fig-quantization-adc]. Quantization analog-to-digital conversion.


Figure [fig-quantization-compander]. Quantization compression/expansion (compand)

#include <liquid/liquid.h>

int main() {
    unsigned int num_bits    =      4;
    float        mu          = 255.0f;
    unsigned int num_samples =     64;

    // input sample
    float x = 0.7f;

    // compress sample
    float v = compress_mulaw(x,mu);

    // quantize: analog to digital converter
    unsigned int q = quantize_adc(v,num_bits);

    // quantize: digital to analog converter
    float u = quantize_dac(q,num_bits);

    // expand sample
    float y = expand_mulaw(u,mu);

    // compute error
    float e = y - x;

    return 0;