CHANGSTAR: Audiophile Headphone Reviews and Early 90s Style BBS

  • December 31, 2015, 12:22:12 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Ringing/Anti-aliasing Discussion  (Read 2100 times)

0 Members and 1 Guest are viewing this topic.

xnor

  • Pirate
  • **
  • Brownie Points: +39/-50
  • Offline Offline
  • Posts: 154
Re: Ringing/Anti-aliasing Discussion
« Reply #10 on: June 26, 2013, 08:48:57 PM »

Here's what happens if you filter a properly bandlimited signal again with a filter that has lots of ringing:



Sample rate is 44.1 kHz.

data1's passband ends at 20 kHz, stopband starts just below 22.05 kHz. 120 dB stopband attenuation. This filter has about 170 coefficients.
data2 is a much steeper filter. Passband ends at 22.02 kHz, so less than 30 Hz transition! 180 dB stopband attenuation. Causes much longer ringing as you can see. This filter has about 23000 coefficients.

data3 is data1 filtered with data2. There's no extra ringing.


(Can a mod please move this whole ringing/anti-aliasing sub-discussion into a new thread? Thank you.)
« Last Edit: June 27, 2013, 07:55:07 PM by xnor »
Logged
"I'm on a whole new adventure." - "Growing a mustache?"
"No. Bigger than that." - "A beard?!?"

Anaxilus.

  • Dikus Beligerantis Analmorticus
  • Pirate
  • **
  • Brownie Points: +65535/-65535
  • Offline Offline
  • Posts: 577
Re: Ringing/Anti-aliasing Discussion
« Reply #11 on: June 27, 2013, 08:29:58 AM »

Manuals are for slow cars and drivers that can't left foot brake.  Which is why NASCAR still uses them.  The real racing world like F1, Porsche and Ferrari have moved on toward better performance than 'manuals' are capable of delivering.  Modern physics has exceeded their potential.  I wouldn't say Sebastian Vettel or Fernando Alonso have no business in a race car if they didn't know how to drive a manual.  Point being, sometimes there are more important things for people to focus on that are more relevant for what they are trying to accomplish.  That doesn't excuse ignorance of very significant and personally relevant knowledge however.     
Logged
If you do not change direction, you may end up where you are heading - Lao Tzu

AstralStorm

  • Speculation and Speculums
  • Able Bodied Sailor
  • Pirate
  • ***
  • Brownie Points: +250/-164
  • Offline Offline
  • Posts: 559
  • Warning: causes nearby electronics to go haywire
Re: Ringing/Anti-aliasing Discussion
« Reply #12 on: June 27, 2013, 10:15:02 AM »

Uh, windowing sinc with sinc gives you the shorter sinc. That's why nothing happened.

For comparison, please show ringing from:
1. Apodizing filter.
2. Butterworth high order lowpass.
3. Chebyshev type 2 (flat passband) high order lowpass.
4. Kaiser windowed sinc FIR lowpass with reasonable stopband. (For instance, what Speex resampler uses. Their filter is -98 dB stopband with 95% passband width.)
5. Cubic interpolation.
Logged
For sale: Hifiman HE-500; Paradox; Brainwavz B2. PM me if you would like to buy them.

xnor

  • Pirate
  • **
  • Brownie Points: +39/-50
  • Offline Offline
  • Posts: 154
Re: Ringing/Anti-aliasing Discussion
« Reply #13 on: June 27, 2013, 01:48:34 PM »

Uh, windowing sinc with sinc gives you the shorter sinc. That's why nothing happened.
Ahm, both are windowed sinc filters. The result is by definition longer (the order of both filters summed plus one).
It's not that nothing happened, but that the filter cannot remove what was already removed so no extra visible ringing is added. There is however ringing added way way down - after the end of data1 I looked at the samples of data3, there's ringing about -200 dB down. After quantization all of this is gone.

Will look into other filters you suggested.
« Last Edit: June 27, 2013, 02:19:00 PM by xnor »
Logged
"I'm on a whole new adventure." - "Growing a mustache?"
"No. Bigger than that." - "A beard?!?"

AstralStorm

  • Speculation and Speculums
  • Able Bodied Sailor
  • Pirate
  • ***
  • Brownie Points: +250/-164
  • Offline Offline
  • Posts: 559
  • Warning: causes nearby electronics to go haywire
Re: Ringing/Anti-aliasing Discussion
« Reply #14 on: June 27, 2013, 02:00:34 PM »

Since infinite length sinc is perfect and this one is also fairly long truncation, you won't get much if any change. -200 dBFS is what I'd expect.
If the other sinc was shorter, you'd get some nasty sinc^2(x) distortion added in due to rectangular windowing.
Logged
For sale: Hifiman HE-500; Paradox; Brainwavz B2. PM me if you would like to buy them.

xnor

  • Pirate
  • **
  • Brownie Points: +39/-50
  • Offline Offline
  • Posts: 154
Re: Ringing/Anti-aliasing Discussion
« Reply #15 on: June 27, 2013, 02:35:38 PM »

The thing is, as soon as you have a properly bandlimited signal, let's say a low pass starting at 20 kHz reaching stopband close to 22.05 kHz, you can add an indefinitely steep linear phase reconstruction filter just below 22.05 kHz and the signal will be reconstructed perfectly down to quantization limits and up to just below 22.05 kHz.

Any linear phase filter with slow roll-off, such as an apodizing filter, will just "add" aliasing that rolls off as slow as the filter dictates.
Any steep min phase filter will cause crazy phase shift, cheby type 2 obviously more than butterworth.
Any linear phase filter with less attenuation will also "add" aliasing, but at a more or less constant level comparable to raising the noise floor.

Simple interpolation will not only cause roll off in the potentially audible range but also do a bad job at removing aliasing. In order to get good SNR with something as a simple cubic hermite spline you need quite a high oversampling ratio to begin with.
« Last Edit: June 27, 2013, 06:22:55 PM by xnor »
Logged
"I'm on a whole new adventure." - "Growing a mustache?"
"No. Bigger than that." - "A beard?!?"

xnor

  • Pirate
  • **
  • Brownie Points: +39/-50
  • Offline Offline
  • Posts: 154
Re: Ringing/Anti-aliasing Discussion
« Reply #16 on: June 27, 2013, 07:54:22 PM »

Apodizing filter from 20 to 24.1 kHz and 120 dB rejection.



data1 is the same as before.
data2 is the apodizing filter.
data3 is data1 filtered with data2.
data4 is data1 oversampled with data2.

A closer look at data4 shows that the apodizing filter fails to remove some aliasing:



(data3 doesn't line up perfectly with data1 due to the roll-off starting at 20 kHz.)


And the frequency response of data4 again showing stuff that shouldn't be there: (22.05 kHz = 10^1.3434 kHz)

« Last Edit: June 27, 2013, 08:22:17 PM by xnor »
Logged
"I'm on a whole new adventure." - "Growing a mustache?"
"No. Bigger than that." - "A beard?!?"
Pages: 1 [2]