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.PowerSpectralDensityArray

Signature

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

Data array used to store power spectral density arrays

Attributes

NameSummary
function_typeReturns the function type of the data array

function_type

Returns the function type of the data array

Methods

NameSummary
angleComputes the angle of a PSD matrix
apply_transformationApplies a transformation to a cross power spectral density matrix.
bandwidth_averageIntegrates the PSD over frequency to get the power spectrum for each frequency bin (line)
coherenceComputes the coherence of a PSD matrix
compare_asdsPlot the diagonals of the CPSD matrix, as well as the level
error_summaryPlots an error summary compared to the current array
eyeComputes a diagonal CPSD matrix
from_time_dataComputes a PSD matrix from reference and response time histories
generate_time_historyGenerates a time history from a CPSD matrix
get_asdGet functions where the response coordinate is equal to the reference coordinate
get_cpsd_from_asdsTransforms ASDs to a full CPSD matrix with zeros on the off-diagonals
mimo_forwardCompute the forward MIMO problem Gxx = Hxv@Gvv@Hxv*
mimo_inverseComputes input estimation for MIMO random vibration problems
plot_asds
plot_magnitude_coherence_phasePlots the magnitude, coherence, and phase of a CPSD matrix.
plot_singular_valuesPlot the singular values of an FRF matrix with a visualization of the rcond tolerance
rmsCompute RMSs of the PSDs using the diagonals
set_coherence_phaseSets the coherence and phase of a PSD matrix while maintaining the ASDs
svdCompute the SVD of the provided CPSD matrix
to_rattlesnake_specification

angle

def sdynpy.PowerSpectralDensityArray.angle(self)

Computes the angle of a PSD matrix

Returns

apply_transformation

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

Applies a transformation to a cross power spectral density matrix.

Parameters

Returns

Raises

bandwidth_average

def sdynpy.PowerSpectralDensityArray.bandwidth_average(self, band_lb, band_ub)

Integrates the PSD over frequency to get the power spectrum for each frequency bin (line)

Parameters

Returns

Notes

Determines which freq bins (lines) contribute to each band. Contribute means the freq bin is at least partially within the band limits

The portion of the bin which contributes to the band is computed based multiplied by the fraction of the contributing frequency to get how much bin PS adds to the band PS

coherence

def sdynpy.PowerSpectralDensityArray.coherence(self)

Computes the coherence of a PSD matrix

Returns

Raises

compare_asds

def sdynpy.PowerSpectralDensityArray.compare_asds(figure_kwargs={}, linewidth=1, **cpsd_matrices)

Plot the diagonals of the CPSD matrix, as well as the level

Parameters

Returns

Raises

error_summary

def sdynpy.PowerSpectralDensityArray.error_summary(self, figure_kwargs={}, linewidth=1, plot_kwargs={}, **cpsd_matrices)

Plots an error summary compared to the current array

Parameters

Returns

Raises

eye

def sdynpy.PowerSpectralDensityArray.eye(cls, frequencies, coordinates, rms=None, full_matrix=False, breakpoint_frequencies=None, breakpoint_levels=None, breakpoint_interpolation='lin', min_frequency=0.0, max_frequency=None)

Computes a diagonal CPSD matrix

Parameters

Returns

Raises

from_time_data

def sdynpy.PowerSpectralDensityArray.from_time_data(response_data: sdynpy.core.sdynpy_data.TimeHistoryArray, samples_per_average: int = None, overlap: float = 0.0, window=array([1.]), reference_data: sdynpy.core.sdynpy_data.TimeHistoryArray = None, only_asds=False)

Computes a PSD matrix from reference and response time histories

Parameters

Returns

Raises

generate_time_history

def sdynpy.PowerSpectralDensityArray.generate_time_history(self, time_length=None, output_oversample=1)

Generates a time history from a CPSD matrix

Parameters

Returns

Raises

get_asd

def sdynpy.PowerSpectralDensityArray.get_asd(self)

Get functions where the response coordinate is equal to the reference coordinate

Returns

get_cpsd_from_asds

def sdynpy.PowerSpectralDensityArray.get_cpsd_from_asds(self)

Transforms ASDs to a full CPSD matrix with zeros on the off-diagonals

Returns

mimo_forward

def sdynpy.PowerSpectralDensityArray.mimo_forward(self, transfer_function)

Compute the forward MIMO problem Gxx = Hxv@Gvv@Hxv*

Parameters

Returns

Raises

mimo_inverse

def sdynpy.PowerSpectralDensityArray.mimo_inverse(self, transfer_function, 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)

Computes input estimation for MIMO random vibration problems

Parameters

Returns

Raises

Notes

This function solves the MIMO problem Gxx = Hxv@Gvv@Hxv^* using the pseudoinverse. Gvv = Hxv^+Gxx@Hxv^+^*, where Gvv is the source.

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

plot_asds

def sdynpy.PowerSpectralDensityArray.plot_asds(self, figure_kwargs={}, linewidth=1)

plot_magnitude_coherence_phase

def sdynpy.PowerSpectralDensityArray.plot_magnitude_coherence_phase(self, compare_data=None, plot_axes=False, sharex=True, sharey=True, logx=False, logy=True, magnitude_plot_kwargs={}, coherence_plot_kwargs={}, angle_plot_kwargs={}, figure_kwargs={})

Plots the magnitude, coherence, and phase of a CPSD matrix.

Coherence is plotted on the upper triangle, phase on the lower triangle, and magnitude on the diagonal.

Parameters

Returns

plot_singular_values

def sdynpy.PowerSpectralDensityArray.plot_singular_values(self, rcond=None, min_freqency=None, max_frequency=None)

Plot the singular values of an FRF matrix with a visualization of the rcond tolerance

Parameters

rms

def sdynpy.PowerSpectralDensityArray.rms(self)

Compute RMSs of the PSDs using the diagonals

Returns

set_coherence_phase

def sdynpy.PowerSpectralDensityArray.set_coherence_phase(self, coherence_array, angle_array)

Sets the coherence and phase of a PSD matrix while maintaining the ASDs

Parameters

Returns

svd

def sdynpy.PowerSpectralDensityArray.svd(self, full_matrices=True, compute_uv=True, as_matrix=True)

Compute the SVD of the provided CPSD matrix

Parameters

Returns

to_rattlesnake_specification

def sdynpy.PowerSpectralDensityArray.to_rattlesnake_specification(self, filename=None, coordinate_order=None, min_frequency=None, max_frequency=None, upper_warning_db=None, lower_warning_db=None, upper_abort_db=None, lower_abort_db=None, upper_warning_psd=None, lower_warning_psd=None, upper_abort_psd=None, lower_abort_psd=None)
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