}
public void print() {
- for(int i = 0; i < this.N_sim; i++) {
+ /*for(int i = 0; i < this.N_sim; i++) {
System.printI((int)(this.y[i] * 10000));
- }
+ }*/
}
}
//convolving H
for (j=0; j< Nsim; j++) {
- for (k=0; ((k<Ncol) && ((j-k)>=0)); k++) {
+ /*for (k=0; ((k<Ncol) & ((j-k)>=0)); k++) {
vH[j]+=H[k]*r[j-k];
- }
+ }*/
+ k = 0;
+ boolean stat = false;
+ int diff = j;
+ do{
+ float tmp = H[k]*r[j-k];
+ k++;
+ diff--;
+ stat = (k<Ncol) & (diff >= 0);
+ vH[j]+=tmp;
+ }while(stat);
}
//Down Samplin
//convolving F
for (j=0; j< Nsim; j++) {
- for (k=0; ((k<Ncol) && ((j-k)>=0)); k++) {
+ /*for (k=0; ((k<Ncol) & ((j-k)>=0)); k++) {
tvF[j]+=F[k]*vUp[j-k];
- }
+ }*/
+ k = 0;
+ boolean stat = false;
+ int diff = j;
+ do{
+ float tmp = F[k]*vUp[j-k];
+ k++;
+ diff--;
+ stat = (k<Ncol) & (diff >= 0);
+ tvF[j]+=tmp;
+ }while(stat);
}
}
}
#ifdef RAW
//print_float(y[i]);
#else
- //printf("%f\n", y[i]);
+ printf("%f\n", y[i]);
#endif
}
}
float Vect_Up[N_sim]; // output of the up sampler;
float Vect_F[N_sim];// this is the output of the
#ifdef RAW
- raw_test_pass(raw_get_cycle());
+ //raw_test_pass(raw_get_cycle());
#endif
-
//convolving H
for (j=0; j< N_sim; j++)
{
Vect_H[j]=0;
- for (k=0; ((k<N_col) & ((j-k)>=0)); k++)
- Vect_H[j]+=H[i][k]*r[j-k];
+ /*for (k=0; ((k<N_col) & ((j-k)>=0)); k++)
+ Vect_H[j]+=H[i][k]*r[j-k];*/
+ k = 0;
+ int stat = 0;
+ int diff = j;
+ do {
+ float tmp = H[i][k]*r[j-k];
+ k++;
+ diff--;
+ stat = (k<N_col) & (diff>=0);
+ Vect_H[j]+=tmp;
+ }while(stat);
}
//Down Sampling
Vect_Dn[j]=Vect_H[j*N_samp];
//Up Sampling
- /*for (j=0; j < N_sim;j++)
+ for (j=0; j < N_sim;j++)
Vect_Up[j]=0;
for (j=0; j < N_sim/N_samp;j++)
- Vect_Up[j*N_samp]=Vect_Dn[j];*/
+ Vect_Up[j*N_samp]=Vect_Dn[j];
//convolving F
for (j=0; j< N_sim; j++)
Vect_F[j]=0;
/*for (k=0; ((k<N_col) & ((j-k)>=0)); k++)
Vect_F[j]+=F[i][k]*Vect_Up[j-k];*/
+ k = 0;
+ int stat = 0;
+ int diff = j;
+ do {
+ float tmp = F[i][k]*Vect_Up[j-k];
+ k++;
+ diff--;
+ stat = (k<N_col) & (diff>=0);
+ Vect_F[j]+=tmp;
+ }while(stat);
}
//adding the results to the y matrix
for (j=0; j < N_sim; j++)
y[j]+=Vect_F[j];
#ifdef RAW
- raw_test_pass(raw_get_cycle());
+ //raw_test_pass(raw_get_cycle());
#endif
}
}