/* * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The OpenAirInterface Software Alliance licenses this file to You under * the OAI Public License, Version 1.0 (the "License"); you may not use this file * except in compliance with the License. * You may obtain a copy of the License at * * http://www.openairinterface.org/?page_id=698 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *------------------------------------------------------------------------------- * For more information about the OpenAirInterface (OAI) Software Alliance: * contact@openairinterface.org */ //#define DEBUG_DAC #include #include #include "PHY/TOOLS/defs.h" void dac(double *s_re[2], double *s_im[2], uint32_t **input, uint32_t input_offset, uint32_t nb_tx_antennas, uint32_t length, double amp_dBm, uint8_t B, uint32_t meas_length, uint32_t meas_offset) { int i; int aa; double V=0.0,amp; for (i=0; i>1); i++) { for (aa=0; aa>16); else //assume (nb_tx_antennas==1) amp1 = ((AMP*ONE_OVER_SQRT2_Q15)>>15); amp1 = amp1*sqrt(512.0/300.0); //account for loss due to null carriers //printf("DL: amp1 %f dB (%d,%d), tx_power %f\n",20*log10(amp1),input_offset,input_offset_meas,txpwr_dBm); */ div=amp/amp1; for (i=0; i>2); i++) { for (aa=0; aa>16); else //assume (nb_tx_antennas==1) amp1 = ((AMP*ONE_OVER_SQRT2_Q15)>>15); amp1 = amp1*sqrt(512.0/300.0); //account for loss due to null carriers //printf("DL: amp1 %f dB (%d,%d), tx_power %f\n",20*log10(amp1),input_offset,input_offset_meas,txpwr_dBm); */ #ifdef DEBUG_DAC printf("DAC: input_offset %d, amp %e, amp1 %e\n",input_offset,amp,amp1); #endif k=input_offset; for (i=0; ilength*2-20&&i>16); else //assume (nb_tx_antennas==1) amp1 = ((AMP*ONE_OVER_SQRT2_Q15)>>15); amp1 = amp1*sqrt(512.0/300.0); //account for loss due to null carriers //printf("DL: amp1 %f dB (%d,%d), tx_power %f\n",20*log10(amp1),input_offset,input_offset_meas,txpwr_dBm); */ #ifdef DEBUG_DAC printf("DAC: input_offset %d, amp %e, amp1 %e\n",input_offset,amp,amp1); #endif k=input_offset; for (i=0; ilength*2-20&&i