- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi John,
We are investigating on it. Thanks.
Best regards,
Fiona