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

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

Periodic signal extension

This function extends signal in a periodic fashion. For example: ... 2 3 4 | 1 2 3 4 | 1 2 3 ... This kind of extension is used with orthogonal filters.

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 31 of file filter.c.

References ABS.

Referenced by filter_periodic().

{
    if (index >= 0) {
        if (index < length) {
            return index;
        } else {
            return (index % length);
        }
    } else {
        return (length - 1 - (ABS(index) - 1) % length);
    }
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index