DSPRelated.com
Forums

LP residual

Started by Unknown September 11, 2006
Hi,

I would like to compute LP residual of a speech signal s(n). Firstly,
s(n) is divided into frames of 256 samples each. Secondly, linear
prediction filter (order 12) is estimated for each frame using matlab's
LPC( ). However, having concatenated residual from each frame, I found
there are a number of spikes in the residual, the space is about
mulitples of 256. Should I overlap the frames or apply hanning windows
before estimating the LP filter? If so, how to align the data or
reverse the windowing effect?

Thanks

Leans.

linsnail2@yahoo.com wrote:
> Hi, > > I would like to compute LP residual of a speech signal s(n). Firstly, > s(n) is divided into frames of 256 samples each. Secondly, linear > prediction filter (order 12) is estimated for each frame using matlab's > LPC( ). However, having concatenated residual from each frame, I found > there are a number of spikes in the residual, the space is about > mulitples of 256. Should I overlap the frames or apply hanning windows > before estimating the LP filter? If so, how to align the data or > reverse the windowing effect? > > Thanks > > Leans. >
Why not look at how others address this. Source code for a number of codecs can be downloaded from various internet sites. A free implementation of the GSM 06.10 codec is widely available. This is a relatively low complexity codec, and should show you quite clearly how these things may be effectively handled (and yes, real world codecs do not encode frames in isolation. almost all are stateful from frame to frame). Steve
Leans wrote:
> Hi, > > I would like to compute LP residual of a speech signal s(n). Firstly, > s(n) is divided into frames of 256 samples each. Secondly, linear > prediction filter (order 12) is estimated for each frame using matlab's > LPC( ). However, having concatenated residual from each frame, I found > there are a number of spikes in the residual, the space is about > mulitples of 256.
Sounds like a transient due to the predictor filter. Let x_1, x_2, ... , x_N be your frame of data, and a_1, a_2, ...., a_p the LP coefficients for that frame. The residue e_n is computed as e_n = x_n - sum_{k=1}^p a_k x_{n-k}. If n <= p, you (or rather Matlab) sets the non-positive indexed x_n equal to zero, resulting in spikes. For a forward predictor, you can only compute a valid residue e_n for n > p. If you make the frames overlap by p+1 samples, you should get a nice-looking residue signal. Regards, Andor

linsnail2@yahoo.com wrote:

> Hi, > > I would like to compute LP residual of a speech signal s(n).
What for? The key to your question is why do you need the LPC residual.
> Firstly, > s(n) is divided into frames of 256 samples each. Secondly, linear > prediction filter (order 12) is estimated for each frame using matlab's > LPC( ). However, having concatenated residual from each frame, I found > there are a number of spikes in the residual, the space is about > mulitples of 256.
You should consider the impact of the memory of the LPC filter which is inherited from the previous frame.
> Should I overlap the frames or apply hanning windows > before estimating the LP filter? If so, how to align the data or > reverse the windowing effect?
It depends. What do you want as the final result? With Best Regards, Vladimir Vassilevsky, Ph.D. AbVolt, Ltd. 718 Delaware Perry OK 73077 USA Email: vlv@abvolt.com WWW: http://www.abvolt.com Phone: (580)336-7227
Thanks for the previous few posts. The spikes are removed by overlaping
the frames.