PyREx

pyrex.signals.FFTThermalNoise

class pyrex.signals.FFTThermalNoise(times, f_band, f_amplitude=None, rms_voltage=None, temperature=None, resistance=None, uniqueness_factor=1)

Class for thermal Rayleigh noise signals using the FFT.

The Rayleigh thermal noise is calculated in a given frequency band with rayleigh-distributed or otherwise specified amplitudes and random phase. Values are calculated using an inverse FFT and then scaled to a provided or calculated RMS voltage.

Parameters
timesarray_like

1D array of times (s) for which the signal is defined.

f_bandarray_like

Array of two elements denoting the frequency band (Hz) of the noise. The first element should be smaller than the second.

f_amplitudefloat or function, optional

The frequency-domain amplitude of the noise. If float, then all frequencies will have the same amplitude. If function, then the function is evaluated at each frequency to determine its amplitude. By default, uses Rayleigh-distributed amplitudes.

rms_voltagefloat, optional

The RMS voltage (V) of the noise. If specified, this value will be used instead of the RMS voltage calculated from the values of temperature and resistance.

temperaturefloat, optional

The thermal noise temperature (K). Used in combination with the value of resistance to calculate the RMS voltage of the noise.

resistancefloat, optional

The resistance (ohm) for the noise. Used in combination with the value of temperature to calculate the RMS voltage of the noise.

uniqueness_factorint, optional

The number of unique waveform traces that can be expected from this noise signal. This factor multiplies the length of the total trace to be calculated.

Raises
ValueError

If the RMS voltage cannot be calculated (i.e. rms_voltage or both temperature and resistance are None).

Warning

Since this class inherits from FunctionSignal, its with_times method will properly extrapolate noise outside of the provided times. Be warned however that outside of the original signal times the noise signal will be periodic. Since the default number of frequencies used is based on the FFT bin size of times, the default period of the noise signal is actually the length of times. As a result if you are planning on extrapolating the noise signal, increasing the uniqueness_factor in order to increase the number of frequencies used is strongly recommended.

See also

FunctionSignal

Class for signals generated by a function.

FullThermalNoise

Class for thermal Rayleigh noise signals using exact functions.

Notes

Calculation of the noise signal is based on the Rayleigh noise model used by ANITA [1]. Modifications have been made to the default to make the frequency-domain amplitudes Rayleigh-distributed, under the suggestion that this makes for more realistic noise traces.

The calculation of signal values is done using an inverse fast Fourier transform. This method has the advantage of being an order of magnitude faster than directly summing cosine functions. The disadvantage is that interpolated values (at times not given in the initial time trace) cannot be calculated exactly and must be linearly interpolated, thereby losing some accuracy.

References

1

A. Connolly et al, ANITA Note #76, “Thermal Noise Studies: Toward A Time-Domain Model of the ANITA Trigger.” https://www.phys.hawaii.edu/elog/anita_notes/060228_110754/noise_simulation.ps

Attributes
times, valuesndarray

1D arrays of times (s) and corresponding values which define the signal.

value_typeSignal.Type.voltage

Type of signal, representing the units of the values.

TypeEnum

Enum containing possible types (units) for signal values.

functionfunction

Function to evaluate the signal values at given time(s).

f_minfloat

Minimum frequency of the noise frequency band.

f_maxfloat

Maximum frequency of the noise frequency band.

freqs, amps, phasesndarray

The frequencies used to define the noise signal and their corresponding amplitudes and phases.

rmsfloat

The RMS value of the noise signal.

dt

The time spacing of the times array, or None if invalid.

frequencies

The FFT frequencies of the signal.

spectrum

The FFT complex spectrum values of the signal.

envelope

The envelope of the signal by Hilbert transform.

Methods

Type(value)

Enum containing possible types (units) for signal values.

copy()

Get a copy of the FunctionSignal object.

filter_frequencies(freq_response[, force_real])

Apply the given frequency response function to the signal, in-place.

resample(n)

Resamples the signal into n points in the same time range, in-place.

set_buffers([leading, trailing, force])

Set leading and trailing buffers used in calculation of signal values.

shift(dt)

Shifts the signal values in time by dt.

with_times(new_times)

Returns a representation of this signal over a different times array.

PyREx

A Python package for simulation of neutrinos and radio antennas in ice. Version 1.10.0

Navigation