Changed dot product to vector product

master
ismagom 11 years ago
parent f356937046
commit 40238fe023

@ -43,9 +43,9 @@ void vec_sum_ccc(cf_t *z, cf_t *x, cf_t *y, int len);
void vec_sc_prod_cfc(cf_t *x, float h, cf_t *z, int len); void vec_sc_prod_cfc(cf_t *x, float h, cf_t *z, int len);
void vec_sc_prod_ccc(cf_t *x, cf_t h, cf_t *z, int len); void vec_sc_prod_ccc(cf_t *x, cf_t h, cf_t *z, int len);
/* dot product */ /* vector product */
void vec_dot_prod_ccc(cf_t *x, cf_t *y, cf_t *z, int len); void vec_prod_ccc(cf_t *x, cf_t *y, cf_t *z, int len);
void vec_dot_prod_ccc_unalign(cf_t *x, cf_t *y, cf_t *z, int len); void vec_prod_ccc_unalign(cf_t *x, cf_t *y, cf_t *z, int len);
/* conjugate */ /* conjugate */
void vec_conj_cc(cf_t *x, cf_t *y, int len); void vec_conj_cc(cf_t *x, cf_t *y, int len);

@ -24,7 +24,7 @@
cf_t corr_sz(cf_t *z, cf_t *s) { cf_t corr_sz(cf_t *z, cf_t *s) {
cf_t sum; cf_t sum;
cf_t zsprod[32]; cf_t zsprod[32];
vec_dot_prod_ccc(z, s, zsprod, N_SSS - 1); vec_prod_ccc(z, s, zsprod, N_SSS - 1);
sum = vec_acc_cc(zsprod, N_SSS - 1); sum = vec_acc_cc(zsprod, N_SSS - 1);
return sum; return sum;
@ -66,10 +66,10 @@ void sss_synch_m0m1(sss_synch_t *q, cf_t *input, int *m0, float *m0_value,
y[1][i] = input_fft[SSS_POS_SYMBOL + 2 * i + 1]; y[1][i] = input_fft[SSS_POS_SYMBOL + 2 * i + 1];
} }
vec_dot_prod_ccc(y[0], q->fc_tables.c[0], z, N_SSS); vec_prod_ccc(y[0], q->fc_tables.c[0], z, N_SSS);
memcpy(zdelay, &z[1], (N_SSS - 1) * sizeof(cf_t)); memcpy(zdelay, &z[1], (N_SSS - 1) * sizeof(cf_t));
vec_conj_cc(z, zconj, N_SSS - 1); vec_conj_cc(z, zconj, N_SSS - 1);
vec_dot_prod_ccc(zdelay, zconj, zprod, N_SSS - 1); vec_prod_ccc(zdelay, zconj, zprod, N_SSS - 1);
corr_all_zs(zprod, q->fc_tables.s, tmp); corr_all_zs(zprod, q->fc_tables.s, tmp);
vec_abs_cf(tmp, tmp_real, N_SSS); vec_abs_cf(tmp, tmp_real, N_SSS);
@ -78,11 +78,11 @@ void sss_synch_m0m1(sss_synch_t *q, cf_t *input, int *m0, float *m0_value,
*m0_value = tmp_real[*m0]; *m0_value = tmp_real[*m0];
} }
vec_dot_prod_ccc(y[1], q->fc_tables.c[1], tmp, N_SSS); vec_prod_ccc(y[1], q->fc_tables.c[1], tmp, N_SSS);
vec_dot_prod_ccc(tmp, q->fc_tables.z1[*m0], z, N_SSS); vec_prod_ccc(tmp, q->fc_tables.z1[*m0], z, N_SSS);
memcpy(zdelay, &z[1], (N_SSS - 1) * sizeof(cf_t)); memcpy(zdelay, &z[1], (N_SSS - 1) * sizeof(cf_t));
vec_conj_cc(z, zconj, N_SSS - 1); vec_conj_cc(z, zconj, N_SSS - 1);
vec_dot_prod_ccc(zdelay, zconj, zprod, N_SSS - 1); vec_prod_ccc(zdelay, zconj, zprod, N_SSS - 1);
corr_all_zs(zprod, q->fc_tables.s, tmp); corr_all_zs(zprod, q->fc_tables.s, tmp);
vec_abs_cf(tmp, tmp_real, N_SSS); vec_abs_cf(tmp, tmp_real, N_SSS);

@ -227,7 +227,7 @@ float pss_synch_cfo_compute(pss_synch_t* q, cf_t *pss_recv) {
cf_t y0, y1, yr; cf_t y0, y1, yr;
cf_t y[PSS_LEN_FREQ-1]; cf_t y[PSS_LEN_FREQ-1];
vec_dot_prod_ccc_unalign(q->pss_signal_freq, pss_recv, y, PSS_LEN_FREQ - 1); vec_prod_ccc_unalign(q->pss_signal_freq, pss_recv, y, PSS_LEN_FREQ - 1);
y0 = vec_acc_cc(y, (PSS_LEN_FREQ - 1)/2); y0 = vec_acc_cc(y, (PSS_LEN_FREQ - 1)/2);
y1 = vec_acc_cc(&y[(PSS_LEN_FREQ - 1)/2], (PSS_LEN_FREQ - 1)/2); y1 = vec_acc_cc(&y[(PSS_LEN_FREQ - 1)/2], (PSS_LEN_FREQ - 1)/2);

@ -66,7 +66,7 @@ int conv_fft_cc_run(conv_fft_cc_t *state, _Complex float *input, _Complex float
dft_run_c2c(&state->input_plan, input, state->input_fft); dft_run_c2c(&state->input_plan, input, state->input_fft);
dft_run_c2c(&state->filter_plan, filter, state->filter_fft); dft_run_c2c(&state->filter_plan, filter, state->filter_fft);
vec_dot_prod_ccc(state->input_fft,state->filter_fft,state->output_fft,state->output_len); vec_prod_ccc(state->input_fft,state->filter_fft,state->output_fft,state->output_len);
dft_run_c2c(&state->output_plan, state->output_fft, output); dft_run_c2c(&state->output_plan, state->output_fft, output);

@ -157,7 +157,7 @@ void vec_conj_cc(cf_t *x, cf_t *y, int len) {
#endif #endif
} }
void vec_dot_prod_ccc(cf_t *x,cf_t *y, cf_t *z, int len) { void vec_prod_ccc(cf_t *x,cf_t *y, cf_t *z, int len) {
#ifndef HAVE_VOLK #ifndef HAVE_VOLK
int i; int i;
for (i=0;i<len;i++) { for (i=0;i<len;i++) {
@ -179,7 +179,7 @@ float vec_avg_power_cf(cf_t *x, int len) {
return power / len; return power / len;
} }
void vec_dot_prod_ccc_unalign(cf_t *x,cf_t *y, cf_t *z, int len) { void vec_prod_ccc_unalign(cf_t *x,cf_t *y, cf_t *z, int len) {
#ifndef HAVE_VOLK #ifndef HAVE_VOLK
int i; int i;
for (i=0;i<len;i++) { for (i=0;i<len;i++) {

Loading…
Cancel
Save