5.5.2 FIR
Description
FIR applies an FIR filter to the sequence of source samples, places the results in the sequence of destination samples and updates the delay values.
Prototype
fractional* FIR (int numSamps, fractional* dstSamps, fractional* srcSamps, FIRStruct* filter);
Arguments
Parameters | Description |
---|---|
numSamps |
Number of the input samples to filter (also N) |
dstSamps |
Pointer to the destination samples (also y) |
srcSamps |
Pointer to the source samples (also x) |
filter |
Pointer to the FIRStruct filter structure |
Return
Pointer to the base address of the destination sample.
Remarks
Number of filter coefficients is M.
Coefficients, h[m], defined in 0 ≤ m < M, implemented as a circular increasing modulo buffer.
Delay, d[m], defined in 0 ≤ m < M, implemented as a circular increasing modulo buffer. The Delay vector must be placed in Y-Data space.
Source samples, x[n], defined in 0 ≤ n < N.
Destination samples, y[n], defined in 0 ≤ n < N.
(See also FIRStruct, FIRStructInit and FIRDelayInit.)
Source File
- fir_aa.s
Cycle counts for PIC32A:
Source Vector Size | Cycles if coefficients in X-mem | Cycles if coefficients in P-mem |
---|---|---|
32 |
1222 |
3112 |
64 |
2376 |
6152 |
128 |
4676 |
12232 |
256 |
9288 |
24392 |
512 |
18500 |
48712 |
1024 |
36936 |
97352 |
2048 |
73796 |
194632 |
(*All values with numCoeffs = 32)
System resource usage
- W0…W7 - used, not restored
- ACCA - used, not restored
- CORCON - saved, used, restored
- MODCON - saved, used, restored
- XMODSTRT - saved, used, restored
- XMODEND - saved, used, restored
- YMODSTRT - saved, used, restored
- YMODEND - saved, used, restored
- REPEAT instruction(s) usage – 1