コード例 #1
0
ファイル: interp.c プロジェクト: CodaCarlson/srsLTE
void srslte_interp_linear_offset(srslte_interp_lin_t *q, cf_t *input, cf_t *output, 
                          uint32_t off_st, uint32_t off_end) 
{
  uint32_t i, j;
  cf_t diff; 
  
  i=0;
  for (j=0;j<off_st;j++) {
    output[j] = input[i] + (j+1) * (input[i+1]-input[i]) / q->M;
  }
  srslte_vec_sub_ccc(&input[1], input, q->diff_vec, (q->vector_len-1));
  srslte_vec_sc_prod_cfc(q->diff_vec, (float) 1/q->M, q->diff_vec, q->vector_len-1);
  for (i=0;i<q->vector_len-1;i++) {
    for (j=0;j<q->M;j++) {
      output[i*q->M+j+off_st] = input[i];  
      q->diff_vec2[i*q->M+j] = q->diff_vec[i];
    }
    srslte_vec_prod_cfc(&q->diff_vec2[i*q->M],q->ramp,&q->diff_vec2[i*q->M],q->M);
  }
  srslte_vec_sum_ccc(&output[off_st], q->diff_vec2, &output[off_st], q->M*(q->vector_len-1));
  
  if (q->vector_len > 1) {
    diff = input[q->vector_len-1]-input[q->vector_len-2];
    for (j=0;j<off_end;j++) {
      output[i*q->M+j+off_st] = input[i] + j * diff / q->M;  
    }
  }
}
コード例 #2
0
ファイル: interp.c プロジェクト: CodaCarlson/srsLTE
void srslte_interp_linear_vector(srslte_interp_linsrslte_vec_t *q, cf_t *in0, cf_t *in1, cf_t *between, uint32_t M) 
{
  uint32_t i;
  
  srslte_vec_sub_ccc(in1, in0, q->diff_vec, q->vector_len);
  srslte_vec_sc_prod_cfc(q->diff_vec, (float) 1/M, q->diff_vec, q->vector_len);
  srslte_vec_sum_ccc(in0, q->diff_vec, between, q->vector_len);
  for (i=0;i<M-1;i++) {
    srslte_vec_sum_ccc(between, q->diff_vec, &between[q->vector_len], q->vector_len);
    between += q->vector_len;
  }
}
コード例 #3
0
ファイル: pss.c プロジェクト: srsLTE/srsLTE
/* input points to beginning of last OFDM symbol of slot 0 of subframe 0 or 5
 * It must be called after calling srslte_pss_cfo_compute() with filter enabled
 */
void srslte_pss_sic(srslte_pss_t *q, cf_t *input) {
  if (q->chest_on_filter) {

    bzero(q->tmp_fft, sizeof(cf_t)*q->fft_size);

    // Pass transmitted PSS sequence through the channel
    srslte_vec_prod_ccc(q->pss_signal_freq[q->N_id_2], q->tmp_ce, &q->tmp_fft[(q->fft_size-SRSLTE_PSS_LEN)/2], SRSLTE_PSS_LEN);

    // Get time-domain version of the received PSS
    srslte_dft_run_c(&q->idftp_input, q->tmp_fft, q->tmp_fft2);

    // Substract received PSS from this N_id_2 from the input signal
    srslte_vec_sc_prod_cfc(q->tmp_fft2, 1.0/q->fft_size, q->tmp_fft2, q->fft_size);
    srslte_vec_sub_ccc(input, q->tmp_fft2, input, q->fft_size);

  } else {
    ERROR("Error calling srslte_pss_sic(): need to enable channel estimation on filtering\n");
  }
}