ml4gw.waveforms.generator
Classes
|
Waveform generator that generates time-domain waveforms from frequency-domain approximants. |
- class ml4gw.waveforms.generator.TimeDomainCBCWaveformGenerator(approximant, sample_rate, duration, f_min, f_ref, right_pad)
Bases:
ModuleWaveform generator that generates time-domain waveforms from frequency-domain approximants.
Frequency domain waveforms are conditioned as done by lalsimulation. Specifically, waveforms are generated with a starting frequency
fstartslightly below the requestedf_min, so that they can be tapered fromfstarttof_minusing a cosine window.Please see https://lscsoft.docs.ligo.org/lalsuite/lalsimulation/group___l_a_l_sim_inspiral__c.html#gac9f16dab2cbca5a431738ee7d2505969 for more information
- Parameters:
approximant (
Callable) -- A callable that returns hplus and hcross polarizations given requested frequencies and relevant set of parameters. Seeml4gw.waveforms.cbcfor implemented approximants.sample_rate (
float) -- Rate at which returned time domain waveform will be sampled in Hz. This also specifiesf_maxfor generating waveforms via the nyquist frequency:f_max = sample_rate // 2.f_min (
float) -- Lower frequency bound for waveformsduration (
float) -- Length of waveform in seconds. Waveforms will be left padded with zeros appropiately to fill the requested durationright_pad (
float) -- How far from the right edge of the window in seconds the returned waveform coalescence will be placed.f_ref (
float) -- Reference frequency for the waveform
- build_highpass_filter()
Builds highpass filter object.
- property delta_f
- property delta_t
- forward(**parameters)
Generates a time-domain waveform from a frequency-domain approximant. Conditioning is based onhttps://git.ligo.org/lscsoft/lalsuite/-/blob/master/lalsimulation/python/lalsimulation/gwsignal/core/waveform_conditioning.py?ref_type=heads#L248
A frequency domain waveform is generated, conditioned (see
generate_conditioned_fd_waveform) and fft'd into the time-domain- Parameters:
**parameters --
Dictionary of parameters for waveform generation where each key is the parameter name and each value is a tensor of parameters. It is required that
parameterscontainsmass_1,mass_2,s1z, ands2zkeys, which are used for determining parameters of data conditioning.If the specified approximant takes other parameters for waveform generation, like
chirp_massandmass_ratio, the utility functions inml4gw.waveforms.conversionmay be useful for populating the parameters dictionary with these additional parameters.Note that, if using an approximant from
ml4gw.waveforms.cbc, any additional keys inparametersnot ingested by the approximant will be ignored.- Return type:
tuple[Float[Tensor, '{N} samples'],Float[Tensor, '{N} samples']]
- generate_conditioned_fd_waveform(**parameters)
Generate a conditioned frequency domain waveform from a frequency-domain approximant.
- Parameters:
**parameters (
dict[str,Float[Tensor, 'batch']]) --Dictionary of parameters for waveform generation where key is the parameter name and value is a tensor of parameters. It is required that
parameterscontainsmass_1,mass_2,s1z, ands2zkeys, which are used for determining parameters of data conditioning.If the specified approximant takes other parameters for waveform generation, like
chirp_massandmass_ratio, the utility functions inml4gw.waveforms.conversionmay be useful for populating the parameters dictionary with these additional parameters.Note that, if using an approximant from
ml4gw.waveforms.cbc, any additional keys inparametersnot ingested by the approximant will be ignored.- Return type:
tuple[Float[Tensor, '{N} samples'],Float[Tensor, '{N} samples']]
- get_frequencies(df)
Get the frequencies from 0 to nyquist for corresponding df
- Parameters:
df (float)
- property nyquist
- property size
Number of samples in the waveform