Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

sdynpy.TimeHistoryArray

Signature

class sdynpy.TimeHistoryArray(shape, nelements, buffer=None, offset=0, strides=None, order=None)

Data array used to store time history data

Attributes

NameSummary
function_typeReturns the function type of the data array

function_type

Returns the function type of the data array

Methods

NameSummary
apply_transformationApplies a transformations to the time traces.
burst_random_signalGenerates a burst random signal with the specified parameters
chirp_signalCreates a chirp (sine sweep) signal with the specified parameters
cpsdComputes a CPSD matrix from the time histories
digital_tracking_filter
fftComputes the frequency spectra of the time signal
filterFilter the signal using a butterworth filter of the specified order
find_signal_shiftComputes the shift between two sets of time signals
find_zero_crossingsFinds zero crossings in the time history
from_exodusReads time data from displacements in an Exodus file
haversine_signalCreates a haversine pulse with the specified parameters
mimo_forwardPerforms the forward mimo calculation via convolution.
mimo_inversePerforms the inverse source estimation for time domain (transient) problems using Fourier deconvolution. The response nodes used in the inverse source estimation are the ones contained in the supplied FRF matrix.
overlap_and_addCreates a time history by overlapping and adding other time histories.
pseudorandom_signalGenerates a pseudorandom signal at the specified coordinates
pulse_signalCreates a pulse using a cosine function raised to a specified exponent
random_signalGenerates a random signal with the specified parameters
remove_rigid_body_motionRemoves rigid body displacements from time data.
resampleUses Scipy.signal.resample to resample the time history array
rms
shift_signalShift a signal in time by a specified amount.
sine_signalCreates a sinusoidal signal with the specified parameters
sine_sweep_signal
split_into_framesSplits a time history into measurement frames with a given overlap and window function applied.
srsCompute a shock response spectrum (SRS) from the time history
stftComputes a Short-Time Fourier Transform (STFT)
to_rattlesnake_specification
upsampleUpsamples a time history using frequency domain zero padding.
vold_kalman_filter
zefftCreates a FFTs from time histories with early times zeroed out
zero_early_timeCreates a time histories with early times zeroed out

apply_transformation

def sdynpy.TimeHistoryArray.apply_transformation(self, transformation, invert_transformation=False)

Applies a transformations to the time traces.

Parameters

Returns

Raises

burst_random_signal

def sdynpy.TimeHistoryArray.burst_random_signal(cls, dt, signal_length, coordinates, min_frequency=None, max_frequency=None, signal_rms=1, frames=1, frequency_shape=None, on_fraction=0.5, delay_fraction=0.0, ramp_fraction=0.05, comment1='', comment2='', comment3='', comment4='', comment5='')

Generates a burst random signal with the specified parameters

Parameters

Returns

chirp_signal

def sdynpy.TimeHistoryArray.chirp_signal(cls, dt, signal_length, coordinates, start_frequency=None, end_frequency=None, frames=1, amplitude_function=None, force_integer_cycles=True, comment1='', comment2='', comment3='', comment4='', comment5='')

Creates a chirp (sine sweep) signal with the specified parameters

Parameters

Returns

cpsd

def sdynpy.TimeHistoryArray.cpsd(self, samples_per_frame: int, overlap: float, window: str, averages_to_keep: int = None, only_asds=False, rtol=1, atol=1e-08)

Computes a CPSD matrix from the time histories

Parameters

Returns

Raises

digital_tracking_filter

def sdynpy.TimeHistoryArray.digital_tracking_filter(self, frequencies, arguments, cutoff_frequency_ratio=0.15, filter_order=2, phase_estimate=None, amplitude_estimate=None, block_size=None, plot_results=False)

fft

def sdynpy.TimeHistoryArray.fft(self, samples_per_frame=None, norm='backward', rtol=1, atol=1e-08, **scipy_rfft_kwargs)

Computes the frequency spectra of the time signal

Parameters

Returns

Raises

filter

def sdynpy.TimeHistoryArray.filter(self, filter_order, frequency, filter_type='low', filter_method='filtfilt', filter_kwargs=None)

Filter the signal using a butterworth filter of the specified order

Parameters

Returns

find_signal_shift

def sdynpy.TimeHistoryArray.find_signal_shift(self, other_signal, compute_subsample_shift=True, good_line_threshold=0.01)

