Downsampling to 16kHz without aliasing

Gianni Leone's icon

Hi all,

I've tried many methods and maybe I just lack a general understanding of aliasing, but I'm attempting to record audio from adc~ to sfrecord~ and change the sample rate to 16kHz by sending sfrecord~ a 'resample 0.362812' message, but there is aliasing!

Before I attempt to drag in a lowpass filter from BEAP, try and use poly~ for resampling, or some other futile attempt, would anyone be able to help me and explain how resampling works in max and how to achieve a 16kHz 8 channel wav. file?

I do have a good understanding of sample rate but just not this advanced.

Any help is greatly appreciated,

Gianni.

Gianni Leone's icon
volker böhm's icon

looks like sfrecord~ does it's down-sampling by simply applying a sah without interpolation (no anti-aliasing/brickwall filter). So it's up to you to make sure there are no signal components above nyquist of your target rate (e.g. by using a suitable lowpass) _before_ the recording/downsampling stage.
But without any compelling reason against it, I'd recommend doing the whole resampling business offline using software, that was made for it.

Source Audio's icon

If recording file needs not to be very long,
one could record into 8 channel buffer set to sr of 16000.
crop the buffer at end of recording.

Max Patch
Copy patch and select New From Clipboard in Max.


In case of recording with sfrecord,
shell object could post process the file.
On mac for example using afconvert :
afconvert -d LEI16@16000 -f WAVE path_to_file