|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.oregondsp.signalProcessing.filter.fir.Interpolator
public class Interpolator
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 |
---|
public Interpolator(int rate, int designFactor, int blockSize)
rate
- int containing the interpolation rate.designFactor
- int containing parameter controlling the accuracy of interpolation
through the length of the interpolation filterblockSize
- int controlling the size of blocks in which the data will be processedMethod Detail |
---|
public void interpolate(float[] block, float[] interpolatedBlock)
block
- float[] containing a block of the sequence to be interpolatedinterpolatedBlock
- float[] containing the interpolated block
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |