sdynpy.core.sdynpy_data.CoherenceArray

class CoherenceArray(shape, nelements, buffer=None, offset=0, strides=None, order=None)[source]

Bases: NDDataArray

Data array used to store coherence data

__init__()

Methods

from_time_data(response_data[, ...])

Computes coherence from reference and response time histories

Attributes

function_type

Returns the function type of the data array

static from_time_data(response_data: TimeHistoryArray, samples_per_average: Optional[int] = None, overlap: float = 0.0, window=array([1.]), reference_data: Optional[TimeHistoryArray] = None)[source]

Computes coherence from reference and response time histories

Parameters
  • response_data (TimeHistoryArray) – Time data to be used as responses

  • samples_per_average (int, optional) – Number of samples used to split up the signals into averages. The default is None, meaning the data is treated as a single measurement frame.

  • overlap (float, optional) – The overlap as a fraction of the frame (e.g. 0.5 specifies 50% overlap). The default is 0.0, meaning no overlap is used.

  • window (np.ndarray or str, optional) – A 1D ndarray with length samples_per_average that specifies the coefficients of the window. A Hann window is applied if not specified. If a string is specified, then the window will be obtained from scipy.

  • reference_data (TimeHistoryArray) – Time data to be used as reference. If not specified, the response data will be used as references, resulting in a square coherence matrix.

Raises

ValueError – Raised if reference and response functions do not have consistent abscissa

Returns

A PSD array computed from the specified reference and response signals.

Return type

PowerSpectralDensityArray

property function_type

Returns the function type of the data array