com.oregondsp.signalProcessing.filter.fir
Class Interpolator

java.lang.Object
  extended by com.oregondsp.signalProcessing.filter.fir.Interpolator

public class Interpolator
extends java.lang.Object

Implements a finite impulse response (FIR) interpolator for resampling sequences up by an integer rate.

This implementation uses a windowed sinc function as the interpolation kernel. The length of the window is determined by the interpolation rate and a design factor which controls interpolation accuracy. A Hanning window is used to window the sinc function.

The window length is N = 2*M + 1, where M = (interpolation rate)*designFactor. The interpolation kernel is:

h[n] = ( 0.5 + 0.5*cos(pi/M * n) ) * sin( n*pi/R ) / ( n*pi/R )

R is the interpolation rate.

This implementation assumes that the data will be processed in consecutive, contiguous blocks of uniform size. The block size is specified in the constructor for the Interpolator, and thereafter calls to interpolate() will interpolate successive blocks of that size. Very important: the block size must not change. State information required to assure continuous interpolation from block to block is maintained by the class instance, so that there are no edge effects in the interpolated result sequence (except at the very beginning and end of the data stream).


Constructor Summary
Interpolator(int rate, int designFactor, int blockSize)
          Instantiates a new Interpolator .
 
Method Summary
 void interpolate(float[] block, float[] interpolatedBlock)
          Interpolates blocks of a data stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Interpolator

public Interpolator(int rate,
                    int designFactor,
                    int blockSize)
Instantiates a new Interpolator .

Parameters:
rate - int containing the interpolation rate.
designFactor - int containing parameter controlling the accuracy of interpolation through the length of the interpolation filter
blockSize - int controlling the size of blocks in which the data will be processed
Method Detail

interpolate

public void interpolate(float[] block,
                        float[] interpolatedBlock)
Interpolates blocks of a data stream.

Parameters:
block - float[] containing a block of the sequence to be interpolated
interpolatedBlock - float[] containing the interpolated block