Envelope detection in frequency domain with MATLAB

I need to compute the envelope of a spectrum in MATLAB. Is there a specific function that can do it? I saw the function

[yupper,ylower] = envelope(x,np,'peak')


but i'm not sure this one can be used in the frequency domain. The image below shows the result I would like to obtain (green line).

Any suggestion? Thank you.

• Can you elaborate about this function [yupper,ylower] = envelope(x,np,'peak') or if possible share its code, most probably you can get the green curve by changing the order of cepstrum env. calculation. – Arpit Jain Feb 25 '16 at 12:01
• That is a built-in MATLAB function, you can find more here. The cepstral envelope is an estimation, I'm interested in computing the real envelope. @arpit – Daniel Feb 25 '16 at 17:52
• Thanks for the reference, I think you can use linear prediction for your calculation. this link might be helpful for you dsprelated.com/freebooks/sasp/Spectral_Envelope_Examples.html – Arpit Jain Feb 26 '16 at 4:21
• Thanks for the link, I think I'll try the LPC method. Many thanks for your answers! @arpit – Daniel Feb 26 '16 at 17:37
• @Daniel. Perhaps the material at the following web page may help you: dsprelated.com/showarticle/938.php – Richard Lyons Feb 25 at 11:01