Close

Downsampling the Audio to 8 Ksps

A project log for Look Who's Talking 0256

A BluePill Driver/Simulator/Emulator for the GI SP0256-AL2

ziggurat29ziggurat29 05/18/2020 at 17:240 Comments

Summary

It occurred to me that the original 11025 sps files probably represent a higher-than-needed sampling rate.  I downsampled to 8 ksps and gain back about 15 K flash, and some relaxed execution requirements.

Deets

It had bugged me for a bit that the sampling rate for the existing audio is 11025 ksps.  This is quite appropriate for the SP0256 in general, which is advertised as having a 5 KHz output bandwidth, however on the -AL2 I find the signal to use less than that.

I discovered an audio processing application I use has a 'batch convert' mode, so I batch converted all the samples to an 8 KHz sampling rate (appropriate anti-aliasing filtering is done prior).  The app I am using is 'Cool Edit', which to wit is long since discontinued (and it has a kind of interesting back story), but I would suspect that the free alternatives such as Audacity would similarly be useful.

This reduced the audio size by about 25%, and it seems to sound more-or-less the same.  I modded the Python PoC to re-compute the ADPCM version and added that to the project.  The sample rate timer, TIM4, needed to be adjusted.  Everything else worked as-is.

This allowed me to gain back 15 K flash, and also reduced the responsivity requirements for preparing sample buffers (since they are now last 64 ms, up from 46).  I wasn't in a crisis in either of those two areas, but it's still nice to have a little more wiggle room.

Next

Who knows?  Is it done, now?

Discussions