saftig.external.spicypy_wf ========================== .. py:module:: saftig.external.spicypy_wf .. autoapi-nested-parse:: A wrapper for spicypy.signal.WienerFilter with the saftig.common.FilterBase interface. This is intended to allow comparisons between the implementations. Classes ------- .. autoapisummary:: saftig.external.spicypy_wf.SpicypyWienerFilter Module Contents --------------- .. py:class:: SpicypyWienerFilter(n_filter, idx_target, n_channel = 1) Bases: :py:obj:`saftig.filtering.common.FilterBase` A wrapper for the spicypy WF implementation :param n_filter: Length of the FIR filter (how many samples are in the input window per output sample) :param idx_target: Position of the prediction :param n_channel: Number of witness sensor channels >>> import saftig as sg >>> n_filter = 10 >>> witness, target = sg.evaluation.TestDataGenerator(0.1).generate(int(1e3)) >>> filt = sg.external.SpicypyWienerFilter(n_filter, 0, 1) >>> sp_filt = filt.condition(witness, target) >>> prediction = filt.apply(witness, target) # apply to training data .. py:attribute:: filter_name :value: 'SpicypyWF' .. py:attribute:: conditioned :value: False .. py:attribute:: filter_state :type: Optional[spicypy.signal.WienerFilter] .. py:method:: supports_saving_loading() :staticmethod: Indicates whether saving and loading is supported. .. py:method:: make_spicypy_time_series(witness, target, sample_rate = 1.0) :staticmethod: Convert the given witness and target signals to the format requried by spicypy. :param witness: Witness sensor data :param target: Target sensor data :param sample_rate: The sample rate of the time series .. py:method:: condition(witness, target, sample_rate = 1.0, use_multiprocessing = False) Use an input dataset to condition the filter :param witness: Witness sensor data :param target: Target sensor data :param sample_rate: The sample rate of the time series .. py:method:: apply(witness, target, pad = True, update_state = False, sample_rate = 1.0) Apply the filter to input data :param witness: Witness sensor data :param target: Target sensor data (is ignored) :param pad: if True, apply padding zeros so that the length matches the target signal :param update_state: ignored :return: prediction