Logo Search packages:      
Sourcecode: librasterlite version File versions  Download package

local void filter_periodic ( coeff_t input_signal,
coeff_t output_signal,
int  signal_length,
filter_t filter 
) [inline]

Periodic signal filtering

This function filters input_signal of length signal_length into the output_signal using specified filter. Boundary samples are evaluated using peridic extension.

Parameters:
input_signalInput signal
output_signalOutput signal
signal_lengthSignal length
filterFilter
Returns:
VOID
Note:
filter must be orthogonal.
signal_length must be even.

Definition at line 106 of file filter.c.

References ANTICAUSAL, CAUSAL, filter_t_tag::causality, filter_t_tag::coeffs, filter_t_tag::length, and periodic_extension().

Referenced by analysis_1D(), and synthesis_1D().

{
    int i, j, k;

    switch (filter->causality) {
        case CAUSAL:
        {
            for (i = 0; i < signal_length; i += 1) {
                output_signal[i] = 0;
                for (j = 0; j < filter->length; j++) {
                    k = periodic_extension(i - j, signal_length);
                    output_signal[i] += input_signal[k] * filter->coeffs[j];
                }
            }

            break;
        }
        case ANTICAUSAL:
        {
            for (i = 0; i < signal_length; i += 2) {
                output_signal[i] = 0;
                for (j = 0; j < filter->length; j++) {
                    k = periodic_extension(i + j, signal_length);
                    output_signal[i] +=
                        input_signal[k] * filter->coeffs[filter->length - j - 1];
                }
            }

            break;
        }
        default:
        {
            assert(0);
            break;
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index