Hey guys, weird thing - SR=44kHz, 2x RBJ's HP at 10kHz - everything's fine. SR=96kHz, 2x RBJ's HP at 10kHz - everything's fine. SR=44kHz, upsampled to 88kHz (using cubic interpolation), 2x RBJ's HP at 10kHz, LP (any - tried RBJ's lowpass, windowed sinc with 1024 taps!!!, 64-bit floating points) and the response is just weird: The response should be -6dB at 10kHz and raising to 0dB as it is without upsampling. Instead, it is slightly below -6B and at approx 13kHz the response starts falling from -5dB to -7dB at 20kHz!!! Higher the sampling frequency is, the more the response falls down. When the filter is not there, or for example peak filter is used, nothing happens. And the response is ok. When I do some nasty stuff like distortion, result is ok. What could this be? I though aliasing, but seems to me veeery hard for aliasing. Thanks in advance. dmnc
Weird biquad high-pass behaviour after decimation
Started by ●April 7, 2009
Reply by ●April 8, 20092009-04-08
Reply by ●April 8, 20092009-04-08
jungledmnc wrote:> Come on guys, there must be an explanation :)).The explanation is you are lamer. You are trying to accomplish nonsense by doing stupid things in the stupid way. VLV
Reply by ●April 8, 20092009-04-08
Reply by ●April 8, 20092009-04-08
On 8 Apr., 01:31, "jungledmnc" <jungled...@gmail.com> wrote:> weird thing - > SR=44kHz, 2x RBJ's HP at 10kHz - everything's fine. > SR=96kHz, 2x RBJ's HP at 10kHz - everything's fine. > SR=44kHz, upsampled to 88kHz (using cubic interpolation), 2x RBJ's HP at > 10kHz, LP (any - tried RBJ's lowpass, windowed sinc with 1024 taps!!!, > 64-bit floating points) and the response is just weird: > > The response should be -6dB at 10kHz and raising to 0dB as it is without > upsampling. Instead, it is slightly below -6B and at approx 13kHz the > response starts falling from -5dB to -7dB at 20kHz!!! Higher the sampling > frequency is, the more the response falls down.How do you measure the response? What kind of "cubic interpolation" do you use? Since when is "cubic interpolation" considered a good resampling method for audio? Cheers! SG
Reply by ●April 8, 20092009-04-08
>How do you measure the response?Different ways - first there is VST plugin analyzer (cool piece), which passes in obviously (1,0,0,0,..) and checks the response. Until now it was very accurate. I also used FFT meter in wavelab. And assumed frequency response I get from H(z) directly and seems very accurate.>What kind of "cubic interpolation" do you use?Standard hermite interpolation.>Since when is "cubic interpolation" considered a good resampling >method for audio?Hehe nice ;). Seems to me that everyone has its prefered method :). Anyway I mostly see ideas like "set zero to every second sample and then use LP". But how can I do that, when the filter is never good enough? I use biquads, because they are fast, but truly the frequency response is not very steep. But I also tried FIRs, and it didn't seem worth the incredibly low speed. What do you think is good? Thanks! dmnc
Reply by ●April 8, 20092009-04-08
On 8 Apr., 18:47, "jungledmnc" <jungled...@gmail.com> wrote:> >What kind of "cubic interpolation" do you use? > > Standard hermite interpolation.FYI: For hermite interpolaton you need derivatives. If you use the central differences as derivatives this will be equivalent to Keys' interpolation function with parameter a = -0.5. Used for resampling to twice the sampling rate this will be equivalent to zero stuffing + convolution with the following impulse response: ir = [-1 0 9 16 9 0 -1] ./ 16; % includes scaling by factor 2 For a sampling rate conversion from 44,1 kHz to 88,2 kHz this will damp 16 kHz by 2 dB, 18 kHz by 3 dB, 20 kHz by 4.3 dB ... It will also hardly reject the image frequencies above 22 kHz. But this may not be important in your case.> [...] > What do you think is good?I don't yet know what your goal is. Cheers! SG
Reply by ●April 8, 20092009-04-08
>On 8 Apr., 18:47, "jungledmnc" <jungled...@gmail.com> wrote: >> >What kind of "cubic interpolation" do you use? >> >> Standard hermite interpolation. > >FYI: > >For hermite interpolaton you need derivatives. If you use the central >differences as derivatives this will be equivalent to Keys' >interpolation function with parameter a = -0.5. Used for resampling to >twice the sampling rate this will be equivalent to zero stuffing + >convolution with the following impulse response: > > ir = [-1 0 9 16 9 0 -1] ./ 16; % includes scaling by factor 2 > >For a sampling rate conversion from 44,1 kHz to 88,2 kHz this will >damp >16 kHz by 2 dB, >18 kHz by 3 dB, >20 kHz by 4.3 dB >...Hey first, thanks!! Now - this is pretty interesting, but according to the measurements it does not cause any dampening. How could it when the original samples are the same? This is what I like about it - you can be certain, that samples you already have stay the same and the question is only what the samples in between (which you would make zero) do. (I don't say it cannot remove frequencies, I just don't see how it would) Anyway I'm not sure, but seems to me that if the result is the same, then the intepolation is faster, but the difference is minor I guess.> >It will also hardly reject the image frequencies above 22 kHz. But >this may not be important in your case.This is exactly what is important. I need to preserve everything to 22 kHz and then reduce the frequencies above as quickly as possible. But the important is - keep everything to 22kHz, maybe a 1dB down at 22kHz, but not more.>> [...] >> What do you think is good? > >I don't yet know what your goal is.Well, antialiasing. 88kHz makes most of nonlinear processing generate harmonics in the octave above 22kHz, so if I can remove them afterwards, they would not alias. Do you think the HP filter problem is caused by this? That's the highest surprise for me - I don't get how can the HP filter start to attenuate before 20kHz when processing in 88kHz even when no LP filter is used before decimation. Thanks again! dmnc
Reply by ●April 8, 20092009-04-08
jungledmnc wrote:> I need to preserve everything to 22 kHz and then reduce the > frequencies above as quickly as possible. But the important is - > keep everything to 22kHz, maybe a 1dB down at 22kHz, but not more.No, you're literally going over the top. Those 2 kHz above 20 kHz were designed in to accommodate filter transition bands -- exploit the headroom, your D/A converters do it too. Also contemplate that the interval amounts to less than two semitones (12*log[2](22050/20000) = 1.69). Martin -- Quidquid latine scriptum est, altum videtur.
Reply by ●April 9, 20092009-04-09
On 8 Apr., 22:03, "jungledmnc" <jungled...@gmail.com> wrote:> SG wrote: > >For hermite interpolaton you need derivatives. If you use the central > >differences as derivatives this will be equivalent to Keys' > >interpolation function with parameter a = -0.5. Used for resampling to > >twice the sampling rate this will be equivalent to zero stuffing + > >convolution with the following impulse response: > > > �ir = [-1 0 9 16 9 0 -1] ./ 16; � % includes scaling by factor 2 > > >For a sampling rate conversion from 44,1 kHz to 88,2 kHz this will > >damp > >16 kHz by 2 dB, > >18 kHz by 3 dB, > >20 kHz by 4.3 dB > >... > > Hey first, thanks!! > Now - this is pretty interesting, but according to the measurements it > does not cause any dampening. How could it when the original samples are > the same?Why not? Are you familiar with Matlab/Octave? If not try installing Octave 3.0 (or higher) and type on the Octave console: ir = [-1 0 9 16 9 0 -1] ./ 16; freqz(ir,2,512,44100*2); It'll plot the frequency response of the lowpass filter.> This is what I like about it - you can be certain, that samples > you already have stay the same and the question is only what the samples in > between [...] do.This is true for every half-band lowpass filter. The filter taps I mentioned describe such a half-band filter. The *only* advantage is that you only need to compute "the samples in-between". That's it. It doesn't imply that the lower half of the spectrum won't be changed> Anyway I'm not sure, but seems to me that if the result is the same, then > the intepolation is faster, but the difference is minor I guess.Huh? What did you compare?> [...] > > >I don't yet know what your goal is. > > Well, antialiasing. 88kHz makes most of nonlinear processing generate > harmonics in the octave above 22kHz, so if I can remove them afterwards, > they would not alias.You havn't really mentioned what exactly it is you are doing or trying to do. Are you sure that you use the word "alias" correctly?> Do you think the HP filter problem is caused by this?What does a high pass filter have to do with anything here? Cheers! SG






