5.5.5 FIRInterpolate

Description

FIRInterpolate interpolates the sequence of the source samples at a rate of 1 to R, or equivalently, it upsamples the signal by a factor of R.

Effectively,

y[n] = x[n/R].

To diminish the effect of aliasing, the source samples are first upsampled and then filtered. The interpolated results are stored in the sequence of destination samples, and the delay values are updated.

Prototype

fractional* FIRInterpolate (int numSamps, fractional* dstSamps, fractional* srcSamps, FIRStruct* filter, int rate);

Arguments

Parameters

Description

numSamps

Number of the input samples to filter (also N; with N being multiple of R)

dstSamps

Pointer to the destination samples (also y)

srcSamps

Pointer to the source samples (also x)

filter

Pointer to the FIRStruct filter structure

rate

Rate of the interpolation (upsampling factor, also R)

Return

Pointer to the base address of the destination sample.

Remarks

Number of filter coefficients is M, with M being an integer multiple of R.

Coefficients, h[m], defined in 0 ≤ m < M, are not implemented as a circular modulo buffer.

Delay, d[m], defined in 0 ≤ m < M/R, are not implemented as a circular modulo buffer.

Source samples, x[n], defined in 0 ≤ n < N.

Destination samples, y[n], defined in 0 ≤ n < NR.

(See also FIRStructFIRStructInit and FIRInterpDelayInit.)

Source File

  • firinter_aa.s

Cycle counts for PIC32A:

Source Vector SizeCycles if coefficients in X-memCycles if coefficients in P-mem

32

5344

9002

64

10624

17930

128

21184

35786

256

42304

71498

512

84544

142922

1024

169024

285770

2048

337984

571466

(*All values with numCoeffs = 32; rate = 2)

System resource usage

  • W0…W7 - used, not restored
  • W8…W12 - saved, used, restored
  • ACCA - used, not restored
  • CORCON - saved, used, restored
  • REPEAT instruction(s) usage – 2