Sample Rate Conversion

I possibly have a few more questions about this later, but number 1 is can you use the sample rate conversion routine in chains? I don’t see it in the menu but might it be concealed under another name?

Actually I am not too concerned about this anymore, since I have now found a foobar 2000 component that appears to be almost as good as Audacity’s.

I do have one other general question however. Looking at a waveform pre- and post sample rate conversion there is a slight but noticeable change in shape. Is there a rule of thumb for the maximum headroom to allow when sample rate conversion is the final stage?

And is it right to assume that a limiter should be used before any sample rate conversion?

It is difficult too say which head room is required for your specific effect. You should simply try it out (with White noise, this gives the highest differencies)
I can only Show you how much the head room must be to use a high Quality resampling in Nyquist.
Put this code into the Nyquist prompt (under effects) and press the debug button.

(setf srates '(192000 96000 48000 44100 32000 24000 22050              16000 12000 11025 8000))    
(setf sr-len (length srates))
(abs-env 
  (dotimes (i sr-len) (dotimes (j sr-len) 
    (setf peak (peak (mult (/ 0.95) 
      (resample (sound-srate-abs (nth i srates)(noise)) 
        (nth j srates))) ny:all))
    (format t 
"From ~a to ~a:
  New peak ~a
  Suggested amplification: ~a dB~%" 
      (nth i srates) (nth j srates) peak (linear-to-db (/ peak))))))

It’s a Long listbecause it Shows 121 different combinations.
If the conversion is between the same sample rates, then this is intended and Shows how a high Quality Interpolation modifies a wave form when forced.
You can edit the ‘srates’ list and remove or add sample rates.
In General a head room of 3 to dB should be sufficient.
The values of the code example are based on White noise with a Peak of 1 (0 dB).
sharp edged wave forms will most likely overshoot the most.
Note that there are also results where the opposite is true - the Peak is smaller after the resamppling.
Note also that this resampling algorithm is not the one used by Audacity
(in the menu or on exporting).
If you want to use a limiter is up to you
There are mastering VSTs out there that do all in one.

To be sure of no clipping (worst case scenario) I think that you would need to allow 6 dB of headroom. In practice it will almost always be much less. For most musical material 1 dB will probably be enough but I would tend to allow a little more.

No. Using a limiter before sample rate conversion will often increase the amount of peak amplitude gain caused by resampling.
If you need the resampled audio to be as high as possible, ensure that the track is in 32 bit float format, resample, and then apply limiting if required.
Although 32 bit float format can handle peaks over 0 dB, there is no guarantee that a peak limiter effect will be able to do so - test and check the limiter effect before you rely on it to handle over 0 dB correctly. If you are using a peak limiter that cannot handle over 0 dB, you will need to use the Amplify or Normalize effects before using the peak limiter.

Thanks chaps, that is extremely helpful.

Robert may I also say how impressed I am not only in this instance but also generally with your Nyquist scripts; such power from something with an almost Zen like elegance. Wish I could do that.

Thanks a lot, That goes down like honey but, of course, we stand zen-like humbly beyond such a Hommage.
Nyquist isn’t really that hard to learn, almost like Basic or pseudo code.
There are some concepts however that make one struggle in the beginning.
[example: the first Parameter after a “(” must always be a function. thus a + b would give (+ a b)]
But once you’ve mastered These, it’s pure fun.