PowerSpectrum

lumicks.pylake.force_calibration.power_spectrum.PowerSpectrum

class PowerSpectrum(data, sample_rate, unit='V', window_seconds=None)

Power spectrum data for a time series.

frequency

Frequency values for the power spectrum. [Hz]

Type

numpy.ndarray

power

Power values for the power spectrum (typically in V^2/Hz).

Type

numpy.ndarray

sample_rate

The sampling rate for the original data. [Hz]

Type

float

total_duration

The total duration of the original data. [seconds]

Type

float

downsampled_by(factor, reduce=<function mean>)

Returns a spectrum downsampled by a given factor.

in_range(frequency_min, frequency_max)

Returns part of the power spectrum within a given frequency range.

plot(**kwargs)

Plot power spectrum

Parameters

**kwargs – Forwarded to matplotlib.pyplot.plot().

with_spectrum(power, num_points_per_block=1)

Return a copy with a different spectrum