Pre and Post Effin Ringing and shit like that

Discussion in 'Blind Testing and Psychoacoustics' started by ultrabike, Aug 17, 2016.

  1. MRC01

    MRC01 Rando

    Joined:
    Dec 10, 2018
    Likes Received:
    20
    Dislikes Received:
    2
    Trophy Points:
    3
    Location:
    Earth
    I don't think that's correct. Imagine a "worst case" digital test signal that is all zeroes (or randomize the LSB for dither, doesn't matter). After about 15 seconds of this, set one sample to full scale / max amplitude, then immediately back to zeroes.
    That 15 seconds of silence isn't really necessary, but I include it to illustrate your point. Consider it as "the music has been playing for a long time, everything is in steady state". Plenty of time to accommodate filter delay and fill all taps.
    A linear phase filter will produce an analog wave that looks like sinc(t), which is symmetric in time surrounding the pulse, so it has a bit of ripple both before and after it.
    To clarify, this ripple is not caused by the linear phase filter suddenly starting up, and the pulse happening before the filter sees enough samples to satisfy its latency requirements. That wouldn't happen anyway, because the DA converter would delay output of any analog signal until it has read ahead far enough to satisfy its latency requirements.
    A finite bandwidth analog signal representing an impulse will ALWAYS have some ripple, somewhere. It's mathematically required.
    One can argue that this ripple is inaudible, especially when oversampling the digital signal to widen the transition band and reduce the filter slope. I'm inclined to agree with that. But that ripple always exists.
     
    skem, famish99 and ultrabike like this.
  2. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Friend MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,259
    Dislikes Received:
    16
    Trophy Points:
    113
    Location:
    Irvine CA
    In Digital Signal Processing, THERE IS NO TERM CALLED "RINGING".

    And in Digital Signal Processing, THERE ARE FILTER TRANSCIENTS.
     
  3. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Friend MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,259
    Dislikes Received:
    16
    Trophy Points:
    113
    Location:
    Irvine CA
    You are talking about an infinite bandwidth signal. The ringing is that infinite bandwidth signal being bandlimited by the real world. In-band, the signal will NOT CHANGE.

    An impulse IS AN INFINITE BW SYNCH. As the BW of the sync goes high, it tends to a Dirac impulse. Which is a unicorn that does not exist.

    Real signal will always "ring" because they are band-limited. They are not infinite power. But the "ringing" is out of band behaviour.
     
    Last edited: Dec 11, 2018
    crenca and SoupRKnowva like this.
  4. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Friend MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,259
    Dislikes Received:
    16
    Trophy Points:
    113
    Location:
    Irvine CA
    YES! It is out of band.

    EDIT: To convince yourself generate any bandlimited signal, and pass it through the linear phase filter. You will see some garbage due to transcient behavior at the begining. But if the BW of the filter is larger than the BW of the signal (such as an audio signal), the input should match the output. Regardless of the "ringing" of the linear phase filter.
     
  5. AudioNut

    AudioNut Acquaintance

    Joined:
    Oct 2, 2018
    Likes Received:
    58
    Dislikes Received:
    15
    Trophy Points:
    18
    Location:
    Ottawa, ON
    Uh, my signal processing professor in grad school definitely used the term "ringing" to describe ringing artifacts, and a quick search of Google Books shows that "ringing" is a common term in academic DSP textbooks for this phenomenon.

    You're welcome to use the term "ringing" in whatever way you like, but it's kind of weird to yell in all caps at people who use the term in the way it's used in textbooks.
     
    skem and ultrabike like this.
  6. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Friend MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,259
    Dislikes Received:
    16
    Trophy Points:
    113
    Location:
    Irvine CA
    Well I don't remember that in my textbooks at all. But I'll double check in a minute or two.

    (I'm a bit passionate about the ringing deal, sorry)
     
  7. AudioNut

    AudioNut Acquaintance

    Joined:
    Oct 2, 2018
    Likes Received:
    58
    Dislikes Received:
    15
    Trophy Points:
    18
    Location:
    Ottawa, ON
    I know what you mean :)

    The way I like to think about this conceptually is through an information-theoretic lens rather than through a signal processing lens. Bandlimited sampling is lossy -- it throws away information. On reconstruction, you really only get to pick two out of three to reconstruct the way the signal was before you sampled: frequency response, phase response, or time response. You can't pick all three.
     
  8. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Friend MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,259
    Dislikes Received:
    16
    Trophy Points:
    113
    Location:
    Irvine CA
    Welp. Didn't find much "ringing" terms in my old books, that I still have. I did find Gibbs often. I graduated MSEE on 2000 or 2001, one of those years. I can do wikipedia and see the term there:

    https://en.wikipedia.org/wiki/Ringing_artifacts

    I understand what they are saying, but most of those books are north of 2004. Though the "Handbook of Medical Imaging" does call it "ringing".

    I remember we used "Digital Signal Processing" by Proakis and the one by Oppenheim. I don't have those book with me anymore, but they are the heavy weights along with the likes of "Multirate Systems and Filters" by Vaidyanathan. However, I don't recall these books using the term "ringing" for Gibbs and the likes. At least not often to leave any impression in me.

    Maybe is more trendy now a days.

    I'll let it go for now. But I do rather like to discuss these "ringing" things as transcients when it comes to the impulse response of a filter (digital or analog). It's more informative.

    Regarding bandlimited sampling, there are good reasons why you would never want wide-band sampling: Noise. If your signal of interest lies in a particular bandwidth, you should bandlimit the signal to remove noise and increase your SNR. Noise, particular White Gaussian noise, has a shit tons of information from an information-theory stand point. More than music in general. But you definitively don't want that kind of information on top of your music signal.

    As far as what you get to pick between frequency response, phase response or time response, I disagree. If you get desired frequency response and phase response, you will get the time response right when it comes to signal reproduction. Possible you are not getting the BW set up high enough. But fix that and you fix all three.

    EDIT: Oh. And BTW. A linear phase filter fucks the time domain signal a lot less than a minimum phase filter, all things equal like filter order and so forth. Like fuck tons less. To the point that in some applications, a minimum phase filter is exactly what you don't want.
     
  9. AudioNut

    AudioNut Acquaintance

    Joined:
    Oct 2, 2018
    Likes Received:
    58
    Dislikes Received:
    15
    Trophy Points:
    18
    Location:
    Ottawa, ON
    What I'm saying is not something you can "disagree with". It's just how the math works out.

    You can perfectly reconstruct a bandlimited signal in both time and phase by doing no filtering at all, but the tradeoff is that you get a sinc dip at Nyquist in the frequency response (and of course a whole ton of aliased images beyond the threshold of audibility). Trade-offs. There's no way around this because bandlimited sampling is inherently lossy.

    There are two groups who tend to have a kind of magical thinking around this issue. (i) Undergraduates first learning about signal processing and (ii) others who only work with bandlimited signals to begin with (e.g., networking and communication types). Percussion in the real world is not bandlimited; that's the nature of quasi-impulses.

    Every compromise in bandlimited sampling can be bettered by more bandwidth. No one disagrees with that. No one really questions linear phase reconstruction for 88.2kHz and above signals, since you can allow the frequency response to droop high above the human threshold of hearing and make very few compromises. Where unfortunately we have real world issues to deal with is in Redbook sampling, where there is limited margin to work with and we're forced to make compromises.

    "fucks" is not really a quantitative measurement. What matters is what's audible by humans. It makes sense that post-echo is less audible, given what we know about auditory masking (without this, MP3/AAC compression would be a lot less effective). What we don't have good data on is how audible pre-echo is. Not many people are aware of this, but the MP3 and AAC codec teams took opposing approaches to apportioning pre-echo. MP3 has quite a bit longer pre-echo than AAC, but much lower in level. AAC picks the opposite tradeoff. For those who can hear differences between the two codecs, this is one of major explanations for the differences.
     
    Last edited: Dec 11, 2018
    geniekid and famish99 like this.
  10. MRC01

    MRC01 Rando

    Joined:
    Dec 10, 2018
    Likes Received:
    20
    Dislikes Received:
    2
    Trophy Points:
    3
    Location:
    Earth
    The ripple frequency can't be out of band. It exists in the output wave, and by definition, the filter outputs a bandwidth-limited wave.

    I agree. But oversampling should solve the problem for Redbook. Without it, the transition band is 20k - 22.05k which is only 0.14 octaves. With 8x oversampling, the transition band is 20k - 176.4k which is 3.14 octaves. Huge difference, more gradual slope, less passband ripple.
    If the Redbook compromise you refer to is oversampling, then I agree. But it seems to be closer to a solution than a compromise.
     
  11. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Friend MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,259
    Dislikes Received:
    16
    Trophy Points:
    113
    Location:
    Irvine CA
    That is not how the math works out.

    You are talking reconstruction in the the context of digital signal. In that context, you cannot perfectly resconstruct a bandlimited signal in both time and phase by doing no filtering.

    With no digital and/or analog filtering, the S/H of the DAC will give you nice stair step approximations to the original.

    Any other approach you have in mind to fill in between samples in the analog domain other than filtering?

    I'm not an undergraduate first learing about signal processing. But I do work with bandlimited signals (ANALOG AN DIGITAL).

    In fact, your claim here makes it clear that you are over your head.

    Percussion in the real world are very bandlimited. In fact, AFAIK there is nothing in this world that is not bandlimited.

    I will grant you that some books may describe as "ringing" concepts that are probably better described in a different way. Books are not perfect.

    But you have no idea how this "percusion in the real world is not bandlimited" claim is over the top. If you are going to demand rigor in arguments you better get your facts straight and take it down a notch. Or you will get on my nerves and ban your ass.

    I don't think I got my message clear to you. More bandwidth is not always better. Because of noise.

    And no. I can get a linear phase filter with Redbook sampling and a very step roll off. Great phase, frequency and time domain. The price you pay is the large order (size) of the FIR filter.

    You cannot hear what is not there. If the original and the reproduced signal are on top of eachother, what is the problem? Where is the masking?
     
    Last edited: Dec 11, 2018
    crenca likes this.
  12. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Friend MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,259
    Dislikes Received:
    16
    Trophy Points:
    113
    Location:
    Irvine CA
    It is out of band. On every low pass filter you define three band: Pass-band, Transition-band, and Stop-band.

    The ripple is not in the Pass-band. Otherwise a signal within the pass-band of the filter will exhibit distortion. That's not what we see on flat linear phase filter, again, as long as the input signal is within the pass-band.

    You do not want to extend the bandwidth too much. Noise is one problem. There maybe others.

    And again. You can make a brick wall FIR linear phase w little phase, frequency and time issues. You pay for it in the latency due to the size of such filter (power and size maybe issues too).

    EDIT: The issue with many brickwall filters is that they tend to be implemented by relatively small order IIRs that do cause some phase issues among other things. That's is oposite to what we are talking about here. And yes, one can design a brickwall nice linear phase FIR. Again, the problem is filter order.
     
  13. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Friend MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,259
    Dislikes Received:
    16
    Trophy Points:
    113
    Location:
    Irvine CA
    Sorry guys. I'm human. @AudioNut (i) and (ii) points got on my nerves there.
     
    skem, rtaylor76 and Erikdayo like this.
  14. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Friend MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,259
    Dislikes Received:
    16
    Trophy Points:
    113
    Location:
    Irvine CA
    I agree "fucks" is not really a quantitative measurement.

    So go back to this post:
    https://www.superbestaudiofriends.o...n-ringing-and-shit-like-that.2627/#post-70767

    Do a visual inspection. If that is not enough because more rigor is needed we can always look at mean square error between original and reconstructed. But based on the visuals (and what I know), I can guarantee you that linear phase pre/post ringing will destroy minimum phase post ringing (due to phase distortion that affects time domain steady state response).
     
  15. purr1n

    purr1n Finding his inner redneck

    Staff Member Friend BWC
    Joined:
    Sep 24, 2015
    Likes Received:
    48,797
    Dislikes Received:
    80
    Trophy Points:
    113
    Location:
    Antarctica
    How can we reconstruct a bandlimited signal without a filter? Can you expound on this, i.e. cite the math? Did you mean connect the dots - which is what you suggested: reconstructing without a filter? Because if you do this, there will massive in-band aliasing as signals approach the bandwidth limit. Even the data points of a 5khz signal sampled at 44.1Khz are not going to look anything resembling a sine wave.

    Are you saying something like the Shannon-Whittaker interpolation formula used for reconstruction is broken? Last time I checked, it was almost perfect. I agree on the lossy, or more precisely inaccurate aspect, but only a few points gets us awfully close to the original signal. And a few more points on top of that gets eerily close. The errors are in amplitude, but there is no "two of three" thing going on.

    I'm pretty sure percussion attacks are bandwidth limited, although it's possible that a 44.1kHz sampling rate or microphone limitations might not be able to keep up with the rise time of the attack. I'll defer to those in the recording field working at higher AD sampling rates to chime in. I'm pretty sure it's not instantaneous with infinite slope because only Thanos' finger snap can do that, and only he if he has all five infinity stones in his gauntlet.
     
    Last edited: Dec 11, 2018
    crenca and ultrabike like this.
  16. purr1n

    purr1n Finding his inner redneck

    Staff Member Friend BWC
    Joined:
    Sep 24, 2015
    Likes Received:
    48,797
    Dislikes Received:
    80
    Trophy Points:
    113
    Location:
    Antarctica
    Here is the attack of metal percussion (triangles). Looks like some fast attack / steep rise time there with the initial strike!
    perc1.png

    Let's zoom in a bit - concentrating on that initial "impulse".
    perc2.png

    Let's zoom in more (44.1kHz sampling rate) to see the samples - nope, not even close to the bandwidth limit.
    perc3.png
     
    Last edited: Dec 11, 2018
    Psalmanazar, crenca, Lyander and 2 others like this.
  17. MRC01

    MRC01 Rando

    Joined:
    Dec 10, 2018
    Likes Received:
    20
    Dislikes Received:
    2
    Trophy Points:
    3
    Location:
    Earth
    These do have extreme HF content, but it's so easy to lose when recording. You have to consider the mics used, at what distance, etc.
    That said, if you want natural sounds that have lots of HF, also try plucked harp strings and castanets. They have energy up to and beyond 20 kHz. Great test for A/B/X testing all kinds of stuff.
    But, you have to find a high quality recording that captures that. This is rare; most fail to and don't sound natural or real.
     
    skem likes this.
  18. MRC01

    MRC01 Rando

    Joined:
    Dec 10, 2018
    Likes Received:
    20
    Dislikes Received:
    2
    Trophy Points:
    3
    Location:
    Earth
    As I mentioned, that ripple is in the wave after filtering. By definition, it's in the passband. And yes, that means it's distortion.

    As I recall, the S-W theorem says that a signal can be perfectly reconstructed, IF it is bandwidth limited below the Nyquist frequency. But that's a big IF. To satisfy that condition, you must apply an anti-alias filter. Ay, there's the rub! There is no perfect anti-alias filter. They all "fuck" the passband in some way, however small. So there will be distortion, however small. Even if you could reconstruct it perfectly.
     
    skem and AudioNut like this.
  19. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Friend MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,259
    Dislikes Received:
    16
    Trophy Points:
    113
    Location:
    Irvine CA
    That means distortion, huh?

    When you store a nice impulse in the digital domain, as in all zeros except for a unit value sample in some random place, do you know what the assumed signal is in between samples, assuming a Nyquist bandlimited signal was stored?

    Can you describe the shape of a bandlimited impulse?

    Does a Dirac delta exist in real world? What would that imply?

    The "rub" is that the perfect reconstruction filter is also a unicorn. Because it's infinitely long and not causal. And the point is that you have to define what "fuck" the passband means.

    If you capture about 99.99% of the sync, and you have a sufficiently long filter with low ripple in the passband, then relative to other things in the reproduciton chain, what does "fuck" really mean?

    Do you know how much the phase gets "fucked" with a minium phase filter vs. a linear phase filter if we keep filter order the same for both types of filters and assuming similar contraints?
     
    crenca likes this.
  20. purr1n

    purr1n Finding his inner redneck

    Staff Member Friend BWC
    Joined:
    Sep 24, 2015
    Likes Received:
    48,797
    Dislikes Received:
    80
    Trophy Points:
    113
    Location:
    Antarctica
    Yes, and in the case of reconstructing content up to 20kHz using a 44.1kHz sampling rate, we are well below the Nyquist frequency. I don't see how this is a big IF. It's not an IF. It's a CERTAINTY with the 16/44 PCM formats that we use today.

    W/S interpolation is effectively a low-pass or anti-alias or reconstruction filter.

    Do you actually know what you are talking about? Have you actually done the math or written a W/S interpolation subroutine in C/C++/BASIC/Fortran? Because I actually have.

    That makes absolutely no sense. If you reconstruct a waveform perfectly to the original, there is no distortion.

    The hair cells in our inner ears don't respond past 20kHz, much less 15kHz for most people. Microphones do have roll-off and non-linear response, but recording engineers use EQ to account for this. There is a reason why high-end microphones come with polar response and frequency response charts.
     
    Last edited: Dec 11, 2018
    crenca and ultrabike like this.

Share This Page