/// Options for frequency analyses that are backed by short-time Fourier transforms.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct StftOptions {
    #[builder(default, into)]
    #[serde(rename = "window", skip_serializing_if = "Option::is_none", default)]
    window: Option<super::FftWindow>,
    #[builder(default, into)]
    #[serde(rename = "windowSymmetry", skip_serializing_if = "Option::is_none", default)]
    window_symmetry: Option<super::WindowSymmetry>,
    #[builder(default, into)]
    #[serde(
        rename = "samplingFrequency",
        skip_serializing_if = "Option::is_none",
        default
    )]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    sampling_frequency: Option<f64>,
    #[builder(default, into)]
    #[serde(rename = "nperseg", skip_serializing_if = "Option::is_none", default)]
    nperseg: Option<i32>,
    #[builder(default, into)]
    #[serde(rename = "noverlap", skip_serializing_if = "Option::is_none", default)]
    noverlap: Option<i32>,
    #[builder(default, into)]
    #[serde(rename = "nfft", skip_serializing_if = "Option::is_none", default)]
    nfft: Option<i32>,
    #[builder(default, into)]
    #[serde(rename = "detrend", skip_serializing_if = "Option::is_none", default)]
    detrend: Option<super::DetrendType>,
}
impl StftOptions {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new() -> Self {
        Self::builder().build()
    }
    /// Window function type to use
    #[inline]
    pub fn window(&self) -> Option<&super::FftWindow> {
        self.window.as_ref().map(|o| &*o)
    }
    /// Either DFT_EVEN or SYMMETRIC
    #[inline]
    pub fn window_symmetry(&self) -> Option<&super::WindowSymmetry> {
        self.window_symmetry.as_ref().map(|o| &*o)
    }
    /// Sampling frequency of the series in Hz. If absent, will calculate using the input series.
    #[inline]
    pub fn sampling_frequency(&self) -> Option<f64> {
        self.sampling_frequency.as_ref().map(|o| *o)
    }
    /// Number of points per window segment.
    #[inline]
    pub fn nperseg(&self) -> Option<i32> {
        self.nperseg.as_ref().map(|o| *o)
    }
    /// Number of points of overlap between windows. Must be less than nperseg.
    #[inline]
    pub fn noverlap(&self) -> Option<i32> {
        self.noverlap.as_ref().map(|o| *o)
    }
    /// Number of points to use in the FFT. Must be greater than or equal to nperseg.
    #[inline]
    pub fn nfft(&self) -> Option<i32> {
        self.nfft.as_ref().map(|o| *o)
    }
    /// Detrend the points in each window segment. If absent, will use the default detrend for that function.
    #[inline]
    pub fn detrend(&self) -> Option<&super::DetrendType> {
        self.detrend.as_ref().map(|o| &*o)
    }
}
