# Linear Predictive Coding for general signals

I have a signal that's monotonic and roughly linear and have been looking at using Linear Predictive Coding to encode information and compress my signal. I guess my first general question is if this is even possible for general signals? I also see LPC mentioned in the context of speech so I'm wondering if LPC is particularly effective for one type of signal and would be really bad for another type of signal. Here's how I understand the process so far:

We have an input signal $$x(n)$$ that we look to model as $$x(n) = \sum_{i=1}^{p} a_i x(n-i) + e(n)$$

where the $$a_i$$ are our prediction coefficients and $$e(n)$$ is the error. We can find the error $$e(n)$$ by filtering the inverse transfer function $$\frac{1}{H(z)}$$ with our signal $$x(n)$$. Thus, if we can closely model the error with a small number of a parameters, our signal has been reduced to our prediction coefficients and these small parameters.

I see why LPC is often used for speech compression - because the error $$e(n)$$ is roughly white and so we can roughly model it by its variance. However, my intuition tells me that it should be much easier to compress something like perfectly linear signal than a highly nonstationary signal like a vocal sample. So I guess my questions are (provided I'm understanding LPC correctly):

1. Do people use LPC for things other than speech, and if so, how do they go about modeling $$e(n)$$ to achieve compression?

2. If my intuition is correct about it being easier to compress a linear signal using LPC, how would one do it in this case? I'm confused because since a perfectly linear signal is exactly predictable, it should produce $$0$$ for all $$e(n)$$. However, filtering a linear signal with prediction coefficients $$[2,-1]$$ produces a non-zero $$e(n)$$.

There may be a misunderstanding about LPC here. For one, it is mainly used for speech because it was designed to fit the model of the human vocal system. The figure below is taken from Purdue's VISE lab in one of their speech processing exercises. The figure shows speech modeled as a filter that is excited by either an impulse train or white noise. LPC works well for speech because it gives you a concise way of describing the filter part. You also need to estimate the driving frequency of the pulse train, detect if a time segment is voiced or unvoiced, and control for the power of each time segment.

In the frequency domain, the a speech signal will look like

and all the LPC is expected to do is to fit the spectral envelope.

I see why LPC is often used for speech compression - because the error e(n) is roughly white and so we can roughly model it by its variance.

The significance of a white, particularly additive white Gaussian, error signal is that it means that you have used all of the information. If your error is highly structured, it means that you could do a better job at modeling the system.

Do people use LPC for things other than speech, and if so, how do they go about modeling e(n) to achieve compression?

I'm not aware of it being used for anything apart from speech. As stated above, the vocal system is being modeled by LPC, not the error. The vocal system is modeled using the source-filter model, and LPC is a good way of describing the filter part of the model.

I'm not sure about your second question, but I hope the rest of this help. Speech encoding with LPC is a really interesting, particularly because it works so well. If you want to do some matlab experiments, you could try Lab 9b on Purdue's VISE lab.

• Hi Trey, thanks for the reply. I was taking a look at this paper [hal.archives-ouvertes.fr/hal-01081608/document] (section 4) where the author talks about coding the amplitudes of some data sets via linear prediction. He claims that since the amplitudes are correlated, you can model the signal via past samples with some residual white noise. So I guess I'm just unsure as to how one would do this. – compscinoob Nov 15 '18 at 9:31
• Hey @compscinoob, sorry, I misunderstood the context of your question. I assumed you were learning about LPC, which is generally taught in the context of speech coding. I don't think I can help much with your current particular question. Good luck! – Trey Nov 16 '18 at 13:56
• Hmmm, maybe I can ask a different way. I guess what I'm asking is if I have white noise described by a variance $\sigma^2$ and a set of LPC coefficients, how do I go about reconstructing the predicted signal from there? I've managed to do what it says in the paper - namely reduce my signal to pure white noise. I just don't know what to do now that I have a variance and my set of LPC coefficients. – compscinoob Nov 20 '18 at 10:06