10 //const int N_sim=2*1024;
11 const int N_sim=1200;//2048;
13 //const int N_ch=N_samp;
14 const int N_ch=16;//8;
15 const int N_col=128;//32;
18 void FBCore(int N_samp,int N_ch, int N_col,float r[N_sim],float y[N_sim], float H[N_ch][N_col],float F[N_ch][N_col]);
20 static int numiters = 1;
23 int main(int argc, char **argv)
27 while ((option = getopt(argc, argv, "i:")) != -1)
32 numiters = atoi(optarg);
55 for (i=0;i<N_col;i++) {
58 H[j][i]=i*N_col+j*N_ch+j+i+j+1;
65 while (numiters == -1 || numiters-- > 0) {
66 FBCore(N_samp,N_ch,N_col,r,y,H,F);
67 for (i=0;i<N_sim;i++) {
77 raw_test_pass(raw_get_cycle());
83 // the FB core gets the input vector (r) , the filter responses H and F and generates the output vector(y)
84 void FBCore(int N_samp,int N_ch, int N_col,float r[N_sim],float y[N_sim], float H[N_ch][N_col],float F[N_ch][N_col])
87 for (i=0; i < N_sim;i++)
90 for (i=0; i< N_ch; i++)
92 float Vect_H[N_sim]; //(output of the H)
93 float Vect_Dn[(int) N_sim/N_samp]; //output of the down sampler;
94 float Vect_Up[N_sim]; // output of the up sampler;
95 float Vect_F[N_sim];// this is the output of the
97 //raw_test_pass(raw_get_cycle());
100 for (j=0; j< N_sim; j++)
103 /*for (k=0; ((k<N_col) & ((j-k)>=0)); k++)
104 Vect_H[j]+=H[i][k]*r[j-k];*/
109 float tmp = H[i][k]*r[j-k];
112 stat = (k<N_col) & (diff>=0);
118 for (j=0; j < N_sim/N_samp; j++)
119 Vect_Dn[j]=Vect_H[j*N_samp];
122 for (j=0; j < N_sim;j++)
124 for (j=0; j < N_sim/N_samp;j++)
125 Vect_Up[j*N_samp]=Vect_Dn[j];
128 for (j=0; j< N_sim; j++)
131 /*for (k=0; ((k<N_col) & ((j-k)>=0)); k++)
132 Vect_F[j]+=F[i][k]*Vect_Up[j-k];*/
137 float tmp = F[i][k]*Vect_Up[j-k];
140 stat = (k<N_col) & (diff>=0);
145 //adding the results to the y matrix
147 for (j=0; j < N_sim; j++)
150 //raw_test_pass(raw_get_cycle());