quantizer

caf_verilog.quantizer.bin_num(n, n_bits)[source]

Produce a signed representation of the number n using n_bits.

Parameters:
  • n – Number n

  • n_bits – Number of bits

Returns:

caf_verilog.quantizer.get_max(data)[source]

Get the maximum value of the array that can be used for the -Xmax to Xmax range.

Parameters:

data

Returns:

caf_verilog.quantizer.is_complex(data)[source]

Test whether the data has a complex value in it or not.

Parameters:

data

Returns:

caf_verilog.quantizer.quantize(data, n_bits, n_bits_imag=0)[source]

Quantize the data into a range from -X to X within the n_bits size limit.

Parameters:
  • data – Data list to quantize

  • n_bits – Real bits

  • n_bits_imag – Imaginary bits

Returns:

caf_verilog.quantizer.scale(data, n_bits, x_max, use_complex=False)[source]

Takes values and scales them to the max of the n_bits limit.

Parameters:
  • data

  • n_bits

  • x_max

Returns: