blindadapt

Capsim Block Documentation

Short Description

Blind adaptive equalization

Top
Parameters
Num Description Type Name Default Value
0 Filter order int N 8
1 Initial step size float mu 0.009
2 step size update ratio float muratio 1.0
3 step size update rate (in samples) int murate 4000
4 variance update ratio float varratio 1.0
5 variance update rate (in samples) int varrate 4000
6 mean float mean 1.0
7 variance float var 0.14
8 Flag: 0=estimate, 1=error int outputFlag 0
9 initilization float init 1.0
Top
States
Num Type Name Initial Value Description
0 float** x_P
1 float** w_P
2 int mucounter
3 int varcounter
4 float tmpvar
5 float tmpmu
Top

Declarations


 

   	int i;
   	int j, k;
        float register1[2];
        float register2[2];
        float output[2];
        float lambda11=0.0, lambda21=0.0, lambda22=0.0, lambda12=0.0;
        float xtemp=0.0, ytemp=0.0;
	FILE *fopen();
	FILE *imp_F;
	FILE *imp;
	FILE *imp_W;



Top

Initialization Code



 

	/*
	 * Allocate memory and return pointers for tapped delay line x_P and
	 * array containing impulse response samples, h_P.
	 *
	 */
	if( (x_P = (float**)calloc(2,sizeof(float*))) == NULL ||
	    (w_P = (float**)calloc(2,sizeof(float*))) == NULL ) {
	   	fprintf(stderr,"convolve: can't allocate work space\n");
		return(4);
	}
        for(i=0; i<2; i++)
	if( (x_P[i] = (float*)calloc(N,sizeof(float))) == NULL ||
	    (w_P[i] = (float*)calloc(N,sizeof(float))) == NULL ) {
	   	fprintf(stderr,"convolve: can't allocate work space\n");
		return(4);
	}
	/*
	 * Read in the impulse response samples into the array
	 * and initialize the tapped delay line to zero.
         * According to this for loop the impulse data is assumed to be
         * in the order of first real then imaginary value for each tap
         *
         */
	tmpvar = var;
	tmpmu = mu;
	mucounter = 0;
	varcounter = 0;
	    w_P[0][0] = init;
      for(j=1;j
    
Top

Main Code



 




	while(IT_IN(0) && IT_IN(1)){
		/*
		 * Shift input samples into tapped delay line
		 */  
		mucounter++ ; 
		varcounter++ ; 
                for( i=0 ; i<2 ; i++)
		register2[i] = INF(i,0);

		for(i=0; i
    
Top

Wrapup Code



 

	free(x_P); free(w_P);




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



 

/* blindadapt.s */
/***********************************************************************
                             blindadapt()
************************************************************************

blindadapt


Blind adaptive equalization


Date:  July 9, 1990 
Programmer: Karaoguz, Jeyhan 

*/