el_supremo
Well-known member
I've ordered audio adaptors for my two Teensy 3.1 and while waiting for them to arrive, I've been playing with resampling WAV files using the ARM CMSIS arm_fir_q15 function.
This sketch (for Teensy 3.0 or 3.1) reads a 8kHz WAV file and converts it to 44.1kHz:
http://members.shaw.ca/el_supremo/my_fir_cd_usd_d.zip
There are also a few example WAV files in the samples subdirectory in the zip file.
The sketch reads a 16-bit mono PCM WAV file sampled at 8000Hz from the /samples directory of an attached uSD card, upsamples to 48kHz and lowpass filters the result. It then removes 13 of every 160 samples, which results in a 44.1kHz sampling rate, lowpasses that again and then writes the result into the /resample directory on the uSD card. I had expected that the second part (removing samples) would cause problems. However, it is the upsampling to 48kHz which causes some aliasing which is particularly noticeable in the phone.wav sample.
Play with it. Share any improvements/fixes that you make.
Pete
This sketch (for Teensy 3.0 or 3.1) reads a 8kHz WAV file and converts it to 44.1kHz:
http://members.shaw.ca/el_supremo/my_fir_cd_usd_d.zip
There are also a few example WAV files in the samples subdirectory in the zip file.
The sketch reads a 16-bit mono PCM WAV file sampled at 8000Hz from the /samples directory of an attached uSD card, upsamples to 48kHz and lowpass filters the result. It then removes 13 of every 160 samples, which results in a 44.1kHz sampling rate, lowpasses that again and then writes the result into the /resample directory on the uSD card. I had expected that the second part (removing samples) would cause problems. However, it is the upsampling to 48kHz which causes some aliasing which is particularly noticeable in the phone.wav sample.
Play with it. Share any improvements/fixes that you make.
Pete