lpc

Capsim Block Documentation

Short Description

This star computes the LPC parameters of the input samples.

Top
Input Connections
Port Type Name
0 float x
Top
Parameters
Num Description Type Name Default Value
0 N : Size of the input window int N 128
1 m: Order of the all-pole model <=20 int m 10
2 0=Auto, 1=Covar Method int flag 0
3 File to store the AR coefficients and reflection coeff file fileName stdout
4 Number of points for spectrum int npts 128
Top
States
Num Type Name Initial Value Description
0 int n
1 int numberOfOutputs
2 float* x_P
3 FILE* fp
Top

Declarations


 

   	int i;
   	int j;
	int nrot;
	float tmp1,tmp2;
	float a_A[21];
	float rc_A[21];
	float alpha;
	float* vector();
	int result;
	float realAz,imgAz,Az;
	float theta,dtheta;



Top

Initialization Code



 

       if(m > 20) {
		fprintf(stderr,"lpc: Order > 20 \n");
		return(2);
	}
       numberOfOutputs=NO_OUTPUT_BUFFERS();
       if(numberOfOutputs > 1) {
		fprintf(stderr,"lpc: Number of Outputs > 1 \n");
		return(1);
       }
	/*
	 * Initialize the tapped delay line  to zero.
	 *
	 */
	x_P=vector(N);
	for (i=0; i
    
Top

Main Code



 




while(IT_IN(0)) {
	n += 1 ;
	/*
	 * Shift input sample into tapped delay line
	 */
	tmp2=x(0);
	for(i=0; i
    
Top

Wrapup Code



 

/*
 * close the file
 */
if(strcmp(fileName,"stdout") != 0) fclose(fp);




Top

License



/*  Capsim (r) Text Mode Kernel (TMK) Star Library (Blocks)
    Copyright (C) 1989-2017  Silicon DSP Corporation

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    http://www.silicondsp.com
    Silicon DSP  Corporation
    Las Vegas, Nevada
*/


Top

Description



 

/* lpc.s */
/***********************************************************************
                             lpc()
************************************************************************
This star computes the LPC parameters of the input samples.
The method is based on the routines of "Linear Prediction Analysis
Programs (AUTO-COVAR)", by A. H. Gray and J.D. Markel in IEEE Press
Programs for Digital Signal Processing.

lpc


This star computes the LPC parameters of the input samples.
The method is based on the routines of "Linear Prediction Analysis
Programs (AUTO-COVAR)", by A. H. Gray and J.D. Markel in IEEE Press
Programs for Digital Signal Processing.


Date:       February 22, 1991 
Programmer: Sasan Ardalan

*/