gw.domains.multibanded_frequency_domain.MultibandedFrequencyDomain

gw.domains.multibanded_frequency_domain.MultibandedFrequencyDomain(
    nodes,
    delta_f_initial,
    base_domain,
)

Defines a non-uniform frequency domain that is made up of a sequence of uniform-frequency domain bands. Each subsequent band in the sequence has double the bin-width of the previous one, i.e., delta_f is doubled each band as one moves up the bands. This is intended to allow for efficient representation of gravitational waveforms, which generally have slower oscillations at higher frequencies. Indeed, the leading order chirp has phase evolution [see https://doi.org/10.1103/PhysRevD.49.2658], \[ \Psi(f) = \frac{3}{4}(8 \pi \mathcal{M} f)^{-5/3}, \] hence a coarser grid can be used at higher f.

The domain is partitioned into bands via a sequence of nodes that are specified at initialization.

In comparison to the UniformFrequencyDomain, the MultibandedFrequencyDomain has the following key differences:

  • The sample frequencies start at the first node, rather than f = 0.0 Hz.

  • Quantities such as delta_f, noise_std, etc., are represented as arrays rather than scalars, as they vary depending on f.

The MultibandedFrequencyDomain furthermore has an attribute base_domain, which holds an underlying UniformFrequencyDomain object. The decimate() method decimates data in the base_domain to the multi-banded domain.

Parameters

Name Type Description Default
nodes Iterable[float] Defines the partitioning of the underlying frequency domain into bands. In total, there are len(nodes) - 1 frequency bands. Band j consists of decimated data from the base domain in the range [nodes[j]:nodes[j+1]). required
delta_f_initial float delta_f of band 0. The decimation factor doubles between adjacent bands, so delta_f is doubled as well. required
base_domain Union[UniformFrequencyDomain, dict] Original (uniform frequency) domain of data, which is the starting point for the decimation. This determines the decimation details and the noise_std. Either provided as dict for build_domain, or as domain_object. required

Attributes

Name Description
base_domain
domain_dict Enables to rebuild the domain via calling build_domain(domain_dict).
duration
f_max
f_min
frequency_mask Array of len(self) consisting of ones.
frequency_mask_length
max_idx
min_idx
nodes
sample_frequencies
sampling_rate

Methods

Name Description
decimate Decimate data from the base_domain to the multi-banded domain.
update Update the domain by truncating the frequency range (by specifying new f_min,
update_data Truncates the data array to be compatible with the domain. This is used when

decimate

gw.domains.multibanded_frequency_domain.MultibandedFrequencyDomain.decimate(
    data,
)

Decimate data from the base_domain to the multi-banded domain.

Parameters

Name Type Description Default
data array - like(np.ndarray or torch.Tensor) Decimation is done along the trailing dimension of this array. This dimension should therefore be compatible with the base frequency domain, i.e., running from 0.0 Hz or f_min up to f_max, with uniform delta_f. required

Returns

Name Type Description
Decimated array of the same type as the input.

update

gw.domains.multibanded_frequency_domain.MultibandedFrequencyDomain.update(
    new_settings,
)

Update the domain by truncating the frequency range (by specifying new f_min, f_max).

After calling this function, data from the original domain can be truncated to the new domain using self.update_data(). For simplicity, we do not allow for multiple updates of the domain.

Parameters

Name Type Description Default
new_settings dict Settings dictionary. Keys must either be the keys contained in domain_dict, or a subset of [“f_min”, “f_max”]. required

update_data

gw.domains.multibanded_frequency_domain.MultibandedFrequencyDomain.update_data(
    data,
    axis=-1,
    **kwargs,
)

Truncates the data array to be compatible with the domain. This is used when changing f_min or f_max.

update_data() will only have an effect after updating the domain to have a new frequency range using self.update().

Parameters

Name Type Description Default
data array - like(np.ndarray or torch.Tensor) Array should be compatible with either the original or updated MultibandedFrequencyDomain along the specified axis. In the latter case, nothing is done. In the former, data are truncated appropriately. required
axis int Axis along which to operate. -1

Returns

Name Type Description
Updated data of the same type as input.