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

local void synthesis_1D ( coeff_t input_signal,
coeff_t output_signal,
coeff_t temp1,
coeff_t temp2,
coeff_t temp3,
int  signal_length,
filterbank_t fb 
)

One dimensional wavelet reconstruction

This function performes one stage of 1D wavelet reconstruction of input_signal using filter bank fb. The result is stored in output_signal. This operation requires tree temporary arrays of length signal_length.

Parameters:
input_signalInput signal
output_signalOutput signal
temp1Temporary array 1
temp2Temporary array 2
temp3Temporary array 3
signal_lengthSignal length
fbFilter bank
Returns:
VOID

Definition at line 238 of file filter.c.

References BIORTHOGONAL, filter_periodic(), filter_symmetric(), filterbank_t_tag::highpass_synthesis, filterbank_t_tag::lowpass_synthesis, ORTHOGONAL, PHASE_EVEN, PHASE_ODD, SQRT2, filterbank_t_tag::type, and upsample_signal().

Referenced by synthesis_2D().

{
    coeff_t *lowpass;
    coeff_t *highpass;
    int i;

    /* 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 = input_signal;
        highpass = input_signal + signal_length / 2;

        /* Lowpass synthesis */
        upsample_signal(lowpass, temp1, signal_length / 2, signal_length, PHASE_EVEN);
        filter_periodic(temp1, temp2, signal_length, fb->lowpass_synthesis);

        /* Highpass synthesis */
        upsample_signal(highpass, temp1, signal_length / 2, signal_length, PHASE_EVEN);
        filter_periodic(temp1, temp3, signal_length, fb->highpass_synthesis);
    } else {
        lowpass = input_signal;
        highpass = input_signal + signal_length / 2 + (signal_length & 1);

        /* Lowpass synthesis */
        upsample_signal(lowpass, temp1, (signal_length + 1) / 2, signal_length, PHASE_EVEN);
        filter_symmetric(temp1, temp2, signal_length, fb->lowpass_synthesis);

        /* Highpass synthesis */
        upsample_signal(highpass, temp1, signal_length / 2, signal_length, PHASE_ODD);
        filter_symmetric(temp1, temp3, signal_length, fb->highpass_synthesis);
    }

    /* Combine arrays */
    for (i = 0; i < signal_length; i++) {
        output_signal[i] = temp2[i] + temp3[i];
    }
}

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