Source: GitHub
Signature¶
def sdynpy.signal_processing.sdynpy_srs.generate_windowed_random(ref_srs: numpy.ndarray, window: numpy.ndarray, sample_rate: float, gravity: float = 386.0, damping: float = 0.03, srs_type: int = 9, match_points_per_octave: float = 4.0, output_points_per_octave: float = 12.0, n_realizations: int = 1, amp_init: Optional[numpy.ndarray] = None, phase_init: Optional[numpy.ndarray] = None, iterations: int = 10, correction: float = 0.8, error_tolerance: float = 0.05, randomize_phase: bool = False, max_frequency: Optional[float] = None, seed: Optional[int] = None) -> sdynpy.signal_processing.sdynpy_srs.WindowedRandomResultsGenerate an ensemble of windowed random time histories matched to a target SRS.
Parameters¶
ref_srs : ndarray Target SRS breakpoint array with shape
(n_breakpoints, 2). The first column is frequency and the second is amplitude.window : ndarray Time-domain window with shape
(n_samples,).sample_rate : float Sampling rate in samples per second.
gravity : float, default=386.0 Acceleration-of-gravity conversion factor used when integrating to velocity and displacement.
damping : float, default=0.03 Fraction of critical damping used for SRS calculations.
srs_type : int, default=9 SRS type passed to :func:
sdynpy_srs.srs.match_points_per_octave : float, default=4.0 Frequency resolution used for SRS matching during iteration.
output_points_per_octave : float, default=12.0 Frequency resolution used for the returned SRS curves.
n_realizations : int, default=1 Number of random realizations to generate.
amp_init : ndarray, optional Initial spectrum amplitude guess as a two-column array
[frequency, amplitude].phase_init : ndarray, optional Initial one-sided phase vector in radians.
iterations : int, default=10 Maximum number of matching iterations per realization.
correction : float, default=0.8 Fraction of the SRS error corrected at each iteration.
error_tolerance : float, default=0.05 Relative SRS error tolerance for convergence.
randomize_phase : bool, default=False If True, ignore
phase_initand randomize the phase realization.max_frequency : float, optional Maximum frequency for nonzero Fourier amplitude. If not specified, the default is
min(sample_rate/4, ref_srs[-1, 0]).seed : int, optional Seed for the random number generator.
Returns¶
WindowedRandomResults
Ensemble result object containing all realizations, their SRS curves,
and selection metrics.
Notes¶
Each realization is generated independently using the same configuration except for the random phase realization when randomization is enabled.