aspcore.utilities

Functions

block_process_idxs(num_samples, block_size, ...)

Yields the starting index for each block, for block processing a signal

get_smallest_coprime(N)

Get the smallest value that is coprime with N

is_integer(x)

Returns True if x is an integer, False otherwise

is_power_of_2(x)

Returns True if x is a power of 2, False otherwise

next_divisible(divisor, min_value)

Gives the smallest integer divisible by divisor, that is strictly larger than min_value

next_power_of_two(x)

Returns the smallest number that is both a power of two and larger or equal to x.

power_of_filtered_signal(src, ir, num_samples)

Returns an estimate of average power of the signal after filtered through an impulse response

simplify_ratio(a, b)

Simplifies the ratio a/b into the simplest possible ratio where both numerator and denominator are integers

Classes

EventCounter(event_def)

An index counter to keep track of events that should only happen every x samples

PhaseCounter(phase_lengths[, verbose])

An index counter to keep track of non-overlapping continous phases