import time


def Data_Filter(input_rd, filter_cls):
    """
    Description:
        Auxiliary function for data filtering and time evaluation.

    Args:
        (1) input_rd [Float Vector]: Input raw data.
        (2) filter_cls [Class: Signal.Filter]: Type of signal processing filter.
        
    Returns:
        (1) parameter [Float Vector]: The new value of the filter model.
        (2) parameter [Float]: Time to filter the entire data set.
    """

    # t_{0}: time start
    t_0 = time.time()

    # SMA filter calculation
    result_fd = []
    for _, input_dat in enumerate(input_rd):
        result_fd.append(filter_cls.Compute(input_dat))

    # t_{1}: time stop
    #   t = t_{1} - t_{0}
    return (result_fd, time.time() - t_0)