5
$\begingroup$

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?

$\endgroup$
  • 1
    $\begingroup$ What's your ultimate goal for calculating this envelope? What do you plan to use it for? $\endgroup$ – Jason R Nov 30 '11 at 17:08
  • $\begingroup$ Not sure I understand your initial question/goal - you want a smooth version of your FFT, am I reading you right? $\endgroup$ – Spacey Mar 24 '12 at 21:29
5
$\begingroup$

We use peak picking in the power spectrum followed by parabolic interpolation to get the envelope. As you said, you can set your granularity depending on how many peaks per octave you require. We used it to do formant preservation in speech pitch shifting within a phase vocoder framework....

| improve this answer | |
$\endgroup$
  • $\begingroup$ Ok this seems to be the best way to get a good, true, fit. Glad I'm not barking up the wrong tree! $\endgroup$ – Goz Dec 1 '11 at 9:05
5
$\begingroup$

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?

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.