xpipeline.waveform.xoptimalsnr.xoptimalsnr(h, t0, fs, S=None, F0=None, dF=None, Fmin=None, Fmax=None)[source]

Compute SNR and other properties of a signal in noise.

XOPTIMALSNR - Compute the SNR and time-frequency measures of a waveform in a specified noise background. Simpler noise-independent measures of the wave amplitude are also provided.

[SNR, h_rss, h_peak, Fchar, bw, Tchar, dur] = …

xoptimalsnr(h,t0,fs,S,F0,dF,Fmin,Fmax)

h Array. Waveform timeseries data. Each column holds the

timeseries for one of the GW polarizations. (There may be any number of polarisations, for the non-GR case. The order of polarizations does not matter.) The timeseries duration should be a power of 2.

t0 Scalar. Time at which the first waveform data point h(1,:) is

sampled.

fs Scalar. Sampling rate (Hz) of waveform data. This should be a

power of 2.

S Vector (optional). Noise background one-sided POWER (not

amplitude) spectrum. If supplied, it must cover at least the range [Fmin, Fmax], and must be sampled in ascending order of frequency. For noise-independent signal measures use S=f0=df=[]. In this case the constant spectrum S(f)=2 will be used (corresponding to a two-sided noise spectrum of unity).

F0 Scalar or vector (optional). Scalar: Frequency at which S(1) is

sampled. Vector: frequencies at which S is sampled.

dF Scalar (optional). Frequency spacing of the noise spectrum S.

If F0 is a vector then dF = [] must be used.

Fmin Scalar (optional). Minimum frequency (Hz) to include in

frequency-domain calculations. Defaults to 0 if no noise spectrum specified, or minimum frequency of noise spectrum.

Fmax Scalar (optional). Maximum frequency (Hz) to include in

frequency-domain calculations. Defaults to Nyquist if no noise spectrum specified, or maximum frequency of noise spectrum.

Computations are done in the time domain (TD) and frequency domain (FD) using the energy distributions

p_TD = h(:,1).^2 + h(:,2).^2 p_FD = 2(|FFT(h(:,1))|.^2 + |FFT(h(:,2))|.^2) # for f>=0

With these conventions, the output is
SNR Signal-to-noise ratio of h in the given noise background,
defined as

SNR = (2 int_Fmin^Fmax df p_FD./S).^0.5

h_rss The root-sum-square amplitude (Hz^-0.5) of the waveform h:

h_rss = int_Fmin^Fmax df p_FD

h_peak The maximum absolute amplitude of the waveform h:

h_peak = max(p_TD).^0.5

Fchar Characteristic frequency (Hz) of h in the given noise
background, defined as

int_Fmin^Fmax df f p_FD./S

Fchar = —————————————-

int_Fmin^Fmax df p_FD./S

where Fmin = max(f) and ilde(h) is the FFT of h.

bw Effective bandwidth (Hz) of h in the given noise
background, defined as

int_Fmin^Fmax df (f-Fchar).^2 p_FD./S

bw = —————————————————

int_Fmin^Fmax df p_FD./S

where Fmin = max(f) and ilde(h) is the FFT of h.

Tchar Characteristic time at which the event occurs, defined as

int dt t p_TD(t)

Tchar = —————–

int dt p_TD(t)

dur Duration of the signal, defined as

int dt (t-Tchar).^2 p_TD(t)

Tchar = —————————-

int dt p_TD(t)

Notes:

The power spectrum S is interpolated (if needed) to the frequencies of fft(h).

Note that no windowing is used for computing FFTs windowing and averaging is not really sensible for a transient signal, since by definition the statistical properties of the signal are changing over time. There may be problems for, e.g., band-passed noise bursts.

The SNR and h_rss measures are restricted to the frequency interval [Fmin,Fmax], while h_peak is evaluated in the time domain (i.e., using data from the full frequency range.

See FFTCONVENTIONS for information on the conventions used for Fourier transforms.