What is the fastest way to upsample or downsample a signal, given that both block sizes and up/downsample ratios are all powers of 2? For some audio processing filter I need to upsample and downsamplte my signal 16 (!) times, and I need to repeat this a lot of times per block of audio - my current method doesn't even run in realtime on my i7 system. Most important restriction: After downsampling the upsampled signal, the result must be identical to the original (except for rounding errors of course).
I currently use 2 FFTs for this: For example, downsampling looks like this (block size is 2^n): Typical block size: 4096 floats (n=12).
ippsFFTFwd_RToCCS_32f_I(in, pFFTSpec[n+downsampleratio], buf);
ippsFFTInv_CCSToR_32f(in, out, pFFTSpec[n], buf);
Upsampling:
ippsFFTFwd_RToCCS_32f(in, out, pFFTSpec[n], buf);
__m128 zero_mm = _mm_setzero_ps();
for (int count=number/4+1; count<=number*times/4+1; count++)
{
((__m128*)out)[count] = zero_mm;
}
ippsFFTInv_CCSToR_32f_I(out, pFFTSpec[n+newplus], buf);