void XaudioConvolute(Display *display, XaudioSampleBuffer dst, int dst_index, unsigned int dst_count,XaudioSampleBuffer src ,int src_index ,unsignedint src_count ,XaudioSampleBuffer kern ,int denominator , scaledst );
void XaudioConvoluteAccumulate(Display *display, XaudioSampleBuffer dst, int dst_index, unsigned int dst_count,XaudioSampleBuffer src ,int src_index ,unsignedint src_count ,XaudioSampleBuffer kern ,int denominator , scaledst );
The operation performed is:
dst(j+dst_index) = Sigma_k src(k+src_index) * kern((shift+scalesrc*k-scaledst*j)/denominator)
where j iterates through 0, 1, ... , dst_count-1 and k iterates through 0, 1, ... src_count-1. kern is interpolated linearly between two adjacent sample values if the argument is not integral; kern is taken to be zero outside the index range of the sample buffer, see XaudioSampleBuffer(3).
The functions provide a generalized discrete convolution operator that is applicable even if the assumed sample rate of dst, src and kern differs. If denominator = scalesrc = scaledst = 1 the formula simplifies to:
dst(j+dst_index) = Sigma_k src(k+src_index) * kern(shift+k-j)
Thus the operation degenerates to the well-known discrete convolution operator (where sample rates must be identical). The convolution is commutative in src and kern only in the degenerate case.
The convolution operator provided here in its general form is mainly useful for sample rate conversion (and application of a band-pass filter at the same time, to reduce aliasing artifacts); see http://ccrma.stanford.edu/~jos/resample/ for a description of band-limited resampling.
The specialized form of the convolution operator is useful to apply finite impulse response filters to a sampled audio signal.