sdynpy.core.sdynpy_data.ImpulseResponseFunctionArray

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

Bases: NDDataArray

Data array used to store impulse response functions

__init__()

Methods

enforce_causality([method, ...])

Enforces causality on the impulse response function via a cutoff of some sort.

fft([norm])

Converts the impulse response function to a frequency response function using the fft function.

find_end_of_ringdown()

Finds the end of the ringdown in a impulse response function (IRF).

Attributes

function_type

Returns the function type of the data array

enforce_causality(method='exponential_taper', window_parameter=None, end_of_ringdown=None)[source]

Enforces causality on the impulse response function via a cutoff of some sort.

Parameters
  • method (str) –

    The window type that is applied to the data to enforce causality. Note that these options are not necessarily traditional windows (used for data processing). The current options are:

    • exponential_taper (default) - this applies a exponential taper

    to the end of a boxcar window on the IRF. - boxcar - this applies a boxcar (uniform) window to the IRF with the cuttoff at a specified sample. - exponential - this applies an exponential window to the IRF with the 40 dB down point (of the window) at a specified sample. Care should be taken when using this window type, since it can lead to erratic behavior.

  • window_parameter (int, optional) –

    This is a parameter that defines the window for the causality enforcement. Methods exist to define this parameter automatically if it isn’t provided. The behaviors for the options are:

    • boxcar - the window_paramter is the sample after which the

    IRF is set to zero. It is the same as the end_of_ringdown parameter for this window type. - exponential - the window_parameter is where the 40 dB down point is for the window. It is the same as the end_of_ringdown parameter for this window type. - exponential_taper - the window_parameter is where the end point of the window (where the amplitude is 0.001), as defined by the number of samples after the uniform section of the window.

  • end_of_ringdown (int, optional) – This is a parameter that defines the end of the uniform section of the exponetional_taper window. It is not used for either the boxcar or exponential window. Methods exist to define this parameter automatically if it isn’t provided.

Returns

The IRF with causality enforced.

Return type

ImpulseResponseFunctionArray

Notes

Although optional, it is best practice for the user to supply a parameter for the end_of_ringdown variable if the “exponential_taper” method is being used or a window_parameter if the “exponential” or “boxcar” methods are being used. The code will attempt to find the end of the ring-down in the IRF and use use that as the end_of_ringdown parameter for the “exponential_taper” window or the window_parameter for the exponential and boxcar windows.

It is not suggested that the user provide a window_paramter if the “exponential_taper” method is being used, since the default is likely the most logical choice.

References

1

Zvonkin, M. (2015). Methods for checking and enforcing physical quality of linear electrical network models [Masters Theses, Missouri University of Science and Technology], Missouri S&T Scholars’ Mine, https://scholarsmine.mst.edu/masters_theses/7490/

fft(norm='backward', **scipy_rfft_kwargs)[source]

Converts the impulse response function to a frequency response function using the fft function.

Paramters

normstr, optional

The type of normalization applied to the fft computation.

scipy_rfft_kwargs :

Additional keywords that will be passed to SciPy’s rfft function.

returns

The transfer function array computed from the impusle response function array.

rtype

TransferFunctionArray

find_end_of_ringdown()[source]

Finds the end of the ringdown in a impulse response function (IRF).

It does this by smoothing the IRF via a moving average filter, then finding the index of the minimum of the smoothed IRF (for each response/reference pair). The “end of ringdown” is defined as the median of the possible indices.

Returns

end_of_ringdow – Index that represents the end of the ringdown for the supplied IRFs.

Return type

int

property function_type

Returns the function type of the data array