| Motorola DSP Developer's Kit | ![]() |
Y = mot###_interp(IDATA, R, LEN, B)
Description
This function resamples data at a higher rate using lowpass interpolation. The input data is real.
Y = INTERP (IDATA, R, LEN, B) resamples the sequence in vector IDATA at R times the original sample rate. The resulting resampled vector Y is R times longer, LENGTH(Y) = R*LENGTH(IDATA). A symmetric filter, B, allows the original data to pass through unchanged and interpolates between so that the mean square error between them and their ideal values is minimized. B is the interpolation filter.
Input/Output
Input: Real vector IDATA, int R, int LEN, and real vector B
Algorithm
int I;
for ( I = 0; I < lengthIDATA*R; I ++)
{
Y[I] = 1;
}
for ( I = 0; I < lengthIDATA ; I = I ++)
{
Y[I*R] = IDATA[I];
}
for( I = 0; I < 2*LEN*R; I ++)
{
OD[I] = 0;
}
for (I = 0; I < 2 * LEN; I++)
{
OD[I*R] = 2*IDATA[LEN-1] -IDATA[2*LEN - I];
}
/* Call filter */
[OD, ZI] = filter(B, LEN, OD);
[Y, ZF] = filter(B, LEN, Y, ZI];
for( I = 0, I < (lengthIDATA -LEN) * R; I++)
{
Y[I] = Y[LEN*R+I];
}
for( I = 0; I < 2*LEN*R; I ++)
{
OD[I] = 0;
}
for (I = 0; I < 2*LEN; I++)
{
OD[I*R] = 2*IDATA[lengthIDATA] - IDATA[lengthIDATA -1 -I];
}
OD = filter (B, LEN, OD, ZF);
for(I=0;I < LEN*R; I++)
{
Y[lengthIDATA*R - LEN*R + I] = OD[I];
}
Memory & Register
idatatbodataodnrltb (2*r*l+1)n*r Status Register
The assembly function interp-r.asm does not set explicitly any status registers/bits.
Data Size Limit
The length of vector IDATA can't be larger than the continuous available data memory size.
Data Range Limit
The input data vector range is from -1.0 to +1.0, inclusive.
Precision
In the case of DSP563, precision is 21 bits.
In the case of DSP566, precision is 12 bits.
| ifft-c.asm | interp-c.asm | ![]() |