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

local int symmetric_W_extension ( int  index,
int  length 
) [inline]

Symmetric-whole signal extension

This function extends signal in symmetric-whole fasion. For example: ... 4 3 2 | 1 2 3 4 | 3 2 1 ... This kind of extension is used with biorthogonal filters of odd length.

Parameters:
indexSample index
lengthSignal length
Returns:
Real sample index within array bounds
Note:
Actually, signal is not extended as the function name states. This function just computes real sample index within array bounds.

Definition at line 44 of file filter.c.

References ABS.

Referenced by filter_symmetric().

{
    if ((index >= 0) && (index < length)) {
        return index;
    }

    if (length == 1) {
        return 0;
    }

    index = ABS(index) % (2 * length - 2);

    if (index >= length) {
        index = 2 * length - 2 - index;
    }

    return index;
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index