DAC Reconstruction Filter Talk and Other Stuff

Discussion in 'Random Thoughts' started by Garns, Jan 20, 2017.

  1. Armaegis

    Armaegis Friend

    Pyrate BWC
    Joined:
    Sep 27, 2015
    Likes Received:
    7,537
    Trophy Points:
    113
    Location:
    Winnipeg
    Er... are you equating a vertical transform to a horizontal one? This only works if you only have no constants inside the function.
     
  2. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    Adding noise or dither, quantization, squaring, power functions, level compression, limiting and so forth are non-linear operations.

    That said, AFAIK none fit the definition of aliasing, which is another type of non-linearity.

    All of this is obvious to me my friend. But while I think aliasing is a non-linear behavior, I don't think all non-linear behaviors or operators fit the definition of aliasing.

    (EDIT: squaring and other non-linear operations fully within the digital domain may result in aliasing, but the squaring operation itself is not aliasing)

    +++

    On a separate subject, dithering is a non-linear operation that may be used to reduce the detrimental effects of other non-linear issues.

    And, further note that squaring, a non-linear operator, is used fairly often in optimization and error minimization algorithms. So non-linear does not necessarily mean undesirable in all applications.

    The point is, just because an operation is non-linear, it doesn't make it "bad", "voodoo", or whatever. Even detection algorithms of many kinds benefit would flat out would not work w/o non-linear operations.
     
    Last edited: Jan 31, 2017
  3. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    When an operator adds frequencies to an input signal, the operator by definition is non-linear.

    But for the operator to result in aliasing, there needs to be frequency folding above Nyquist due to a sampling reduction. In other words, frequencies above the Nyquist alias as frequencies below the Nyquist. There is a relationship between the out of band signal and the folded signal. It's not random or statistical.
     
  4. Garns

    Garns Friend

    Pyrate
    Joined:
    Jul 9, 2016
    Likes Received:
    2,484
    Trophy Points:
    93
    Location:
    Sydney, AUS
    I think the point is not that they are a kind of aliasing, but that they are a way that aliasing can occur in the digital domain. If you had an ADC which didn't band-limit its input, it might alias. When you do DSP you could think conceptually that you are first doing a "DAC step" which lands in the world of ideal mathematical signals, then whatever your DSP code is, and then an "ADC step". The intermediate step operates on a non band-limitied signal and so can create whatever frequencies it likes. So if the "ADC step" doesn't band-limit the result properly you will get aliasing.

    For example, take a full scale 440hz sine wave and blast it in the digital domain by f(x) = x^1000. You will get something that alternates between sample values +fs and -fs but that's not what you should get: you should get a band limited square wave, the correct sequence of samples for which is not just +fs and -fs. The latter will introduce aliasing. A correctly band-limited square wave will ring (as below):

    [​IMG]
     
    Last edited: Jan 27, 2017
  5. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    That's not aliasing though. It's kind of semantics really, but if you want to be precise, note that by blasting to x^1000, you don't get fold over.
     
  6. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    Say you have two tones. One at 19 kHz and one at 43.1 kHz (analog domain). Now say you sample at 44.1 kHz. Your 43.1 kHz tone will ALIAS back to 1 kHz (digital domain). The 19 kHz will be happy where it's at.

    It is sort of periodic, and such a behavior can be used to demodulate actually.

    Why I say it's periodic? Say instead of 43.1 kHz, the tone is at 89.1 kHz. That one goes down to 1 kHz as well. And so on. As you look at this closely you can see how you an demodulate things on the passband to baseband in a communications system.

    BTW, the periodic images that alias back have alternating frequency reversals. On real applications, these reversal have very real consequences.
     
    Last edited: Jan 27, 2017
  7. Garns

    Garns Friend

    Pyrate
    Joined:
    Jul 9, 2016
    Likes Received:
    2,484
    Trophy Points:
    93
    Location:
    Sydney, AUS
    At a strict level I agree with that: you wanted to apply some non-linear transform to your digital signal and indeed you have. I guess the reason I would call this aliasing is that if you did this entirely in the analogue domain your output signal would only contain frequencies which were integer multiples of your input frequency, whereas if you do it naively in the digital domain your output signal will contain frequencies entirely unrelated to your input frequency. So the "aliasing" arises on comparing your expectations of what the ideal mathematical function should do to the frequency response and what that same function applied in the digital domain, without further thought, does to the frequency response. Basically because the set of band-limited signals is not closed in the set of all signals under non-linear transformations.
     
  8. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    So, been sort of busy.

    You can have distortion that is harmonically related to the input signal in both analog and digital domain.

    The difference in digital is that one cannot represent frequencies higher or equal to half the sampling rate. They alias, or fold over. This gives rise to the z-transforms and the famous unit-circle.

    Anyhow. Aliasing is a classic DSP concept. Maybe there are alternative definitions on different contexts. But that I don't know.
     
  9. briskly

    briskly Friend

    Pyrate
    Joined:
    Oct 3, 2015
    Likes Received:
    59
    Trophy Points:
    18
    Location:
    New York
    I don't follow this part.

    Sampled time should be periodic in the frequency domain, with additional repetitions of the sampled spectrum spaced by intervals equal to the sampling rate [from Poisson summation]. Sampling and reconstruction theorems follow from using a brickwall filter to remove overlap and signal not within the passband, respectively.
    The more impressive demonstrations of imaging comes from "NOS" S/H DACs; output images are weakly attenuated by sinc response.

    So, if I think get what you're saying here: rather than represent all the values it takes, you make a branch cut at Nyquist to limit to the principal values on the unit circle.
     
  10. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    I believe the "Images arise from inserting zeros while upsampling" quote applies to upsampling fully in the digital domain (not sampling).

    In sampling (not upsampling) which happens when the signal goes from analog to digital domain, one needs an analog filter (could be a brickwall) to remove signal above Nyquist which will fold over and overlap after sampling if not removed. Some residuals still fold over depending on the filter.

    This AFAIK is ADC talk.

    Things above the Nyquist that are not filtered out fold over to the principal values. They "alias" as lower frequencies. The new frequencies are related to the original by subtracting an appropriate multiple of the sampling frequency I think.
     
    Last edited: Jan 28, 2017
  11. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    So I think I'm a little more rested.

    When one samples something one might be able to think of it as impulses in the analog domain. However, in reality things become numbers inside computers which follow a clock. To these numbers there is no notion of continuous time. There is nothing in between clock pulses. It's discrete time.

    Impulses in analog domain are visualization aids in a way. Sure, if they existed then sampled analog signals would have periodic perfect images. An infinite number of them. And the signal therefore would have infinite power. This does not exist, and indeed it follows that Dirac delta functions do not exist.

    NOS S/H DACs do not result in impulses. They are stair steps approximations, and are more related to pulses of finite energy and a pulse width related to the sampling rate. They output images are not weakly attenuated by a sinc response. They are severely attenuated by it as you go up in frequency and makes what otherwise would be infinite power, finite. Remember, a sinc is infinite but has finite energy. It tends to zero pretty fast. In reality, the impulse train images are never there. Let say, there is no impulse train convolved with a pulse. There is just a S/H operation in the DAC.

    If we are moving away from sampling, upsampling, downsampling, and into other forms of non-linearities, one can also look at aliasing in action if we restrict ourselves fully into the digital domain.

    The example that @Garns brought up about power is a good one.

    Consider a 10 kHz signal:

    tone10k.jpg

    When the 10 kHz signal is squared, one gets a 20 kHz and DC component, all of which are below the Nyquist of 22.05 kHz:

    tone10k_square.jpg
    But what happens if the signal is 20 kHz, and we square it? The 20 kHz signal is below Nyquist, but one of the components of it's square is not: 40 kHz. This component will be aliased down to 44.1 kHz (2 x Nyquist) - 40 kHz = 4.1 kHz. So one may see the DC component + the 4.1 kHz alias of 40 kHz:

    tone20k_square.jpg

    So a square does seem to result in aliasing when in the digital domain.

    But addition of noise, quantization or not, probably does not. One can think of noise as the linear combination of two signals: source and noise. Noise frequencies may not be correlated at all to the source frequencies. Given the lack of a relationship between these two signals, I don't see how there can be aliasing between them. Furthermore, consider noise may be bandlimited itself. And it usually is on somewhat well designed front ends.

    Consider a 1 kHz square wave. Here is how it looks like in the frequency domain:

    I don't think there is aliasing or fold over. What one is probably seeing is the effective windowing of the square wave, plus effects of the relationship between the signal frequency with the sampling frequency, plus the dominant harmonics of the square wave. Whatever is going on in between the samples cannot be displayed, and it's precisely that that could fold over.


    1k_square.jpg

    Now going back to sinc like ringing on the squarewave. The ringing is what the interpolation filter does when "connecting the dots" or while interpolateing assuming a band limited signal. Because when bandlimiting a square wave, that's how it looks like. One may reduce the ringing. But that may require a frequency domain window (or filter) that lets in some aliasing, or rolls off the pass band a bit, or requires a larger transition band (a file that is sampled above 44.1 kHz perhaps, like say 96 kHz). I would take ringing over aliasing and roll off. I don't think ringing is a problem.

    A 96 kHz sampling rate is nice. That may allow other filters with less ringing (which again I don't think it's a problem), and lower order w/o severe aliasing or roll-off compromises. Burrito Combo and other high order FIRs IMO should work nicely though.

    (Sorry for the multiple edits. Trying hard to make things somewhat understandable.)
     
    Last edited: Jan 29, 2017
  12. ultrabike

    ultrabike Measurbator - Admin

    Staff Member Pyrate MZR
    Joined:
    Sep 25, 2015
    Likes Received:
    8,960
    Trophy Points:
    113
    Location:
    Irvine CA
    BTW, too much math guys. Enjoy your gears.
     
  13. zonto

    zonto Friend

    Pyrate Contributor
    Joined:
    Sep 30, 2015
    Likes Received:
    4,980
    Trophy Points:
    113
    Location:
    Boston, MA
    Got an email from Benchmark today with a resource relevant to the quoted language. Passing along for reference: Application Notes - Intersample Overs in CD Recordings.
     

Share This Page