Computes the shift between two sets of time signals

This is the amount that other_signal leads self. If the time shift is positive, it means that features in other_signal occur earlier in time compared to self. If the time shift is negative, it means that features in other_signal occur later in time compared to self.

To align two signals, you can take the time shift from this function and pass it into the shift_signal method of other_signal.

Parameters

Returns

find_zero_crossings

def sdynpy.TimeHistoryArray.find_zero_crossings(self, return_abscissa=False, include_start=False)

Finds zero crossings in the time history

Parameters

Returns

from_exodus

def sdynpy.TimeHistoryArray.from_exodus(cls, exo, x_disp='DispX', y_disp='DispY', z_disp='DispZ', x_rot=None, y_rot=None, z_rot=None, timesteps=None)

Reads time data from displacements in an Exodus file

Parameters

Returns

haversine_signal

def sdynpy.TimeHistoryArray.haversine_signal(cls, dt, signal_length, coordinates, pulse_width=None, pulse_time=None, pulse_peak=1, frames=1, comment1='', comment2='', comment3='', comment4='', comment5='')

Creates a haversine pulse with the specified parameters

Parameters

Returns

mimo_forward

def sdynpy.TimeHistoryArray.mimo_forward(self, transfer_function)

Performs the forward mimo calculation via convolution.

Parameters

Returns

Raises

mimo_inverse

def sdynpy.TimeHistoryArray.mimo_inverse(self, transfer_function, time_method='single_frame', cola_frame_length=None, cola_window='hann', cola_overlap=None, zero_pad_length=None, inverse_method='standard', response_weighting_matrix=None, reference_weighting_matrix=None, regularization_weighting_matrix=None, regularization_parameter=None, cond_num_threshold=None, num_retained_values=None, transfer_function_odd_samples=False)

Performs the inverse source estimation for time domain (transient) problems using Fourier deconvolution. The response nodes used in the inverse source estimation are the ones contained in the supplied FRF matrix.

Parameters

Returns

Raises

Notes

This function computes the time domain inputs required to match the target time traces using Fourier deconvolution, which is essentially a frequency domain problem. The general method is to compute the frequency spectrum of the target time traces, then solve the inverse problem in the time domain using the supplied FRFs (H^+ * X). The inverse of the FRF matrix is found using the same methods as the mimo_inverse function for the PowerSpectralDensityArray class. The input spectrum is then converted back to the time domain via a inverse fourier transform.

The 0 Hz component is explicitly rejected from the FRFs, so the estimated forces cannot include a 0 Hz component.

References

.. [1] Wikipedia, “Moore-Penrose inverse”. https://en.wikipedia.org/wiki/Moore–Penrose_inverse .. [2] A.N. Tithe, D.J. Thompson, The quantification of structure-borne transmission pathsby inverse methods. Part 2: Use of regularization techniques, Journal of Sound and Vibration, Volume 264, Issue 2, 2003, Pages 433-451, ISSN 0022-460X, Thite & Thompson (2003). .. [3] Wikipedia, “Ridge regression”. Ridge regression .. [4] Wikipedia, “Overlap-add Method”. Overlap-add method

overlap_and_add

def sdynpy.TimeHistoryArray.overlap_and_add(functions_to_overlap, overlap_samples)

Creates a time history by overlapping and adding other time histories.

Parameters

Returns

Notes

All metadata is taken from the first signal. No checks are performed to make sure that the subsequent functions have common coordinates or abscissa spacing.

pseudorandom_signal

def sdynpy.TimeHistoryArray.pseudorandom_signal(cls, dt, signal_length, coordinates, min_frequency=None, max_frequency=None, signal_rms=1, frames=1, frequency_shape=None, different_realizations=False, comment1='', comment2='', comment3='', comment4='', comment5='')

Generates a pseudorandom signal at the specified coordinates

Parameters

Returns

pulse_signal

def sdynpy.TimeHistoryArray.pulse_signal(cls, dt, signal_length, coordinates, pulse_width=None, pulse_time=None, pulse_peak=1, sine_exponent=1, frames=1, comment1='', comment2='', comment3='', comment4='', comment5='')

Creates a pulse using a cosine function raised to a specified exponent

Parameters

Returns

random_signal

