/// Applies IIR-based signal filtering to input series. Includes low-pass, high-pass, band-pass, and band-stop
/// filters. Currently supports variable-order bidirectional Butterworth filters, with fixed-size padding based
/// on SciPy output.
#[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 SignalFilterSeries {
    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
    #[serde(rename = "input")]
    input: Box<super::NumericSeries>,
    #[builder(custom(type = super::SignalFilterConfiguration, convert = Box::new))]
    #[serde(rename = "signalFilterConfiguration")]
    signal_filter_configuration: Box<super::SignalFilterConfiguration>,
    #[builder(custom(type = super::IntegerConstant, convert = Box::new))]
    #[serde(rename = "order")]
    order: Box<super::IntegerConstant>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::DoubleConstant>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "samplingFrequency",
        skip_serializing_if = "Option::is_none",
        default
    )]
    sampling_frequency: Option<Box<super::DoubleConstant>>,
}
impl SignalFilterSeries {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        input: super::NumericSeries,
        signal_filter_configuration: super::SignalFilterConfiguration,
        order: super::IntegerConstant,
    ) -> Self {
        Self::builder()
            .input(input)
            .signal_filter_configuration(signal_filter_configuration)
            .order(order)
            .build()
    }
    #[inline]
    pub fn input(&self) -> &super::NumericSeries {
        &*self.input
    }
    /// Filter type and cutoff frequencies.
    #[inline]
    pub fn signal_filter_configuration(&self) -> &super::SignalFilterConfiguration {
        &*self.signal_filter_configuration
    }
    /// Order of filter. Must be a positive integer, and is effectively doubled for bidirectional filters.
    #[inline]
    pub fn order(&self) -> &super::IntegerConstant {
        &*self.order
    }
    /// The sampling frequency of the input series. Used to calculate normalized frequency for cutoff frequencies.
    #[inline]
    pub fn sampling_frequency(&self) -> Option<&super::DoubleConstant> {
        self.sampling_frequency.as_ref().map(|o| &**o)
    }
}
