Hey, I need to find an algorithm that will upsample from 11.025 kHz to 16.0 kHz. I am having trouble writing one. Does anyone have any insight or has anyone done this before?
Regards,
Dave
Printable View
Hey, I need to find an algorithm that will upsample from 11.025 kHz to 16.0 kHz. I am having trouble writing one. Does anyone have any insight or has anyone done this before?
Regards,
Dave
What you need to do is upsample 11.025 kHz to the lowest common denominator (*16 = 176.4 KHz), then downsample to 16 kHz.
If you go the oppisite direction, don't forget to run a FIR on the result.
-Erik
P.S. You may have to upsample to a higher value (*5) since 11.025 is not a whole number.
I see, I am not a proficient coder however, and am having trouble writing the actual interpolation algorithm.
I could also upsample 11025 by 4x to 44100, interpolate to 48000, then downsample by 3x to get 16000, I am just having trouble with the actual coding of the interpolation part.
It needs to eventually be in C++, but I'm currently working in Matlab (similar to C, C++).
Isn't that the same as the original problem?
There is a mathmatical way of doing this, but I don't really have the time to figure it out.
1. Allocate an array 640X the length of your input. (7056K samples)
2. Copy in the 11.025KHz signal, each Hz put in 640 samples.
3. Read a Hz every 441 samples.
You can reduce this by playing with the numbers a bit. You can put a counter in and offset the sample by 1 every third read if you divide by 3, for instance.
If you are into DSP, you can interpolate it to your 44100 by padding with zeros, then use a FIR to reduce it to 16KHz.
-Erik
Thank you, that works just fine. I avoided interpolation this way by simply up-then-down converting.
I may work on the implementation using interpolation in case upsampling by 640 and downsampling by 441 is too many operations.