def sdynpy.TimeHistoryArray.random_signal(cls, dt, signal_length, coordinates, min_frequency=None, max_frequency=None, signal_rms=1, frames=1, frequency_shape=None, comment1='', comment2='', comment3='', comment4='', comment5='')

Generates a random signal with the specified parameters

Parameters

Returns

remove_rigid_body_motion

def sdynpy.TimeHistoryArray.remove_rigid_body_motion(self, geometry)

Removes rigid body displacements from time data.

This function assumes the current TimeHistoryArray is a displacement signal and adds it to the geometry to create node positions over time, then it fits a rigid coordinate transformation to each time step and subtracts off that portion of the motion from the displacement signal.

Parameters

Returns

resample

def sdynpy.TimeHistoryArray.resample(self, num_samples)

Uses Scipy.signal.resample to resample the time history array

Parameters

Returns

rms

def sdynpy.TimeHistoryArray.rms(self)

shift_signal

def sdynpy.TimeHistoryArray.shift_signal(self, time_shift)

Shift a signal in time by a specified amount.

Utilizes the FFT shift theorem to move a signal in time.

Parameters

Returns

sine_signal

def sdynpy.TimeHistoryArray.sine_signal(cls, dt, signal_length, coordinates, frequency, amplitude=1, phase=0, comment1='', comment2='', comment3='', comment4='', comment5='')

Creates a sinusoidal signal with the specified parameters

Parameters

Returns

sine_sweep_signal

def sdynpy.TimeHistoryArray.sine_sweep_signal(cls, dt, coordinates, frequency_breakpoints, sweep_types, sweep_rates, amplitudes=1, phases=1, comment1='', comment2='', comment3='', comment4='', comment5='')

split_into_frames

def sdynpy.TimeHistoryArray.split_into_frames(self, samples_per_frame=None, frame_length=None, overlap=None, overlap_samples=None, window=None, check_cola=False, allow_fractional_frames=False)

Splits a time history into measurement frames with a given overlap and window function applied.

Parameters

Returns

srs

def sdynpy.TimeHistoryArray.srs(self, min_frequency=None, max_frequency=None, frequencies=None, damping=0.03, num_points=None, points_per_octave=12, srs_type='MMAA')

Compute a shock response spectrum (SRS) from the time history

Parameters

Returns

Notes

The srs_type argument takes a 4 character string that specifies how the SRS is computed.

stft

def sdynpy.TimeHistoryArray.stft(self, samples_per_frame=None, frame_length=None, overlap=None, overlap_samples=None, window=None, check_cola=False, allow_fractional_frames=False, norm='backward')

Computes a Short-Time Fourier Transform (STFT)

The time history is split up into frames with specified length and computes the spectra for each frame.

Parameters

Returns

to_rattlesnake_specification

def sdynpy.TimeHistoryArray.to_rattlesnake_specification(self, filename=None, coordinate_order=None, min_time=None, max_time=None)

upsample

def sdynpy.TimeHistoryArray.upsample(self, factor)

Upsamples a time history using frequency domain zero padding.

Parameters

Returns

vold_kalman_filter

def sdynpy.TimeHistoryArray.vold_kalman_filter(self, arguments, filter_order=None, bandwidth=None, method=None, block_size=None, overlap=0.5, plot_results=False, verbose=False)

zefft

def sdynpy.TimeHistoryArray.zefft(self, num_steps=10, abscissa_range=None, closest_zero_crossing=True)

Creates a FFTs from time histories with early times zeroed out

This computes an FFT time history with the first portion of the original time history zeroed out. This is useful for analyzing ring-downs of nonlinear systems to identify how the system changes over time.

Parameters

Returns

zero_early_time

def sdynpy.TimeHistoryArray.zero_early_time(self, num_steps=10, abscissa_range=None, closest_zero_crossing=True)

Creates a time histories with early times zeroed out

This computes a time history with the first portion of the original time history zeroed out. This is useful for analyzing ring-downs of nonlinear systems to identify how the system changes over time.

Parameters

Returns

References
  1. Thite, A. N., & Thompson, D. J. (2003). The quantification of structure-borne transmission paths by inverse methods. Part 2: Use of regularization techniques. Journal of Sound and Vibration, 264(2), 433–451. 10.1016/s0022-460x(02)01203-8