sdynpy.signal_processing.sdynpy_generator.pseudorandom

pseudorandom(fft_lines, f_nyq, signal_rms=1, min_freq=None, max_freq=None, filter_oversample=2, integration_oversample=1, averages=1, shape_function=<function <lambda>>)[source]

Creates a pseudorandom excitation given the specified signal parameters

This function creates a pseudorandom excitation from a sum of sine waves with randomized phases. The function can return shaped input if the optional shape_function argument is passed.

Parameters
  • fft_lines (int) – The number of fft lines between 0 Hz and f_nyq, inclusive.

  • f_nyq (float) – The maximum frequency. The final sampling frequency will be f_nyq x filter_oversample x integration_oversample.

  • signal_rms (float) – The RMS amplitude of the signal. Default is 1.

  • min_freq (float) – The minimum frequency of the signal. If not specified, the minimum frequency will be the first frequency line (no 0 Hz component)

  • max_freq (float) – The maximum frequency of the signal. If not specified, the maximum frequency will be the nyquist frequency f_nyq.

  • filter_oversample (float) – The oversample factor that is used by some data acquisition systems to provide bandwidth for antialiasing filters. For example, in the I-DEAS data acquisition software, the true sampling frequency is 2.56x the nyquist frequency, rather than the 2x required by the sampling theorem. If not specified, the default factor is 2x.

  • integration_oversample (int) – An oversampling factor that may be desired for integration of a signal. Default is 1

  • averages (int) – The number of averages, or frames of data to create. For a pseudorandom input, each frame will be a replica of the first.

  • shape_function (function) – A shaping that can be applied to the signal per frequency line. If specified, it should be a function that takes in one argument (the frequency in Hz) and returns a single argument (the amplitude of the sine wave at that frequency).

Returns

  • times (np.ndarray) – A 1D array containing the time of each sample

  • signal (np.ndarray) – A 1D array containing the specified signal samples.