- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The ippsResamplePolyphase_16sfunction was available in IPP Speech Recognition domain libray, which was excluded from IPP 7.0 product.
Could you please provide more information in term of what kind of application you are working on, what other IPP functions you may use from this deprecated library, how this functionality is critical for your application needs?
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
there is a more general function available in ippSP domain - ippsFIR.
Several steps are required for full substitution of SR ResamplePolyphase:
1) Generate filter coefficients using Mathlab or ippsFIRGen functionality. ippsFIRGen works with the next smoothing windows: ippWinBartlett,ippWinBlackman,ippWinHamming,ippWinHann,ippWinRect while ResamplePolyphase uses Kaiser window - but I think it is not of principle.
2) Use the next function(s) for Multi-Rate filter initialization:ippsFIRMRInitAlloc or a pair of ippsFIRMRGetSize and ippsFIRMRInit (the first one allocates memory buffers internaly, the second provides opportunity to use an external memory buffer allocated by you)
3) Use ippsFIR function for filtering with resampling. MR version supports any arbitrary resampling ratios and initial phases for input/output.
Regards,
Igor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ryan,
Igor provided some recommendation of the replacement. Besides, the SR domain function will continue to be supported in the IPP 6.1 product. You can use the SR functions in IPP 6.1 release. We are working on the KB articles, which will help the users.
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As you know, the library is quite large (>12,000 functions). The maintenance and testing associated with this very large number of functions is quite significant. With the introduction of the Intel AVX instruction set (Sandy Bridge microarchitecture processors) the process of moving functions forward to support these new instructions simply adds to that load.
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
However, in theory, does ippsResamplePolyphase internallyuse some kind of muti-rate filter too?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
could you please share piece of source code where you use FIRMR functions? The noise might be caused by non optimal use of these functions.
Yes, ippsResamplePolyphase internally use FIR filters.
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What I want to do is to resample signals between 44.1 and 48 Hz. I receiveblocks of audio samples and resample them to the target rate. When I resample the current block, I can keep previous block, but I do not have next block.
//compute the sampling factors
unsigned long ulLCM = _GetLCM(m_ulSrcRate,m_ulDstRate);
m_ulUpFactor = ulLCM / m_ulSrcRate;
m_ulDownFactor = ulLCM / m_ulDstRate;
////----------create the linear filter ------------
m_ulFilterLen = 2*m_ulUpFactor - 1 ;
m_pFilterTaps = (Ipp32f*)_aligned_malloc(sizeof(Ipp32f)*m_ulFilterLen,16);
unsigned long N = m_ulFilterLen / 2 + 1;
ippsVectorRamp_32f(m_pFilterTaps,N,1.0/N,1.0/N);
ippsVectorRamp_32f(m_pFilterTaps+N-1,N,1.0,-1.0/N);
//set up the delay line for each track;
m_ulDelayLen = (m_ulFilterLen + m_ulUpFactor - 1)/m_ulUpFactor;
for (i=0; i
{
Ipp16s* pDelayLine = (Ipp16s*)_aligned_malloc(sizeof(Ipp16s)*m_ulDelayLen,16);
ZeroMemory(pDelayLine,sizeof(Ipp16s)*m_ulDelayLen);
m_apDelayLine = pDelayLine;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CFIRMultiRateResampler::Resample16BitMonoTo16BitMono2(unsigned long in_ulNbSourceBuffer, void * in_pvSourceBuffer16Mono, unsigned long & out_ulNbDestinationBuffer, void * in_pvDestinationBuffer16Mono, EMvAudioResamplerMode in_eAudioResamplerMode, unsigned long in_ulAudioTrack)
{
HRESULT hr = MV_NOERROR;
unsigned long i;
IppStatus st = ippStsNoErr;
Ipp16s *pSrc = (Ipp16s*)in_pvSourceBuffer16Mono; //pointer to the current src sample buffer
Ipp16s *pDst = (Ipp16s*)in_pvDestinationBuffer16Mono; //pointer to the current dst sample buffer
unsigned long ulDstSamples = 0; //number of dst samples we generate by resampling
int numIters = 1; //iter. count
Ipp16s *pDelayLine = m_apDelayLine[in_ulAudioTrack]; //delay line
double dPhase = m_dPhase[in_ulAudioTrack];
if (in_ulAudioTrack >= m_ulNbAudioTracks)
{
assert(!"CFIRMultiRateResampler::Resample16BitMonoTo16BitMono - invalid audio track index!");
return MV_E_OUT_OF_RANGE;
}
//extend to the delay line if seek
if ( in_eAudioResamplerMode == keMvAudioResamplerModeSeek )
{
ippsSet_16s( *pSrc, pDelayLine, m_ulDelayLen);
dPhase = m_ulFilterLen/2+1;
}
//divide source to two parts
unsigned long ulSrcSamples = (in_ulNbSourceBuffer / m_ulDownFactor)*m_ulDownFactor; //part1
unsigned long ulWorkSamples = in_ulNbSourceBuffer - ulSrcSamples; //part2
//---------re-sample part1---------------
ulDstSamples = ulSrcSamples*m_ulUpFactor/m_ulDownFactor;
if (ulDstSamples > out_ulNbDestinationBuffer)
{
hr = MV_E_DESTINATION_BUFFER_TOO_SMALL;
assert(SUCCEEDED(hr));
return hr;
}
numIters = ulSrcSamples / m_ulDownFactor;
st = ippsFIRMR32f_Direct_16s_Sfs(pSrc,pDst,numIters,m_pFilterTaps,m_ulFilterLen,m_ulUpFactor,1,m_ulDownFactor,0,pDelayLine,0);
assert(st == ippStsNoErr);
pSrc += ulSrcSamples;
pDst += ulDstSamples;
dPhase += ulSrcSamples;
////debug
//memcpy(pDst,pSrc,ulWorkSamples*sizeof(Ipp16s));
//ulDstSamples+=ulWorkSamples;
//ulWorkSamples = 0;
//---------re-sample part2--------------
if (ulWorkSamples > 0)
{
//update the delay line
for (i = 0; i
{
pDelayLine = *(pSrc- i - 1);
}
//copy part2 to the work buffer
Ipp16s *pWorkBuffer = m_apWorkBuffer[in_ulAudioTrack];
memcpy(pWorkBuffer,pSrc,ulWorkSamples*sizeof(Ipp16s));
pSrc += ulWorkSamples;
//update the delay line
for (i=0; i
{
pDelayLine = *(pSrc - i + 1);
}
//extend to max
for (i=0; i
{
pWorkBuffer[ulWorkSamples+i] = pWorkBuffer[ulWorkSamples-1];
}
//re-sample the work buffer
unsigned long ulResampledSamples = ulWorkSamples*m_ulUpFactor / m_ulDownFactor;
int numIters = m_ulWorkMaxSamples / m_ulDownFactor;
IppStatus st = ippStsNoErr;
//update the dst samples count
ulDstSamples += ulResampledSamples;
if (ulDstSamples > out_ulNbDestinationBuffer)
{
hr = MV_E_DESTINATION_BUFFER_TOO_SMALL;
assert(SUCCEEDED(hr));
return hr;
}
st = ippsFIRMR32f_Direct_16s_Sfs(pWorkBuffer,pDst,numIters,m_pFilterTaps,m_ulFilterLen,m_ulUpFactor,1,m_ulDownFactor,0,pDelayLine,0);
assert(st == ippStsNoErr);
dPhase += ulDstSamples;
}
//num. of the result samples
out_ulNbDestinationBuffer = ulDstSamples;
m_dPhase[in_ulAudioTrack] = dPhase;
return hr;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you please take a look at my code? I am not sure about the following:
My code is based on the sample code from the IPP book. Is the linear filter not good? I divide the input buffer to two parts to try to handle the boundary. Is it correct? Should I use ippsFIRMRStreamInitAlloc to handle the transition between buffers? Many thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
there is a more general function available in ippSP domain - ippsFIR.
Several steps are required for full substitution of SR ResamplePolyphase:
1) Generate filter coefficients using Mathlab or ippsFIRGen functionality. ippsFIRGen works with the next smoothing windows: ippWinBartlett,ippWinBlackman,ippWinHamming,ippWinHann,ippWinRect while ResamplePolyphase uses Kaiser window - but I think it is not of principle.
2) Use the next function(s) for Multi-Rate filter initialization:ippsFIRMRInitAlloc or a pair of ippsFIRMRGetSize and ippsFIRMRInit (the first one allocates memory buffers internaly, the second provides opportunity to use an external memory buffer allocated by you)
3) Use ippsFIR function for filtering with resampling. MR version supports any arbitrary resampling ratios and initial phases for input/output.
Regards,
Igor
Igor,
Could you provide some details about generating the filter coefficients?
In our case, we're resampling from 44.1 kHz to 8 kHz. As I understand, this will require an upsampling factor of 80 and a downsampling factor of 441. Should we now generate the filter coefficients (using ippFIRGen) with 44.1 kHz * 80 as the sample rate? And how should one determine the filter length?
In this case, the normalized filter cutoff frequency (4 kHz / (44.1 kHz * 80)) is very small and it seems to be difficult to get the pass band amplitude response to be flat.
Also, I assume the filter coefficients need to be scaled according to the upsampling factor?
All in all, I also wish the original polyphase resampling function was available (or something equivalent for straightforward resampling).
Regards,
Arto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
// include this code before your calls to ippsResamplePolyphase...
// thisworks is for Visual C 10 and Ipp 5
#if (IPP_VERSION_MAJOR >= 7)
extern "C" {
// from ippsr.h
struct ResamplingPolyphaseFixed_16s;
typedef struct ResamplingPolyphaseFixed_16s IppsResamplingPolyphaseFixed_16s;
IppStatus __STDCALL w7_ippsResamplePolyphaseFixed_16s(const IppsResamplingPolyphaseFixed_16s *pState,
const Ipp16s *pSrc, int len, Ipp16s *pDst,
Ipp32f norm, Ipp64f *pTime, int *pOutlen);
IppStatus __STDCALL w7_ippsResamplePolyphaseFixedFree_16s(IppsResamplingPolyphaseFixed_16s* pSpec);
IppStatus __STDCALL w7_ippsResamplePolyphaseFixedInitAlloc_16s(IppsResamplingPolyphaseFixed_16s** pState, int inRate, int outRate, int len, Ipp32f rollf, Ipp32f alpha, IppHintAlgorithm hint);
}
#define ippsResamplePolyphaseFixed_16s w7_ippsResamplePolyphaseFixed_16s
#define ippsResamplePolyphaseFixedFree_16s w7_ippsResamplePolyphaseFixedFree_16s
#define ippsResamplePolyphaseFixedInitAlloc_16s w7_ippsResamplePolyphaseFixedInitAlloc_16s
// use the location of your old ippstatic libs in the following pragma
#pragma comment(lib, "c:/SDK/IPP/5.0/ia32/lib/ippsrmerged.lib")
#endif
How to do this for other CPU types is left as an exercise to the reader.
Linc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's another vote that removal of theSR non-integer (AKA arbitrary ratio) resampling functions is a big disappointment. We use them in several key portions of our analysisSW. Recoding this functionality is a serious waste of time for us to get back to previous working v6 behavior.
Wewere waiting for7.0.2 which contains fixes to 2 bugs we submitted, but now cannot due to this loss of functionality, until we recreate the resampling functions and test them. And as Ryan has noted, the FirMR functions do not provide the functionality needed for "true" arbitrary ratio resampling. This requires a significant amount of work to implement and verify.
These are very basic and useful DSP functions. They certainly are not specific to SR work, as our use is proof of. Why can they not be migrated to the Filtering Functions portion of IPP?
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your concern and feedback on this issue. Currently we are reviewing the alternative possible solutions to address this issue in IPP 7.0, and we will keep you posted soon.
Ying
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As Turing showed decades ago, as long as you can loop and count you can do every computation, given enough time and memory. So the logic that there is an alternative way just doesn't always provide a viaable solution.
I use a software pattern called flyweight that makes multiple resamplers with little overhead. Now I would have to rewrite all this code to contend with the different filters created.
As the issue with testing, that is bull.Just don't convert it for the newer systems.A tweek here or there and all the tests run. Really disapointed in this decision
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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