Module quantum_inferno.synth.synthetic_signals
This module constructs synthetic signals
Functions
def antialias_half_nyquist(synth: numpy.ndarray, filter_order: int = 4) ‑> numpy.ndarray
-
Antialiasing filter with -3dB at 1/4 of sample rate, 1/2 of Nyquist
:param synth: array with signal data :param filter_order: sets decay rate :return: numpy array with anti-aliased signal
def chirp_linear_in_noise(snr_bits: float, sample_rate_hz: float, duration_s: float, frequency_start_hz: float, frequency_end_hz: float, intro_s: Union[float, int], outro_s: Union[float, int]) ‑> Tuple[numpy.ndarray, numpy.ndarray]
-
Construct chirp with linear frequency sweep, white noise added.
:param snr_bits: number of bits below signal standard deviation :param sample_rate_hz: sample rate in Hz :param duration_s: duration of chirp in seconds :param frequency_start_hz: start frequency in Hz :param frequency_end_hz: end frequency in Hz :param intro_s: number of seconds before chirp :param outro_s: number of seconds after chirp :return: numpy ndarray with waveform, numpy ndarray with time in seconds
def chirp_noise_16bit(duration_points: int = 4096, sample_rate_hz: float = 80.0, noise_std_loss_bits: float = 4.0, frequency_center_hz: Optional[float] = None) ‑> numpy.ndarray
-
Construct chirp with linear frequency sweep, white noise added, anti-aliased filter applied
:param duration_points: number of points, length of signal. Default is 2 ** 12 :param sample_rate_hz: sample rate in Hz. Default is 80.0 :param noise_std_loss_bits: number of bits below signal standard deviation. Default is 4.0 :param frequency_center_hz: Optional center frequency fc in Hz. Default None :return: numpy ndarray with anti-aliased chirp with white noise
def frequency_algebraic_nth(frequency_geometric: numpy.ndarray, band_order_nth: float) ‑> numpy.ndarray
-
Compute algebraic frequencies in band order
:param frequency_geometric: geometric frequencies :param band_order_nth: Nth order of constant Q bands :return: algebraic frequencies from band order
def gabor_grain_frequencies(frequency_order_input: float, frequency_low_input: float, frequency_high_input: float, frequency_sample_rate_input: float, frequency_base_input: float = 2.0, frequency_ref_input: float = 1.0) ‑> Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
-
Frequencies for g-chirps
:param frequency_order_input: Nth order :param frequency_low_input: lowest frequency of interest :param frequency_high_input: highest frequency of interest :param frequency_sample_rate_input: sample rate :param frequency_base_input: G2 or G3. Default is G2 :param frequency_ref_input: reference frequency. Default is 1.0 :return: numpy arrays of center, start and end frequencies
def sawtooth_doppler_noise_16bit(phase_radians: numpy.ndarray, noise_std_loss_bits: float = 4.0) ‑> numpy.ndarray
-
Construct an anti-aliased sawtooth waveform with white noise
:param phase_radians: time-varying phase in radians :param noise_std_loss_bits: number of bits below signal standard deviation. Default is 4.0 :return: numpy ndarray with anti-aliased sawtooth signal with white noise
def sawtooth_noise_16bit(duration_points: int = 4096, sample_rate_hz: float = 80.0, noise_std_loss_bits: float = 4.0, frequency_center_hz: Optional[float] = None) ‑> numpy.ndarray
-
Construct an anti-aliased sawtooth waveform with white noise
:param duration_points: number of points, length of signal. Default is 2 ** 12 :param sample_rate_hz: sample rate in Hz. Default is 80.0 :param noise_std_loss_bits: number of bits below signal standard deviation. Default is 4.0 :param frequency_center_hz: Optional center frequency fc in Hz. Default None :return: numpy ndarray with anti-aliased sawtooth signal with white noise
def taper_tukey(sig_or_time: numpy.ndarray, fraction_cosine: float) ‑> numpy.ndarray
-
Constructs a symmetric Tukey window with the same dimensions as a time or signal numpy array. fraction_cosine = 0 is a rectangular window, 1 is a Hann window
:param sig_or_time: input signal or time :param fraction_cosine: fraction of the window inside the cosine tapered window, shared between the head and tail :return: tukey taper window amplitude
def white_noise_fbits(sig: numpy.ndarray, std_bit_loss: float) ‑> numpy.ndarray
-
Compute white noise with zero mean and standard deviation that is snr_bits below the input signal
:param sig: detrended input signal :param std_bit_loss: number of bits below signal standard deviation :return: gaussian noise with zero mean