简体   繁体   中英

Upsampling PCM audio: from 6 kHz to 8kHz

What would a straight-forward way to convert an audio payload (PCM 16bit) from 6 kHz to 8kHz? I understand that this is an interpolation problem.

I fear that a linear interpolation would introduce too much noise. If so, what would be a better interpolation? I was looking at Lanczos resampling but I've seen it used in image scaling only and not sure it's worth it for audio.

I'm using Java. I've found the JSSRC library butI would have prefer something more lightweight. Beside, I'm not sure this is really necessary for low-frequency audio (which happens to be decoded from ADPCM).

BTW, I'm not interested in creating a WAV having a 6 kHz frequency header, I really want to resample.

Linear interpolation is actually pretty good. It's worth giving a try. If you are working in Java with the PCM (obtained from an AudioInputStream, then converting incoming bytes to PCM), then saving, Java will take care of the wav format header details. Did you see this tutorial? Using Files and Format Converters

In the first code example, take special notice of the point where the comment appears: "// Here, do something useful ..."

I think that because you are going to a higher sampling rate, the interpolation process can work. If you were going to a lower rate, there would be complications due to frequencies over 3 Hz (Nyquist for 6 Hz sampling rate) causing aliasing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM