Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Which filter artifacts can be eliminated without trade-off? (Read 5582 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Which filter artifacts can be eliminated without trade-off?

I'm learning, please correct any of the following sentences, if the aren't correct:

  • We cannot eliminate ringing, just choose where we want it (pre-, post-).
  • We can minimize ripple by computing power (choice of windowing function) without quality trade-off.
  • Aliasing in resamplers can eventually only be controlled by passband width and filter steepness (dependency to 1).


If 3 is true, why does the SoX offer a dedicated "allow aliasing" option besides bandwidth and steepness?

Which filter artifacts can be eliminated without trade-off?

Reply #1
why does the SoX offer a dedicated "allow aliasing" option besides bandwidth and steepness?

SoX offers a bandwidth option (of which "steep" filter is one particular case) and with this, the stop-band (the point at which the selected attenuation begins) is automatically set to the (old or new as appropriate) nyquist frequency, so there will be no aliasing or imaging (at levels above the selected attenuation). Selecting "allow aliasing" repositions the the filter's stop band to begin above the nyquist.

From an audio perspective, I've not found aliasing particularly useful: if filtering at ~20kHz, one (or at least I) can hear neither the ringing nor the traded aliasing, so it makes no odds. If filtering in the audible band (e.g. resampling 16kHz -> 44.1kHz) then you're trading one audible artefact for another—it might be useful to do so depending on the audio content.

Two minor things that "allow aliasing" give are quicker filtering/conversion due to the shorter filter (but the effect is very small when FFT filtering), and "full" spectrograms that don't fade out at the top of the graph (so that must mean fuller-sounding audio, right?  ).

Which filter artifacts can be eliminated without trade-off?

Reply #2
If I may offer a suggestion:

load octave, the signal package, and the audio package (and whatever else that entails). It's free and it runs on most anything.

then, learn how to run "remez", which is an FIR filter designer.  (while IIR also fits into your question, it's only a question of ringing both before and after, or just after)

The root mechanism in octave isn't good enough to do a really good example of a minimum-phase FIR.

But let me offer a few lines of code. Each of these filters can be plotted (as to response) by using freqz(bb,1)

bb1=remez(32,[0 .4 .6 1],[1 1 0 0])  - short filter, 60dB rejection, small but visible ripple, transition band of .2 times the bandwidth of the digital system.

bb2=remez(64,[0 .45 .55 1],[1 1 0 0]) - same rejection, transition band of .1

Plot both of the filter impuse responses centered with regard to each other on the same horizontal scale.

Look at the steepness of the transition band, look at the shape of the filter.

You will notice something right away.

Then try this

for bb2 do

bbr=roots(bb2);
for (ii=1:64)
if ( abs(bbr(ii))>1)
bbr(ii)=1/bbr(ii);
end
end
bbb=real(poly(bbr));
t=sum(bbb);
bbb=bbb/t;

now to freqz(bbb) and compare it to freqz(bb2)

Holy cow, batman, identical

now plot bbb on top of bb2

Minimum phase FIR ...

Playing with the arguments (and doing "help remez") will let you design a variety of FIR filters, and learn how the tradeoffs actually work.

-----
J. D. (jj) Johnston

Which filter artifacts can be eliminated without trade-off?

Reply #3
Thank you guys, very insightful.

Which filter artifacts can be eliminated without trade-off?

Reply #4
  • We cannot eliminate ringing, just choose where we want it (pre-, post-).
Well, you can reduce it by having a more gentle roll off. That's probably stating the obvious though.

It doesn't need to introduce more aliasing - it can sacrifice more of the frequencies below Nyquist.

You may find this thread interesting...
http://www.hydrogenaudio.org/forums/index....showtopic=68524

Cheers,
David.