Discussion:
[Freetel-codec2] Levinson Durbin
Steve
2016-09-19 14:36:30 UTC
Permalink
I know this is 20 year old code, but in looking for why my program produces
different pitch values (off by a fraction), I am looking at this algorithm
in lpc.c:

void levinson_durbin( float R[], float lpcs[], int order) {
float a[order+1][order+1]; <---- automatic no initialization

for(i=1; i<=order; i++) {
sum = 0.0;
for(j=1; j<=i-1; j++)
sum += a[i-1][j]*R[i-j]; <-- R multiplied by unknown data

I've even looked at the referenced Makhoul paper, and it glosses over
whatever "a" is supposed to be initially assigned.

I tried assigning 1.0 to "a" elements. Even -1.0 just for kicks.

I guess it doesn't really matter what "a" is, as it seems to work anyway??
David Rowe
2016-09-19 19:15:24 UTC
Permalink
Substituting the actual values for the first outer loop iteration:

for(i=1; i<=10; i++) {
sum = 0.0;
for(j=1; j<=0; j++)
sum += a[i-1][j]*R[i-j]; <-- this line never gets executed

- David
Post by Steve
I know this is 20 year old code, but in looking for why my program
produces different pitch values (off by a fraction), I am looking at
void levinson_durbin( float R[], float lpcs[], int order) {
float a[order+1][order+1]; <---- automatic no initialization
for(i=1; i<=order; i++) {
sum = 0.0;
for(j=1; j<=i-1; j++)
sum += a[i-1][j]*R[i-j]; <-- R multiplied by unknown data
I've even looked at the referenced Makhoul paper, and it glosses over
whatever "a" is supposed to be initially assigned.
I tried assigning 1.0 to "a" elements. Even -1.0 just for kicks.
I guess it doesn't really matter what "a" is, as it seems to work anyway??
------------------------------------------------------------------------------
_______________________________________________
Freetel-codec2 mailing list
https://lists.sourceforge.net/lists/listinfo/freetel-codec2
------------------------------------------------------------------------------
Steve
2016-09-19 19:20:27 UTC
Permalink
Thanks David, I missed that. I printed out the values and was scratching my
head. It was working, but I didn't know why?? That I missed!

Loading...