Some articles on my website: http://www.earlevel.com/main/category/digital-audio/sample-rate-conversion/ <http://www.earlevel.com/main/category/digital-audio/sample-rate-conversion/>, especially the 2010 articles, but the Amp Sim article might be a helpful overview.
48k -> 8k: Filter with a lowpass with cutoff below 4k; keep 1 sample, throw away 5, repeat.
8k -> 48k: Use 1 sample, follow it with 5 new samples of 0 value, repeat; filter with a lowpass filter with cutoff below 4k.
Nuances:
A linear phase FIR is a popular choice for the lowpass filter (odd length, Kaiser windowed sinc is a good choice). In downsampling, you donât have to calculate the samples you intend to discard, and in upsampling, you donât need to do the operations for added 0-valued samples.
You want the filter stop band (above 4k) to have suitable attenuation (Kaiser is nice for this, because you can specify it, trading off with transition sharpness).
Advance topic: You can optimize performance by doing it in two stages (3x, 2x). You win by noting that the first stage doesnât have to be perfect, and long as the second stage cleans up after it.
Hi,
I need to convert 48Khz to 8KHz on input and convert 8Khz to 48Khz on audio on output.
Could you explain how to do it ?
I need to implement this on android(NDK).
Thanks,
Alex