Ok, the easiest approach is to take every 48/44.1
th sample (which is equal to kick out every 12th sample). You will eventually have to do this.
The problem with that is aliasing. If your downsampling, you are actually mirroring the spectrum outside of your downsampling rate into your samples (see this wiki page for a good explanation), which is called aliasing. You obviously don't want that (you can try it out and see, what happens with your audio).
So how can we prevent that? The most common way is to reduce the spectrum amplitude of those mirrored frequency chunks somehow. This way, they are mirrored, but it doesn't matter so much anymore, because their amplitude is very low. This can be done by using a lowpass filter with a cutoff frequency around your sampling ratio. So the steps would be:
- Lowpass filter your samples to get rid of high frequency amplitudes over 44.1kHz (be careful not to get rid of stuff under that)
- Subsample your data (in your case, kick out every 12th sample)
So what are the requirements for that filter? One of the important requirements is that the frequency amplitudes below your cutoff frequency should not be touched, so a very low passband ripple and a passband gain of 1 would be nice. Then the stoppband should be dampened as much as possible. This obviously depends on your data. I don't know about audio processing in special, but usually in DSP, the lowpass filter that are used are FIR
or IIR
. There are many other of course, but these are very easy to implement and are to a certain extend even able to handle realtime constraints.
So I suggest you read into thos two filter implementations (or just focus on FIR
). If you are really confused about what I just wrote, then maybe it's even better to just use a given library that has some sort of lowpass filtering ability. But if you are working with that stuff a lot, then I suggest reading into the matter, it really helps to understand, what is going on... ;)