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)[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']) – 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

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.

Notes

There are requirements for the shapes of references and responses for some FRF computations.