I've been experimenting with using the polyphase resampler in IPP for resampling low sample rates without an integer resampling factor. (As an example, upsampling 400Hz to 480Hz).
I've created a simple test program which upsamples random data, similar to the example code in the documentation for ResamplePolyphaseFixed - however, the executable crashes with a segmentation fault somewhere inside the call to ResamplePolyphaseFixed.
The code, minus some debug output, is as follows:
int inputLength=400; int outputLength=480; int idealFilterLength=60; float* input = new float[inputLength]; float* output = new float[outputLength]; for (int i = 0; i < inputLength; i++) { input[i] = (float)random / (float)RAND_MAX; } int pSize, pLen, pHeight; ippsResamplePolyphaseFixedGetSize_32f(inputLength, outputLength, idealFilterLength, &pSize, &pLen, &pHeight, ippAlgHintFast) IppsResamplingPolyphaseFixed_32f* spec; spec = (IppsResamplingPolyphaseFixed_32f*)ippsMalloc_8u(pSize); double pTime; int outL; ippsResamplePolyphaseFixed_32f(input, inputLength, output, 0.98f, &pTime, &outL, spec);
The program completes in gdb and valgrind, though valgrind reports a number of invalid reads inside ResamplePolyphaseFixed.
Any suggestions as to where I'm going wrong with this would be greatly appreciated.
Thread Topic:
Help Me