What is KVR Audio? | Submit News | Advertise | Developer Account

Options (Affects News & Product results only):

OS:
Format:
Include:
Quick Search KVR

"Quick Search" KVR Audio's Product Database, News Items, Developer Listings, Forum Topics and videos here. For advanced Product Database searching please use the full product search. For the forum you can use the phpBB forum search.

To utilize the power of Google you can use the integrated Google Site Search.

Products 0

Developers 0

News 0

Forum 0

Videos 0

Search  

oversampling iir-filter (pre/post filtering)

DSP, Plug-in and Host development discussion.

Moderator: Moderators (Main)

KVRer
 
8 posts since 18 Sep, 2011

Postby chipnix; Sat Jun 14, 2014 2:23 am oversampling iir-filter (pre/post filtering)

Hi there people,

i over-sample a IIR (minimal phase) filter to achieve more precision filter curves near the nyquist frequency.

input -> insert zeros -> (pre-filter) -> IIR-Filter -> (post-filter) -> remove zero places -> output

To my surprise there is no difference if i remove the pre/post-filtering (assuming ideal filters), also i don't detect any aliasing artifacts without pre/post-filtering.

Can't it be, through the nature of IIR-Filters, which not create any additional harmonic content, no pre/post-filtering is required in this case, or do i something wrong, just feeding my processing with the wrong test-signals?
KVRer
 
8 posts since 18 Sep, 2011

Postby chipnix; Sat Jun 14, 2014 2:36 am Re: oversampling iir-filter (pre/post filtering)

mhh to answer myself, i think my assumption was wrong!
Because of the phase shift, the signal will move into the zero-places... (and so information gets lost)
KVRist
 
497 posts since 23 Nov, 2010

Postby sonigen; Sat Jun 14, 2014 4:18 am Re: oversampling iir-filter (pre/post filtering)

If you're only doing linear processing then aliases from upsampling will fold back onto the original signal when you downsample. In some cases (EG lowpass) the aliasing will often be well hidden. If you have a sine at 5khz, upsample 2x with zero stuffing, lowpass it, then downsample again, the alias image caused by zero stuffing will fold back onto the 5khz original. If your lowpass was a 24db type, then the alias will be maybe 60dbs down, so it'll just cause a tiny gain change in the original 5khz sine when it's folded back.

Try doing it with a highpass, that'll leave all the aliases to fold back, you'll see some weirdness then.
Chris Jones
www.sonigen.com
KVRAF
 
4081 posts since 11 Feb, 2006, from Helsinki, Finland
 

Postby mystran; Sat Jun 14, 2014 6:02 am Re: oversampling iir-filter (pre/post filtering)

With linear processing, it's sufficient to just filter once.. if you up-sample with a proper filter, then down-sampling filter is redundant, because a linear process doesn't create harmonics and the up-sampling filter already removed everything (and similarly if you're down-sampling with a filter, then the images from just zero-stuffing naively for up-sampling don't really matter, because they get removed anyway). But if you don't do any filtering at all (neither up or down sampling), then there will be images created by up-sampling which will alias when down-sampling.

The aliasing frequencies here will be the same as the original frequencies, so it's not like you can actually see it in the normal ways.. your EQ just ends up with (sometimes very) distorted curves.
Image <- plugins | forum
KVRist
 
263 posts since 26 Apr, 2004, from UK
  

Postby Miles1981; Sun Jun 15, 2014 3:02 am Re: oversampling iir-filter (pre/post filtering)

The thing is to use a proper up sampling filter. Padding with zeros definitely is not the proper way to avoid aliasing. BTW, this is only needed if you are working at 44.1 or 48kHz, otherwise you can remove this additional step.
KVRist
 
321 posts since 13 Nov, 2002, from Germany, Darmstadt

Postby helium; Sun Jun 15, 2014 5:23 am Re: oversampling iir-filter (pre/post filtering)

Miles1981 wrote:The thing is to use a proper up sampling filter. Padding with zeros definitely is not the proper way to avoid aliasing.

Padding with zeros will mirror the spectrum into the new range without altering the existing spectrum at all. Then you can filter out everything above the old Nyquist. Why would that not be a proper way to avoid aliasing?
Why is 6 afraid of 7

Because 7 8 9.
KVRist
 
263 posts since 26 Apr, 2004, from UK
  

Postby Miles1981; Sun Jun 15, 2014 5:49 am Re: oversampling iir-filter (pre/post filtering)

Because it is additional work, when you can do everything in one pass. And a low-pass filter has additional issues.
KVRAF
 
4081 posts since 11 Feb, 2006, from Helsinki, Finland
 

Postby mystran; Sun Jun 15, 2014 7:41 am Re: oversampling iir-filter (pre/post filtering)

Miles1981 wrote:Because it is additional work, when you can do everything in one pass. And a low-pass filter has additional issues.


Well, you normally fold the zero-stuffing into your poly-phase implementation, so you don't actually need build a signal with the extra zeroes at any point, you just need your up-sampling filter to work "as-if" those zeroes were there (producing more output samples compared to input) but conceptually it isn't just "proper way" since it's actually pretty much the ONLY way to up-sample (with or without anti-aliasing).

For example, if you simply duplicated every sample (for 2x) then this is in fact equivalent to zero-stuffing followed by box-car filter. Or if you used linear interpolation, then the filter would be triangular. Unlike high quality anti-alias filters, both of these will significantly distort the original spectrum, but in terms of math, you can still break down the process into zero-stuffing and filtering.
Image <- plugins | forum
KVRist
 
493 posts since 11 Apr, 2002

Postby Z1202; Mon Jun 16, 2014 4:10 am Re: oversampling iir-filter (pre/post filtering)

Talking of zero-stuffing, I actually think this is an unnecessary overcompilcation of the subject with a few unnecessary "arcane" points (as mystran put it recently :wink: )

IMHO, a much more intuitive view of resampling is by having an intermediate step in the continuous-time domain. You basically just convolve the initial PCM signal (continuous-time impulse train with varying impulse amplitude) with your preferred lowpass impulse response (windowed sinc being the most obvious example) and then sample it again at the new rate. This results in pretty much the same resampling filter, except that you don't need any "artificial" zero-stuffing.
KVRAF
 
4081 posts since 11 Feb, 2006, from Helsinki, Finland
 

Postby mystran; Mon Jun 16, 2014 5:03 am Re: oversampling iir-filter (pre/post filtering)

Z1202 wrote:IMHO, a much more intuitive view of resampling is by having an intermediate step in the continuous-time domain. You basically just convolve the initial PCM signal (continuous-time impulse train with varying impulse amplitude) with your preferred lowpass impulse response (windowed sinc being the most obvious example) and then sample it again at the new rate. This results in pretty much the same resampling filter, except that you don't need any "artificial" zero-stuffing.


Well, except.. mathematically you'd then be treating each sample as a dirac delta, essentially zero-stuffing to a sample-rate limit at infinity.. sort of anyway. :P
Image <- plugins | forum

Moderator: Moderators (Main)

Return to DSP and Plug-in Development