Hi,
I'm performing upsampling for audio to avoid aliasing. This is what I do:
1) Take source buffer and using cubic interpolation convert it into a
buffer let's say 16x larger.
2) Perform lowpass on the tem****ary buffer with cutoff at X / 16, where X
is just some kind of factor compensating steepness of the filter.
3) Here comes the blackbox - some effect. But in this testing case it
simply does nothing, I'm writing it here, just to show, where some
processing should occur.
4) Downsample simply by taking every 16th sample.
5) Perform lowpass again with cutoff X (now without "/16" since the buffer
has original sampling rate)
The thing is, this generates a huuuuge amount of higher frequencies. I
first removed 5 (final lowpass). Nothing changed. Now when I remove 2
(initial lowpass), then the higher frequencies disappear! Why??? It should
be a lowpass, it should remove them! But it add them instead!
It probably isn't rounding problem, since e.g. 1+2 are done in 64bit fp
arithmetics, so I don't think that would do something like that.
Could it be caused by the downsampling? I originally thought I should
downsample by averaging all 16 samples, not just taking the first of them,
but I found this one in this forum... somewhere. Is it right?
Or any other ideas?
Btw. about the X coefficient. I really did not know what number to use, so
I was thinking like this : SR/2 is the total max -> X = 0.5, but since the
filter is not very good (some kind of biquad), I simply used X = 0.4.
Therefore e.g. if SR=44100 -> cutoff=17.5kHz
Is there a little more precise way to get the coefficient?
Thanks a lot!
jungledmnc


|