I am trying to write a small synth code that goes something like this, I have an abstract symbolic sound representation, sine/square/saw waves. To generate final sound and make it sound good I thought of the following steps;

  • At first oversample the abstract symbolic representation
  • apply noise shaped dither
  • apply anti-aliasing algorithm
  • last. downsample to local devices sample rate or FLAC sample rate

Point is that the input is not going to be quantized, but more of a symbolic representation to allow arbitrary-precision oversampling. The way I think of it is something like an abstract representations of unit generators, which can run at arbitrary rate depending on the output selected.

In general, I am trying to minimize quantization errors and lower perceived noise within the context of working over symbolic sound, but only once I know the target sample rate.

I am confused about ordering of the middle 2 steps. What order should noise shaped dither and anti-aliasing be applied? Is placing downsampling last the correct idea or should it maybe be reordered too?

  • 1
    $\begingroup$ Generally the order of operation would be 1) gnerate signals are oversampled rate, 2) lowpass filter and down-sample, 3) quantize, add dither and noise shape for file export. Note that you should ONLY quantize and dither for the final product (i.e. the studio master). If there will be any post processing (like import to a DAW) just leave it in floating point. $\endgroup$
    – Hilmar
    Commented May 22, 2023 at 22:27
  • $\begingroup$ Thanks. For a more advance anti-aliasing filter; could lowpass just be replaced by it? $\endgroup$
    – Ilk
    Commented May 22, 2023 at 22:37
  • 1
    $\begingroup$ An anti-aliasing IS a low-pass filter. It's required to minimize aliasing during the down-sampling process. What "more advanced" features would you add ? $\endgroup$
    – Hilmar
    Commented May 22, 2023 at 22:45
  • 1
    $\begingroup$ Generating alias-suppressed classic analog waveforms is a whole topic in and of itself. $\endgroup$ Commented May 22, 2023 at 23:04
  • $\begingroup$ I don't know where the noise shaping and dithering is coming into the picture yet. Can't you make your synthesis algorithm work in floating-point? Dithering and noise-shaping is only needed when there is a word width reduction. We call that "quantization". $\endgroup$ Commented May 23, 2023 at 4:15


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.