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

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

#include <stdio.h>
#define FLOAT 4

main()
{
        int anal,j;
	int npoles,lpcframe,lpclast,nblpc;
	long nskiplpc;
	float vals[50]; /* enough for 46 poles + 4 data values */
	char  output[32];
	fprintf(stderr," Enter name of lpc analysis file and no. poles\t");
	scanf("%s %d",output,&npoles);
	if((anal = open(output,0)) < 0) {
		fprintf(stderr," Can't open lpc analysis file\n");
		exit(1);
		}
again:	fprintf(stderr," Enter first and last frames\t");
	scanf("%d %d",&lpcframe,&lpclast);
	nblpc = (long)(npoles+4)*FLOAT; 
	nskiplpc = (long)(lpcframe)* (long)(nblpc);  
	if(lseek(anal,nskiplpc,0) < 0) {
		printf(" Bad lseek\n");
		goto again;
		}
	for(j=lpcframe;j<=lpclast;j++) {
		if(read(anal,(char *)vals,nblpc) != nblpc) {
			printf(" bad read\n");
			goto again;
			}
		printf("%d %f %f %f %f\n",j,vals[0],vals[1],vals[2],vals[3]);
	}
	goto again;
}

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