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

local void analysis_1D ( coeff_t input_signal,
coeff_t output_signal,
coeff_t temp,
int  signal_length,
filterbank_t fb 
)

One dimensional wavelet decomposition

This function performes one stage of 1D wavelet decomposition of input_signal using filter bank fb. The result is stored in output_signal. This operation requires one temporary array of length signal_length. On return, the first half of output_signal will be occupied with lowpass coefficients, the second half - with highpass coefficients.

Parameters:
input_signalInput signal
output_signalOutput signal
tempTemporary array
signal_lengthSignal length
fbFilter bank
Returns:
VOID
Note:
If signal_length is odd and fb is biorthogonal, then there will be one extra lowpass coefficient.

Definition at line 196 of file filter.c.

References BIORTHOGONAL, downsample_signal(), filter_periodic(), filter_symmetric(), filterbank_t_tag::highpass_analysis, filterbank_t_tag::lowpass_analysis, ORTHOGONAL, PHASE_EVEN, PHASE_ODD, SQRT2, and filterbank_t_tag::type.

Referenced by analysis_2D().

{
    coeff_t *lowpass;
    coeff_t *highpass;

    /* Sanity checks */
    assert(signal_length > 0);
    assert((fb->type == BIORTHOGONAL) || ((fb->type == ORTHOGONAL)
            && !(signal_length & 1)));

    /* Trivial case */
    if (signal_length == 1) {
        output_signal[0] = input_signal[0] * SQRT2;
        return;
    }

    if (fb->type == ORTHOGONAL) {
        lowpass = output_signal;
        highpass = output_signal + signal_length / 2;

        /* Lowpass analysis */
        filter_periodic(input_signal, temp, signal_length, fb->lowpass_analysis);
        downsample_signal(temp, lowpass, signal_length, signal_length / 2, PHASE_EVEN);

        /* Highpass analysis */
        filter_periodic(input_signal, temp, signal_length, fb->highpass_analysis);
        downsample_signal(temp, highpass, signal_length, signal_length / 2, PHASE_EVEN);
    } else {
        lowpass = output_signal;
        highpass = output_signal + signal_length / 2 + (signal_length & 1);

        /* Lowpass analysis */
        filter_symmetric(input_signal, temp, signal_length, fb->lowpass_analysis);
        downsample_signal(temp, lowpass, signal_length, (signal_length + 1) / 2, PHASE_EVEN);

        /* Highpass analysis */
        filter_symmetric(input_signal, temp, signal_length, fb->highpass_analysis);
        downsample_signal(temp, highpass, signal_length, signal_length / 2, PHASE_ODD);
    }
}

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