- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 = (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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear customer,
You probably need to Initialize the structures for data resampling with the factor equal to inRate/outRate. Please use ippsResamplePolyphaseFixedInit_32f before resampling calculation. Here's a sample about how to use IPP polyphase resampling. You could refer to this link.
Best regards,
Fiona
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I missed out the line which called that function when I was transcribing the code. This is the line after spec is allocated (at line 19 in the snippet in my original post):
ippsResamplePolyphaseFixedInit_32f(inputLength, outputLength, pLen, 0.95f, 8.0f, spec, ippAlgHintFast)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi John,
We are investigating on it. Thanks.
Best regards,
Fiona

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page