# pycbc.noise package¶

## pycbc.noise.gaussian module¶

This module contains functions to generate gaussian noise colored with a noise spectrum.

pycbc.noise.gaussian.frequency_noise_from_psd(psd, seed=None)[source]

Create noise with a given psd.

Return noise coloured with the given psd. The returned noise FrequencySeries has the same length and frequency step as the given psd. Note that if unique noise is desired a unique seed should be provided.

Parameters: psd (FrequencySeries) – The noise weighting to color the noise. seed ({0, int} or None) – The seed to generate the noise. If None specified, the seed will not be reset. noise – A FrequencySeries containing gaussian noise colored by the given psd. FrequencySeriesSeries
pycbc.noise.gaussian.noise_from_psd(length, delta_t, psd, seed=None)[source]

Create noise with a given psd.

Return noise with a given psd. Note that if unique noise is desired a unique seed should be provided.

Parameters: length (int) – The length of noise to generate in samples. delta_t (float) – The time step of the noise. psd (FrequencySeries) – The noise weighting to color the noise. seed ({0, int}) – The seed to generate the noise. noise – A TimeSeries containing gaussian noise colored by the given psd. TimeSeries
pycbc.noise.gaussian.noise_from_string(psd_name, length, delta_t, seed=None, low_frequency_cutoff=10.0)[source]

Create noise from an analytic PSD

Return noise from the chosen PSD. Note that if unique noise is desired a unique seed should be provided.

Parameters: psd_name (str) – Name of the analytic PSD to use. low_fr – length (int) – The length of noise to generate in samples. delta_t (float) – The time step of the noise. seed ({None, int}) – The seed to generate the noise. low_frequency_cutof ({10.0, float}) – The low frequency cutoff to pass to the PSD generation. noise – A TimeSeries containing gaussian noise colored by the given psd. TimeSeries

## pycbc.noise.reproduceable module¶

pycbc.noise.reproduceable.block(seed)[source]

Return block of normal random numbers

Parameters: seed ({None, int}) – The seed to generate the noise.sd noise – Array of random numbers numpy.ndarray
pycbc.noise.reproduceable.colored_noise(psd, start_time, end_time, seed=0, low_frequency_cutoff=1.0)[source]

Create noise from a PSD

Return noise from the chosen PSD. Note that if unique noise is desired a unique seed should be provided.

Parameters: psd (pycbc.types.FrequencySeries) – PSD to color the noise start_time (int) – Start time in GPS seconds to generate noise end_time (int) – End time in GPS seconds to generate nosie seed ({None, int}) – The seed to generate the noise. low_frequency_cutof ({1.0, float}) – The low frequency cutoff to pass to the PSD generation. noise – A TimeSeries containing gaussian noise colored by the given psd. TimeSeries
pycbc.noise.reproduceable.noise_from_string(psd_name, start_time, end_time, seed=0, low_frequency_cutoff=1.0)[source]

Create noise from an analytic PSD

Return noise from the chosen PSD. Note that if unique noise is desired a unique seed should be provided.

Parameters: psd_name (str) – Name of the analytic PSD to use. start_time (int) – Start time in GPS seconds to generate noise end_time (int) – End time in GPS seconds to generate nosie seed ({None, int}) – The seed to generate the noise. low_frequency_cutof ({10.0, float}) – The low frequency cutoff to pass to the PSD generation. noise – A TimeSeries containing gaussian noise colored by the given psd. TimeSeries
pycbc.noise.reproduceable.normal(start, end, seed=0)[source]

Generate data with a white Gaussian (normal) distribution

Parameters: start_time (int) – Start time in GPS seconds to generate noise end_time (int) – End time in GPS seconds to generate nosie seed ({None, int}) – The seed to generate the noise. noise – A TimeSeries containing gaussian noise TimeSeries