ftp.nice.ch/pub/next/unix/audio/cmix.s.tar.gz#/cmix/lpc/corect.c

This is corect.c in view mode; [Download] [Up]

#include "lpc.h"
#include "complex.h"
corect(r, th, framn)
double r[], th[], framn[];
{
        int j, k, l1, n, np;
        static complex zero = {0.0, 0.0};
        static complex one = {1.0, 0.0};
        complex w[127], ww;

        np = NPOLE + 1;
        for (n=0; n < NPOLE ;++n)  {
                if (r[n] >= (double) 1.0 )
                        r[n] = (double) 1.0 / r[n];
                if (r[n] > (double) 0.99 )
                        r[n] = (double) 0.99;
        }
        for (k=0; k < NPOLE ;++k)
                w[k] = zero;
        w[NPOLE] = one;
        for (k=0; k < NPOLE ;++k)  {
                ww.real = r[k] * cos(th[k]);
                ww.imag = r[k] * sin(th[k]);
                l1 = NPOLE - (k+1);
                for (j=l1; j < NPOLE ;++j) {
                        w[j] = cadd(w[j+1], cmult(w[j], cneg(ww)) );
                w[NPOLE] = cmult(w[NPOLE], cneg(ww));
        }
	}
        for (j=0; j < NPOLE ;++j)
                framn[j] = w[j+1].real;
        return;
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.