Calculating a spectral envelope I'm trying to calculate the envelope of an arbitrary spectrum but I'm slightly lost as to the best way to do this.

I've looked at cepstral enveloping but its very fiddly and I can't seem to get it to give the right results.  I've also tried LPC but again it eems to miss a lot of the minor peaks while enveloping the major peaks perfectly.

I'm beginning to wonder of the best way would be just to run a sliding window across each frequency bin in an FFT returned magnitude spectrum and select the maximum value within that window.  This way I'd simply pull out all the peaks (at whatever granularity I'm after) and then I can simply plot a curve through the resulting points.

Is there a correct way to calculate the spectral envelope?
Cepstral windowing is the most obvious way to extract a spectral envelope, you have a description here.


  I've looked at cepstral enveloping but its very fiddly and I can't
  seem to get it to give the right results. 


In the linked description, try lowering the lowpass "cut-off" sample (nc) until you retain the amount of detail you want. You can get useful implementation examples here.


  I've also tried LPC but again it eems to miss a lot of the minor peaks
  while enveloping the major peaks perfectly.


Isn't that the point of extracting the spectral envelope? By LPC are you referring to the Linear Prediction Spectral Envelope?