Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

ResamplePolyphase Usage?

Soilworker
Beginner
474 Views
I'm having some problems figuring out how to utilize ResamplePolyphase in a pure IPP v6.1 implementation in Mac OS X 10.6.8. I've heard that this function is excellent for audio resampling, but the instructions and code examples in the manual for setup are conflicting and confusing.

As a result, everything I've tried is crashing upon launch with the same error (EXC_BAD_ACCESS (SIGSEGV)), which I've narrowed down to being the result of a memory allocation problem with the actual resampling state structure itself (IppsResamplingPolyphase_32f*). Specifically, I'm utilizing the Fixed variant of the function.

The manual says "First, you need to allocate memory for the structure" prior to intializing the resampler using ResamplePolyphaseInit. That's interesting and confusing on two levels (1) there is no way I can find to "allocate memory" for an IppsResamplingPolyphase_32f* structure and (2) none of the code examples in the manual do this.

Then, the manual says "Then use the function ippsResamplePolyphaseSetFixedFilter to import filter coefficients. To calculate the memory size, filter length and the number of filters, use the ippsResamplePolyphaseFixedGetSize function." Again, the code examples in this chapter do exactly none of these things.

I've tried an implementation similar to code example 8-4 (resampling of the input mono pcm file) and I've also tried another implementation according to the aforementioned directions, as best as I can follow them anyway. None of these things work, they always crash while trying to access the resampling structure pointer itself. I have no problems with any other functions in IPP, including FIR, maths, etc., but this resampler is incredibly confusing and frustrating (largely due to the extremely vague and incomplete documentation.)

It would be of great benefit if there were usage examples for all of the related functions in the Polyphase Resampling category, but I can't find anything beyond what's provided in the manual - and there's not anything on it in either edition of the Intel IPP book by Stewart Taylor (I own both.)

Thanks in advance for any help!
0 Kudos
5 Replies
Chao_Y_Intel
Moderator
474 Views

Hello,

You possibly can post one crash example, so it could check if there is any problem with memory allocation.

Thanks,
Chao

0 Kudos
Soilworker
Beginner
474 Views
The exception code is KERN_INVALID_ADDRESS at 0x00000000ffffffff, and the crashed thread is 0x406995f6 p8_ippsResamplePolyphaseFixed_32f + 598. The only thing that changes from crash to crash are the specific memory addresses involved.

My guess is that somehow the pointer to the structure is getting overwritten (or improperly allocated to begin with.) The problem may also be related to a fundamental misunderstanding on my part regarding inRate and outRate. I'm going to try some of the suggestions in this thread and see if it makes a difference. Thanks for the quick response!
0 Kudos
Soilworker
Beginner
474 Views
I've experimented a bit with different inRate and outRate values, and I've come to the conclusion that (most likely) my original assumption is correct - these need to be set to the sample rates I'm converting from and to (resepctively.) In my case, I'm trying to resample from 44100 Hz inRate to 88200 Hz outRate.

Interestingly, code example 8-4 doesn't initialize inRate or outRate to any values. I've also tried that approach, same crashing behavior. But what bothers me more about this is: how is the function supposed to work without a specified inRate and outRate?

Generally, speaking, there is a lack of clarity as to which parameters in the associated functions are supposed to be initialized prior to runtime, and which parameters are supposed to be blank placeholders for values used for internal storage by the functions during runtime.
0 Kudos
Soilworker
Beginner
474 Views
Hmm, over 100 views and no help on how to use the function. Back to the latest v7 update, I'm going to write my own oversampler using upSample/downSample methods plus FIR. Blackman window is superior to Kaiser window for this anyway...

I've gotta say, IPP itself rocks, but I've experienced better documentation and support in free and lower cost librarires.
0 Kudos
Chao_Y_Intel
Moderator
474 Views

Hello,

Sorry for the confusion you got. If you could provide some details on the problem (possibly some code that show the problem), it would be helpful to check the problem. Also, these is some simple test code at the manual. That could be some code starting to use the function.

Thanks,
Chao

0 Kudos
Reply