waveformtools.differentiate

Tools for differentiating data.

Functions

Chebyshev_differential(x_data, y_data[, ...])

Differentiate a function using the Chebyshev expansion.

Fourier_differential(delta_x[, udata_x, ...])

Fixed frequency differentiation, the inverse of the Fixed frequency integration as presented in Reisswig et al. This function takes in a function and returns its nth order derivative differential taken in the frequency domain.

differentiate(data, delta_t)

Central difference derivative calculator.

differentiate2(data, delta_t)

Five point difference derivative calculator.

differentiate3(data, delta_t)

Seven point difference derivative calculator.

differentiate4(data, delta_t)

Nine point difference derivative calculator.

differentiate5(data, delta_t)

Eleven point difference derivative calculator.

differentiate5_vec_nonumba(data, delta_t)

Eleven point difference derivative calculator.

differentiate5_vec_numba(data, delta_t)

Eleven point difference derivative calculator.

differentiate_cwaveform(time_axis, waveform)

Differentiate a given waveform by differentiating the Amplitude-Phase form.

waveformtools.differentiate.Chebyshev_differential(x_data, y_data, order=1, degree=8)[source]

Differentiate a function using the Chebyshev expansion.

Parameters:
x_data: 1d array

The x data.

y_data: 1d array

The y data.

order: int

The number of times to differentiate.

degree: int

The number of basis functions to use.

Returns:
dydx_data: 1d array

The differentiated data.

waveformtools.differentiate.Fourier_differential(delta_x, udata_x=None, utilde_conven=None, omega0=inf, order=1, zero_mode=0, taper=True)[source]

Fixed frequency differentiation, the inverse of the Fixed frequency integration as presented in Reisswig et al. This function takes in a function and returns its nth order derivative differential taken in the frequency domain.

Parameters:
xaxis: 1d array

The co-ordinate space axis.

udata_x: 1d array

The data to be differentiated, expressed in coordinate space.

omega0: float, optional

The cutoff angular frequency in the integration. Must be lower than the starting angular frequency of the input waveform.

order: int, optional

The number of times to differentiate the integrand in time.

zero_mode: float, optional

The zero mode amplitude of the FFT required.

taper: bool

Whether or not to taper the real co-ordinate space data.

Returns:
udata_differentiated: 1d array

The input waveform in time-space, integrated in frequency space using FFI.

utilde_differentiated: 1d array

The FFT of the frixed frequency differentiated array in good conventions.

new_x_axis: 1d array

The new x-axis, assuming the data may have been changed in length

freq_axis: 1d array

The frequency axis of the FFT of data.

Notes

The returned differentiated function of a real udata_x in real co-ordinate space is a complex number due to the numerical inaccuracies. Take the real part of udata_differentiated if the input udata_x is real.

waveformtools.differentiate.differentiate(data, delta_t)[source]

Central difference derivative calculator. Forward/ backward Euler near the boundaries.

Parameters:
data: 1d array

The 1d data.

delta_t: float

The time step in units of t/M.

Returns:
dAdt: 1d array

The derivative.

waveformtools.differentiate.differentiate2(data, delta_t)[source]

Five point difference derivative calculator. Not accurate near the boundaries.

Parameters:
data: 1d array

The 1d data.

delta_t: float

The time step in t/M.

Returns:
dAdt: 1d array

The derivative.

waveformtools.differentiate.differentiate3(data, delta_t)[source]

Seven point difference derivative calculator. Not accurate near the boundaries.

Parameters:
data: 1d array

The 1d data.

delta_t: float

The time step in t/M.

Returns:
dAdt: 1d array

The derivative.

waveformtools.differentiate.differentiate4(data, delta_t)[source]

Nine point difference derivative calculator. Not accurate near the boundaries.

Parameters:
data: 1d array

The 1d data.

delta_t: float

The time step in t/M.

Returns:
dAdt: 1d array

The derivative.

waveformtools.differentiate.differentiate5(data, delta_t)[source]

Eleven point difference derivative calculator. Not accurate near the boundaries.

Parameters:
data: 1d array

The 1d data.

delta_t: float

The time step in t/M.

Returns:
dAdt: 1d array

The derivative of the data.

waveformtools.differentiate.differentiate5_vec_nonumba(data, delta_t)[source]

Eleven point difference derivative calculator. Not accurate near the boundaries.

Parameters:
data: 1d array

The 1d data.

delta_t: float

The time step in t/M.

Returns:
dAdt: 1d array

The derivative of the data.

waveformtools.differentiate.differentiate5_vec_numba(data, delta_t)[source]

Eleven point difference derivative calculator. Not accurate near the boundaries.

Parameters:
data: 1d array

The 1d data.

delta_t: float

The time step in t/M.

Returns:
dAdt: 1d array

The derivative of the data.

waveformtools.differentiate.differentiate_cwaveform(time_axis, waveform)[source]

Differentiate a given waveform by differentiating the Amplitude-Phase form.

Parameters:
time_axis: 1d array

The time axis of the waveform.

waveform: 1d array

The complex 1d array of the waveform timeseries.

Returns:
differentiated_waveform: 1d array

The waveform differentiated in time.