5.3.2.13089 Public Beta Spdif optimisation?

  • Ok sure.


    Oh and I forgot to mention in the litany of failings when it comes to aliasing and Reason. Christoph is right that there is literally no reason to use anything other than 44.1k... in Reason that is. Reason supports other sample rates than 44.1k but on export rather than lo-passing and downresing the output, it reduces the resolution on the audio tracks on input. The whole project runs at whatever you're exporting to. Meaning every effect and ITB instrument will exhibit as much aliasing as if you'd worked at 44.1k.


    That is only Reason though (another reason why I use Studio 1 much more these days for export with Reason run in Rewire mode).


    Anyhow, just as an example:


    http://www.peranders.com/music…le_aliasing_44k_v_96k.wav


    This is what happens with the venerable "Scream" distortion unit in Reason, it's old but can be glorious on synths. The setup is just a straight sine wave input just shifting in frequency from a Subtractor (which also has it's own problems). It's a particularly egregious example of aliasing. The first section is 44.1k the second is at 96k (obviously as they're both in a single file the file itself is at 44.1k/24bit). You can hear how much of an improvement running at 96k gives in this situation. It'll never completely eradicate the aliasing artifacts, but it shifts them significantly further up, to the point of not being anywhere near as offensive, and quite possibly they may not even be really noticeable within a mix.


    Maybe Christoph has more sway with the Propellerheads and can get them to do something about it, because myself and a bunch of voices in forums and blogs haven't managed to change anything.

  • Who knows, could be just ancient code that no-one wants to touch, but then you could always wrap that inside of a little upres/downres object or template. Or it could be that it's all just too slow. Or maybe they've just got too limited resources.


    Reason is a little unique among the DAW world. It's adherence to the "Rack" philosophy means it's basically a node network. Node networks are great for ad-hoc (pull) execution, because of the inbuilt dependency handling (making them a form of acceleration structure in this setup) only what needs to executes, executes, and they allow huge flexibility, you can route stuff anywhere which leads to some creative fun. But they're not very good for push based execution. The overhead within means that you really want to be doing some background heavy lifting to help things out i.e. using caching (freezing in the audio world), which again Reason doesn't do.


    I can forgive it a lot because of the creative potential and how fun it is to use. But that doesn't mean I don't have to use other tools to get around it's limitations (and even those tools exhibit their own problems).

  • Very interesting thread! But hard to grasp completely...So if i understand correctly you can get (in the ideal world) an exact copy of an analog signal after AD and DA conversion. But only when you have ideal filters, otherwise alliasing will occur. With the use of the digital sinc-filters at the AD and DA stage such alliasing is almost not present (certainly not audible). But between the AD and DA part, all kind of math can be applied to the bits, and the amount of artefacts introduced during this proces is completely dependent on how well thought out the math is. On occasions you can compensate less thought out math formulas with upscaling the samplerate.
    Is this a bit of a summary ?(:D ?

  • Almost. In an ideal world you can get an exact duplicate of all frequencies in a signal below the Nyquist frequency (which is half the sampling rate), but in reality there are a number of factors including the filters that cause your converter to not be totally transparent ("as a short wire" in Lavry parlance).


    The sinc filters and function themselves though only introduce actual aliasing artifacts on output, on input if they're not good enough they'll introduce intermodulation artifacts (if the low pass doesn't cut out frequencies above Nyquist, and I guess that does eventually equate to aliasing artifacts at the end) and/or bad attenuation of frequencies at the top end if it's too shallow. Unfortunately in AD you need an analog filter because filtering must occur before sampling.


    Internal to you project, yup. You've got it right, the plugins own upsampling and downsampling will use digital sinc filtering that should be ideal, although there is some debate raging about sequential plugins introducing their own artifacts on other forums. Anyhow, if they don't correctly do this upsampling and downsampling they can introduce frequencies above the Nyquist frequency into the samples and on DA the sinc filter will create nasty aliasing artifacts, because of another of Nyquist observations which is called "folding" where a set of samples may have multiple solutions, so frequencies above the Nyquist frequency still can cause sounds below because the sync filter thinks the samples fit a waveform only containing frequencies bellow the Nyquist rate.... deeep inhale after such a long sentence and so many Nyquists...

  • Per, thanx for or the explanation. I have read that the analog filter which is always necessary before AD conversion is less demanding with oversampling. Oversampling can diminish noise floor but also heightens the Nyquist frequency which is necessary, so your analog filter is easier to build.With the sinq filter than applied you can downsample to f.e. 44.1 to get a clean signal at the AD conversion.

  • That's what I've read too. It makes logical sense too - about the low-pass that is, the noise stuff though, still feels a little snake-oily to me, I mean sure with true white noise and a low pass that doesn't do a great job I can sorta see it, high sampling will identify what belongs above Nyquist in the noise and what is below and kill the stuff above, but that still feels like the job of low pass not sampling and it can't be linear reduction, and it's trying to fix the problems it's introducing.


    Anyhow getting back to the low passing, sharp analog low-passes are expensive to make. So it makes much more sense to just use a cheap one at a higher frequency that's still effective at getting rid of frequencies above a higher Nyquist rate, sample at this higher rate because fast sampling is also cheap and clocks are now accurate enough to do this, then filter digitally which costs nothing but a little latency (although the more samples the better the quality) before decimating to your target rate.

  • Here is the explanation for aliasing caused by distortion:


    If you see digital audio from a simple point of view, it would be similar to analog audio by having an infinite sample rate. But that would require infinite calculation power and memory - not adequate.
    Therefore special mathematics rules and technics have been invented over the last decades to make analog audio happen in the digital domain at the best possible sampling rate, e.g. 44.1 kHz.


    There is (to my knowledge) only one topic that cannot be solved by this math: distortion.
    To make it perfect, you need a sample rate as high as possible.
    It depends in the amount of distortion, what sample rate is needed to achieve satisfying results.
    Infinite sample rate would always make it perfect.
    Double sample rate would just be the start of it. But your example shows only a gradual improvement.
    4x or 8x sample rate brings you much closer to infinity, in a way.



    The technical explanation:
    If you distort e.g. a sine wave, it will be shaped towards a square wave.
    The slopes of the square wave can become very steep, up to an immediate jump.
    But jumps can only be located from one sample to the next, not inbetween.
    This inability to locate a sonic event inbetween samples is solved by said mathematics in every other case, but cannot be solved in the case of distortion.
    By 2x oversampling, you have doubled the possible locations for this steep jump. By infinite oversamping, any location is possible.


    In a way, 4x or 8x oversampling is much closer to infinity than just 2x.

  • That's beautifully-explained IMHO Christoph; even I understood it.


    For me this poses the obvious question:


    Surely Sony's bitstream technology would've solved this distortion-accuracy issue, like, 20 years ago or whenever the company invented it? I mean, IIRC the sample rate's in the megahertz, right?

  • You are talking about the SACD?
    The SACD principle is a beautiful way to digitize audio and play it back, as it samples with a high frequency in the MHz region at 1 Bit only.
    But you might be surprized, that modern AD and DA converters do exactly the same.
    Remember in my earlier post that our converter samples at 5.6 Mhz, the SACD at 2.8 MHz (ups, that is even lower).


    While the SACD keep and store that high sampled data, the AD converter transforms it into the chosen lower sampling rate and higher bit depth (PCM signal).
    This transformation is done in the digital domain (using those Sinc Filters and more) and it's about lossless, given the known boundaries of the target sampling rate and bit depth.


    So why is it transformed and not kept in the high frequency domain? Because computers have a hard time to do signal processing on a 1 Bit signal. To my knowledge the math to do so, is not even developed.
    But it's not necessary anyway, since the old PCM format is as good, once you are in the digital domain.


    So can the SACD principle help avoiding distortion aliasing? No.
    Is the SACD principle of any help? Yes, every day. It is in every modern audio AD/DA converter.

  • Very interesting - but now I've got to ask...
    Sampling at 1 bit?? How does that work?



    Edit: Found the answer - that one bit stores whether the signal at a particular sample is higher or lower than at the preceding one. Clever.

  • Exactly, Michael. I remember being impressed at the "genius" simplicity of the idea back when it was introduced by Sony, and wondering why we'd been "wasting", at that time, another 15 or 23 bits (now 31 and 63 as well) of information / disk space.


    You are talking about the SACD?

    Yes, and you answered my question beautifully. Thank you Christoph!

  • Exactly, Michael. I remember being impressed at the "genius" simplicity of the idea back when it was introduced by Sony, and wondering why we'd been "wasting", at that time, another 15 or 23 bits (now 31 and 63 as well) of information / disk space.


    Yes, and you answered my question beautifully. Thank you Christoph!

    It's simple and genius for dealing with audio streams. There's no ambiguity about what the bits mean, 1 is always up, 0 is always down. But it's not a saving in bandwidth/space.


    Imagine an 8 bit audio stream, to go from -128 to 127 takes a single sample. But with 1 bit encoding you're limited by the slew rate. To accurately recreate 8 bit audio you need 256 samples, that's 256 individual bits of data. If you have a syllabic filter you can speed things up (basically think if the value stays at 1 or 0 for multiply samples it increase the slew rate, think of it almost like adjusting velocities rather than straight directions), but it's still going to be a lot more data than the original 2 bytes.


    The real genius of the system is the realization that at that high sampling rate the waveform doesn't move that fast so it's a total waste to use higher bit depth samples, and that when you're streaming lots and lots of data at crazy high frequencies or converting digital to analog it's much easier to deal with a simple up/down than little blocks of bits.

  • I have an old yamaha rex50 which was released in the late 80's: 31 kHz sampling and a very nasty 80's distortion (which is nowadays regarded as 'authentic 'en 'full of character' :D ) . I also have a TC2290 (which has the 1 bit sampling). We all raved about it back than, but now i'm working in my DAW with a RME fireface and every time i'm impressed how much improved the AD conversion is during the last 25 years: so much more transparent and with behold of the transients etc. But i'm still fond of these old machines, nostalgia.. :wacko:
    And the difference between this rex50 distortion and kemper... listen: http://www.synthmania.com/Yama…Audio/21%20DISTORTION.mp3 8o:D