Example #1
0
sample_t fir_sol(sample_t muestra){
    buff_in[p] = muestra;
    int i;
    sample_t muestra_out = 0;
    for(i=0;i<TAP_LENGTH;i++){
        muestra_out = muestra_out + a[i]*buff_in[p];
        update_p(1);
    }
    update_p(1);
    return muestra_out;
}
Example #2
0
sample_t fir(sample_t muestra){
    buff_in[p] = muestra;
    int i;
    sample_t muestra_out = 0;
    for(i=0;i<TAP_LENGTH;i++){
      //printf("Paso: %d\nMuestra: %f\n\n",p,buff_in[p]);
        muestra_out = muestra_out + a[i]*buff_in[p];
        update_p(1);
	
    }
    update_p(1);
    return muestra_out;
}
void LogConCenPH::fastNumActDers(){
	double llk_l, llk_h;// = llk();
	double h_fast = h/100;	
	int k = x.size();
	for(int i = 0; i < k; i++){
		p[i] = 0;
		allActDervs[i] = 0;
	}
	for(int act_i = 0; act_i < getAK() - 1; act_i++)
		update_p(actIndex[act_i], actIndex[act_i+1]);
	for(int act_i = 0; act_i < getAK() - 1; act_i++){
		for(int i = actIndex[act_i]+1; i < actIndex[act_i+1]-1; i++){
			move_act_b(i, h_fast);
			update_p(actIndex[act_i], i);
			update_p(i, actIndex[act_i+1]);
			llk_h = fastBasellk();
			move_act_b(i, -2*h_fast);
			update_p(actIndex[act_i], i);
			update_p(i, actIndex[act_i+1]);
			llk_l = fastBasellk();
			move_act_b(i, h_fast);
			update_p(actIndex[act_i], i);
			update_p(i, actIndex[act_i+1]);
			allActDervs[i] = (llk_h-llk_l)/(h_fast);
		}
	}
}
Example #4
0
/* ------------------------------------------------------------------------ */
static void
make_new_node(int p)
{
	int             q, r;

	r = most_p + 1;
	q = r + 1;
	s_node[~(child[r] = child[most_p])] = r;
	child[q] = ~(p + N_CHAR);
	child[most_p] = q;
	freq[r] = freq[most_p];
	freq[q] = 0;
	block[r] = block[most_p];
	if (most_p == ROOT_P) {
		freq[ROOT_P] = 0xffff;
		edge[block[ROOT_P]]++;
	}
	parent[r] = parent[q] = most_p;
	edge[block[q] = stock[avail++]] = s_node[p + N_CHAR] = most_p = q;
	update_p(p);
}