cbadc.utilities

Utility functions

This module contains various helpful functions to accommodate the cbadc toolbox.

Functions

byte_stream_2_control_signal(byte_stream, M)

Convert a byte stream into a control_sequence

compute_power_spectral_density(sequence[, ...])

Compute power spectral density of sequence.

control_signal_2_byte_stream(control_signal, M)

Convert a control signal into a byte stream

csv_2_control_signal(filename, M[, msb2lsb, ...])

Creates an iterator that reads a control sequence from a CSV file.

find_n_sinusoidals(spectrum, n, mask_width)

Find the n largest peaks in the spectrum and return indexes.

find_sinusoidal(spectrum, mask_width)

Find the peak in the spectrum and return indexes.

iterator_to_numpy_array(iterator, size[, L])

Convert an iterator into a numpy array

number_of_bytes_selector(M)

A helper function for selecting the right bytes settings.

pickle_dump(object_to_be_pickled, filename)

Convenience function to pickle an object.

pickle_load(filename)

Convenience function to load python object from pickled file

random_control_signal(M[, ...])

Creates a iterator producing random control signals.

read_byte_stream_from_file(filenames, M)

Generate a byte stream iterator from file

read_byte_stream_from_url(urlstring, M)

Generate a byte stream iterator from http request

show_status(iterator[, length])

Write progress to stdout using tqdm.

snr_spectrum_computation(spectrum, ...)

Compute snr from spectrum

snr_spectrum_computation_extended(spectrum, ...)

Extended spectrum computations

write_byte_stream_to_file(filename, iterator)

Write a stream into binary file.

write_byte_stream_to_files(filename, iterator)

Write a stream into a sequence of binary files of size words_per_file.

write_wave(filename, sample_rate, data)

Create wave file from data array.

Classes

FixedPoint(number_of_bits, max)

Fixed point description class.