sdynpy.signal_processing.sdynpy_frf.timedata2frf
- timedata2frf(references, responses, dt=1, samples_per_average=None, overlap=0.0, method='H1', window=array([1.]), response_fft=<function <lambda>>, reference_fft=<function <lambda>>, response_fft_array=None, reference_fft_array=None, return_model_data=False, **lrm_kwargs)[source]
Creates an FRF matrix given time histories of responses and references
This function creates a nf x no x ni FRF matrix from the time histories provided.
- Parameters
references (ndarray) – A ni x nt or nt array where ni is the number of references and nt is the number of time steps in the signal. If averaging is specified, nt should be divisible by the number of averages.
responses (ndarray) – A no x nt or nt array where no is the number of responses and nt is the number of time steps in the signal. If averaging is specified, nt should be divisible by the number of averages.
dt (float) – The time between samples
samples_per_average (int) – The number of time samples per average. If not specified, it is set to the number of samples in the time signal, and no averaging is performed
overlap (float) – The overlap as a fraction of the frame (e.g. 0.5 specifies 50% overlap). If not specified, no overlap is used.
method (str in ['H1','H2','Hv','Hs','LRM']) – The method for creating the frequency response function. ‘H1’ is default if not specified.
window (ndarray or str) – A 1D ndarray with length samples_per_average that specifies the coefficients of the window. No window is applied if not specified. If a string is specified, then the window will be obtained from scipy
fft (function) – FFT Function that should be used. FFT must take the fft over axis -1.
response_fft_array (np.ndarray) – Array to store the data into before taking the FFT. Should be size number_of_responses, n_averages, samples_per_average
reference_fft_array (np.ndarray) – Array to store the data into before taking the FFT. Should be size number_of_references, n_averages, samples_per_average
return_model_data (boolean) – Wheter to return selected model orders used in the ‘LRM’ method. default is False
**lrm_kwargs – Additional keyword arguments specify parameters if method == ‘LRM’. Possible arguments are: f_out (ndarray), bandwidth (float), transient (boolean), modelset (iterable of (3,1) ndarray), export_ratio (float), max_parallel (int), print_time (bool). See sdynpy_lrm.frf_local_model. samples_per_average, overlap, and window are void if method==’LRM’.
- Returns
frequencies (ndarray) – A nf array of the frequency values associated with H
H (ndarray) – A nf x no x ni array where nf is the number of frequency lines, no is the number of outputs, and ni is the number of inputs.
model_data (dict) – Contains None if method != ‘LRM’. See sdynpy_lrm.frf_local_model.
Notes
There are requirements for the shapes of references and responses for some FRF computations.