scieee AI-readable full text Open interactive document viewer

Remote radio head for C-RAN

Beltran Obiol, Salvador

Abstract

The project's main objective is to develop a Remote Radio Head (RRH) to be used under the cloud radio access networks (C-RAN) concept. Actually, the wireless market tendency related with infrastructure implementation consist in separating the computing part of base station (BS) from the radiofrequency part. Therefore, digital signal processing is assumed in a datacenter and under the cloud computing concept. Signal samples are processed there and data streams are send to the RRH. The project consist in developing the appropriate software layer in the RRH to interface with the virtual machine (VM) allocated in the data center. Two different hardware has been considered to implement the RRH. In both, we followed a similar methodology, splitting the software layer in different functional modules and defining well defined implementation steps. During project development, we addressed several test in order to verify the proper management of the involved board and check the quality and performance of the signal generated or received.

Full text

MASTER THESIS TITLE: Remote Radio Head for C-RAN DEGREE: Master’s degree in Applied Telecommunications and Engineering Management (MASTEAM) AUTHOR: Salvador Beltr´ an Obiol ADVISOR: Antoni Gelonch Bosch DATE: 9 de juliol de 2018 Title : Remote Radio Head for C-RAN Author: Salvador Beltr´ an Obiol Advisor: Antoni Gelonch Bosch Date: July 9, 2018 Overview The project’s main objective is to develop a Remote Radio Head (RRH) to be used under the cloud radio access networks (C-RAN) concept. Actually, the wireless market tendency related with infrastructure implementation consist in separating the computing part of base station (BS) from the radiofrequency part. Therefore, digital signal processing is assumed in a datacenter and under the cloud computing concept. Signal samples are processed there and data streams are send to the RRH. The project consist in developing the appropriate software layer in the RRH to interface with the virtual machine (VM) allocated in the data center. Two different hardware has been considered to implement the RRH. In both, we followed a similar methodology, splitting the software layer in different functional modules and defining well defined implementation steps. During project development, we addressed several test in order to verify the proper management of the involved board and check the quality and performance of the signal generated or received. I would like to thank to all my friends and family for helping me to attempt to focus on this project. And specially to Mr.Blaco ,Teresa, Xavier Arteaga and Juan Lopez for helping me when i was stucked. And to Francisco Sanchez for the time lost helping and advising me on the drafting of this project. And at last but not least to my director Dr.Gelonch who in that months of working taught me lot’s of things and tried to help with my bad working habits. CONTENTS Introduction .................................... 1 CHAPTER 1. INTRODUCTION TO SOFTWARE DEFINED RADIO . . 3 1.1. Brief SDR history ................................ 3 1.2. Motivation of SDR ................................ 4 1.3. Actual trends of SDR .............................. 5 1.3.1. Ham trends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3.2. Professional trends . . . . . . . . . . . . . . . . . . . . . . . . . . 6 CHAPTER 2. Project Objective: Implementation of a RRS & RAU .11 2.1. RRS and RAU technical Specifications . . . . . . . . . . . . . . . . . . . . 11 2.2. Proposed RRS Hardware ............................ 12 2.2.1. ZedBoard based RRS . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.2. LimeSDR based RRS . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.2.3. Setup comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 CHAPTER 3. RSS Prototype validation and tests . . . . . . . . . . . 21 3.1. Objectives of this section ........................... 21 3.2. Methodology .................................. 21 3.3. FMComms 3-API Initial test . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.3.1. One tone test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.3.2. Two tone test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.3.3. BW test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.4. LimeSDR-API Initial test ............................ 26 3.4.1. One tone test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.4.2. BW test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 CHAPTER 4. RSS-RAU Communication ................. 29 4.1. Objectives of this section ........................... 29 4.1.1. Two tone test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.2. Methodology .................................. 31 4.3. Implementation ................................. 31 4.3.1. Tone test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.3.2. Two tone test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.3.3. Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Conclusions .................................... 35 Bibliography .................................... 37 APPENDIX A. ZedBoard board test code using Libiio . . . . . . . . . 41 APPENDIX B. Signal checker code in Python . . . . . . . . . . . . . . 51 LIST OF FIGURES 1.1 SDR concept idea. By Alba.boj [GFDL] or CC BY-SA 4.0 . . . . . . . . . . . . 5 1.2 Idealized Software Radio[2] ........................... 5 1.3 KX3 Transceiver [5]................................ 6 1.4 GNSS-SDR basic schema [10].......................... 7 1.5 C-RAN base station scheme [11] . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1 Basic interconnection schematic . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.2 ZedBoard caption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.3 AD-FMCOMMS3-EBZ caption . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.4 Caption of the LimeSDR v.1.4 . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.5 LimeSDR-USB Development Board Block Diagram [14] . . . . . . . . . . . . . 17 2.6 Odroid caption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.1 VNF general schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2 FMComms Filter Wizard caption . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.3 Zedboard setup with test code implementing one tone test . . . . . . . . . . . 24 3.4 Zedboard setup with test code 2 tone test . . . . . . . . . . . . . . . . . . . . 25 3.5 Zedboard setup with test code bandwidth test . . . . . . . . . . . . . . . . . . 26 3.6 LimeSDR setup with test code one tone test . . . . . . . . . . . . . . . . . . 27 3.7 LimeSDR setup with test code bandwidth test . . . . . . . . . . . . . . . . . . 28 4.1 VNF connections diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.2 VNF stats diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.3 Main code classified by his layer category . . . . . . . . . . . . . . . . . . . . 31 4.4 ZedBoard setup transmission attempt with the RRS Standalone code . . . . . 32 4.5 LimeSDR setup one tone test with the complete VNF . . . . . . . . . . . . . . 33 4.6 LimeSDR setup two tone test with the complete VNF . . . . . . . . . . . . . . 33 4 Remote Radio Head for C-RAN 802.11, ZigBee, Bluetooth, RFID, DECT, GSM, and even LTE can be downloaded from the repository and run on any x86 system. Vanu Inc. succeeded in getting their Anywave base station approved by the FCC in 2004. The Anywave is a dual-mode base station capable of running GSM and CDMA carriers simultaneously, with all protocols layers being executed on x86 CPUs. The same year Picochip (now Mindspeed Technologies) introduced a processor designed for PHY processing (commonly referred to as a base band processor). This was PC102 that was aimed for the 3G infrastructure market. It had 308 processing elements, 14 application-specific co-processors , and could handle the MAC layer as well as other protocol elements. This kind of processors helped to reduce the size, cost, and power consumption of wireless equipment. Texas Instruments and Xilinx joined forces on 2006 along with Nutaq (then Lyrtech) to create the first completely integrated, stand-alone SDR development platform. It was equipped with an ARM processor , a DSP, an FPGA, and a front-end tunable from 200 MHz to 1 GHz. The platform was no bigger than a shoe’s box and had the capability of being battery-powered, which opened up new possibilities for out-of-the-lab applications and experiments. Lime Microsystems unveiled its LMS6002 in 2009, a radio frequency integrated circuit (RFIC). The on a improved version named LMS6002D was at the market, being improved with the integrated data converters. The RFIC could tune anywhere between 400 MHz and 4 GHz, supported up to 28 MHz of bandwidth, and provided a selectable 16-position base band filter bank. Some years before Motorola also developed an RFIC (100 MHz to 2.5 GHz) but did not widely release it. Between 2010-2012 for the amateur radio operators or hams realized that some of the usb digital video broadcasting - terrestrial (DVB-T) receivers that were on the market where capable of decoding the in-phase and quadrature (I+Q) components of the Rf signals. So If they suppress the DVB-T demodulation blocks, the tuned signal was digitized and sent by the driver in RAW base band I+Q samples to the PC, where can be treated by software. This was the last SDR ”boom” and the one that opened the doors of this amazing world to the hams. Nowadays the tendency is common in most of the engineering and research areas: push for a high degree of system reconfiguration capabilities trying to obtain the maximum interoperability options lowering the cost, this can be easily seen if is compared the price of a whole new hardware with the installation of an update on the machine. What is one of the higher advantages of the SDR. 1.2. Motivation of SDR The SDR concept has evolved from the starting adaptive filtering to a whole modifiable system, the actual definition was written for first time on the Mitola paper [2] where was exposed in the following sentence: ”A software radio is a set of Digital Signal Processing (DSP). primitives, a meta-level system for combining the primitives into communications systems functions (transmitter, channel model, receiver ...) and a set of target processors on which the software radio is hosted for real-time communications.” The SDR happy idea is to reach a simple schema as shown on Fig.1.1 where is just needed CHAPTER 1. INTRODUCTION TO SOFTWARE DEFINED RADIO 5 Figure 1.1: SDR concept idea. By Alba.boj [GFDL] or CC BY-SA 4.0 a simple RF front end with an ADC and a DAC with an antenna, if we check the Fig.1.2 that is the Mitola SDR schematic we can see lot’s of similarities. The actual wireless systems tend to be SDR. This is due to the high reconfiguration options that it allows. This produce a better adaptation of the systems to the new RF standards. On the other hand the new standards tend to have a higher spectral efficiency what requires from the equipment higher computational resources. This dynamic makes the hardware manufacturers to keep improving the components. Figure 1.2: Idealized Software Radio[2] 1.3. Actual trends of SDR As explained on the introduction the RF world is tending incorporate the SDR concept. This can be seen from 2 different points of view, the professional use and the ham use. In this section the trends of the SDR technologies in both worlds are exposed. 1.3.1. Ham trends As was commented on the introduction to SDR section the hams get really interested on the SDR technologies round 2010, this create mainly 2 principal trends the possibility of having cheap multiband radio transceivers or increasing the capabilities of their radios. 6 Remote Radio Head for C-RAN 1.3.1.1. Cheap multiband radio transceivers. Hams started using, as explained, the dongles to receive RF communications, some of them saw there an interesting opportunity to build also a transmitter based on SDR, like the KX3 Transceiver. What allows them to get a radio with much more capabilities than standard radios and also some of them allow the software modification, what can increase the radio capabilities. Figure 1.3: KX3 Transceiver [5] Some of them are also Open Hardware what also permits a deeper reconfiguration or adaptation to other uses like [7]OVI40-SDR. 1.3.1.2. Increase the capabilities of their Radios. Another possibility that requires a minimum amount of investment are the software like [6] “Ham Radio Deluxe” or [4]”GNURadio” can help the Hams to improve their radio capabilities like allowing the digital demodulation of signals. The communication between the radio equipment and the software can be done then in different ways: The easy way is to use the radio output as the software input setting the radio speaker and the computer microphone in such configuration that allows the data transmission over the audible spectrum. This have several problems, the first one is the path noise that will introduce to the signal and also the limited BW, and the dependency of the equipment each speaker and microphone will have a different BW and sensibility at each frequency. Another option is to communicate the radio equipment with the computer using the audible spectrum over a direct wire, this is dangerous and may burn some equipment. As this programs has been appearing for several years the ham radios began to include some kind of standardized connection with the computer systems like USB-B or Ethernet. What is the most safe and loss less way to implement the connection. 1.3.2. Professional trends In the professional world the SDR has been there much more time and has allowed to evolve the communications in a different way. In this subsection is described the last SDR trends on the professional field. CHAPTER 1. INTRODUCTION TO SOFTWARE DEFINED RADIO 7 1.3.2.1. Command, Control, Communications, Computers, Intelligence, Surveillance and Reconnaissance (C4ISR) SDR on the C4ISR market has a interesting paper simplifying the equipment and improving interoperability [8]. SDR was for the military systems a great opportunity to improve, due the flexibility modularity and portability that is difficult to achieve on military environments. When trying to carry multiple equipment and configure for different applications on the battlefield. [9] With SDR multiple equipment can be integrated in a single device, what is better is the “easy” reconfiguration of the equipment and the possibility of use simultaneous signals decoders by software with the same device without loosing the security that military communications need. Also the SDR equipment is nowadays the most cost-effective solution in most of the RF fields, and the C4ISR case is not an exception. 1.3.2.2. SATellite COMmunication (SATCOM) As it can be seen from all the sections the reconfiguration and easy integration capabilities of the SDR technologies helped lot’s of fields to improve their equipment or technologies. In the case of SATCOM enabled the possibility of getting the transmission from most of the satellites whose encoding methods are publics, and therefore get lot of interesting information. Starting from the meteorologic reports and passing to Satellite TV decoding to GPS signals, specially the Global Navigation Satellite System (GNSS) . CTTC has developed a Figure 1.4: GNSS-SDR basic schema [10] SDR open hardware receiver and the full code to receive and process the data of this set of positioning system networks. 8 Remote Radio Head for C-RAN 1.3.2.3. Cognitive Radio An interesting field of research inside the SDR possibilities is the cognitive radio (CR). CR concept is based on the idea of spectral efficiency, which objective is, as the name says, to take the major profit of the spectrum. CR purposes an intelligent radio unit that automatically detects available channels on the wireless spectrum, and taking into account the actual communication requirements transmit the signal in one or other frequency. An interesting application for CR is the spectrum sharing , for instance, between two enterprises one of them rent the spectrum and can sub-rent his band of spectrum to another company that transmits when the first company is not using his band. If this second enterprise sub-rent some different bands, it can ensure a minimum percentage of time to transmit the whole time. The unique inconvenient in that case is that transmitter and receiver must agree a frequency change once they detect a primary user transmission. 1.3.2.4. New Generation fronthaul Interface (NGFI) Radio access network (RAN) should evolve to match with 5G patterns, one of the essential elements for this evolution is the Cloud RAN (C-RAN) concept, it has demonstrated [11] it’s advantages on network deployment speed-up, cost saving and power efficiency. The C-RAN concept[21] expects to decrease the costs in CAPEX and OPEX of the networks, as well as improve the radio resources management. This concept is based on the framework of Network Function Virtualization (NVF), this NVF concept consist on replacing hardware for a specific function with open software applications running on shared servers in cloud platforms. The main idea is to have VNFs deployed on virtual machines inside a virtual infrastructure, which can be centered in a single location or distributed in several locations. This can seem a simple question of space or price but the fact is that this C-RAN concept aims to implement the whole base-band radio signal processing in software, what means that for a later sending we are going to have some bandwidth limitations, and the most important detail, the transmission time or latency. This issues can be a hassle for real time communications. With C-RAN the concept of base station (BS) is evolving from the two logical entities in 4G LTE, baseband unit(BBU) and remote radio unit(RRU), to a centralized BBU pool and a set of RRU that are controlled from the same BBU as seen in Fig.1.5. [12] Some of the usual functions are shifted between RRU and BBU, what , for a better understanding leads to a renaming of the parts, BBU is renamed as Radio Cloud Center (RCC) and the RRU as Radio Remote System (RRS), the RRS coverage can be equivalent to a macro cell, and implements the Radio Aggregation Unit (RAU), that was formerly part of the BBS. CHAPTER 1. INTRODUCTION TO SOFTWARE DEFINED RADIO 9 Figure 1.5: C-RAN base station scheme [11] 1.3.2.5. Radio Aggregation Unit (RAU) The main concept relies on the RAU should be connected using a fast interface with the RRS. For this reason only I and Q samples could be transmitted to the RRS, this schema has some advantages like the easy handover control from the same point what should improve the performance in several ways as speed. This RAU will have the control of several RRS and also communication with the RCC. [11] With this purpose a project under the encoding 1914.3 is defining the Ethernet encapsulation format for radio signal. 1.3.2.6. Remote Radio System(RRS) The RRS is an evolution of the RRU that is also named remote radio head (RRH), and the main role of it is to transmit the signal from the BS location. In NGFI this signals are processed, as explained, from the RAU and sent as baseband IQ signals to the RRS that must process it with the right parameters and transmit the signal as also get the upstreaming communications and send them to the appropriate system as base band signals. CHAPTER 2. PROJECT OBJECTIVE: IMPLEMENTATION OF A RRS & RAU In this chapter the objective of the project is exposed and the used hardware is explained. In order to give to the reader a big picture of the project. From the hardware and software limitations appears the need of taking a realistic look on the possibilities of the system. This are discussed on the next section. 2.1. RRS and RAU technical Specifications The hardware can introduce some limitations on the system like maximum and minimum bandwidth, local oscillator frequency among others. Figure 2.1: Basic interconnection schematic The system is thought to support 4G signals on top what means that it’s band width (BW must be between 1.4 to 20 MHz. If we do the calculus of the bit rate, assuming a 16 bits per sample and taking into account the I and Q channels, and considering the different sampling frequencies we can compute the different transmission bit rates required between the datacenter and the RRH. These are shown in table 2.1. Signal BW Sample rate Bit rate Bits through Ethernet 1.4 MHz 1.92 Msps 123 Mbps 126Mbps 3 MHz 3.84 Msps 245Mbps 253Mbps 5 MHz 7.68Msps 492 Mbps 506 Mbps 10 MHz 15.36 Msps 983 Mbps 1011 Mbps 15 MHz 23.04 Msps 1475 Mbps 1518 Mbps 20 MHz 30.72Msps 1966Mbps 2024 Mbps Table 2.1: BW vs bitrate vs Ethernet bitrate comparison This calculations came from a prestablished number of sent samples. If a sample is encoded, as assumed with 16 bits with I and Q components then the sample size is 32 bits. With that knowledge is easy to calculate how many samples can be sent in a single Ethernet packet. This has been calculated using a standard maximum transmission unit (MTU) of the IPV4 protocol that are 1500 bytes,[13]. 11 12 Remote Radio Head for C-RAN Departing from there is needed to subtract from this size the IPv4 header (20 bytes), and to maintain real time we need to use UDP protocol instead of TCP due the high delay that TCP introduce on communications, what needs other 8 bytes of the header what allows a maximum allocation of 368 samples in a single packet, this will be named in the code as block size. The bit rate that we presented on the table 2.1 is just assuming that there must be 2 different data fluxes. One for transmission and the other for reception. But when we look at the Ethernet bit rate we can see that this number is increased. This is due the headers that must be sent. As was exposed the standard MTU for IPv4 is 1500 bytes, but an additional header is included on the transmission. This is the Ethernet header containing the physical layer addresses of sender and receiver of this Ethernet packets. This header has (14 bytes), so the second bit rate(”Bits through Ethernet” column in table 2.1) is calculated taking into account this additional bits being transmitted trough the wire. 2.2. Proposed RRS Hardware The RRS is composed from 2 components: The first one, the remote computing side, whose mission is to implement an Ethernet interface to the cloud computing. The second component is the radio one, the HW device that outputs the samples at the right frequency band. To implement this RRS we have used 2 different setups with different HW, the first one using a ZedBoard with an ad9361 transceiver. The second setup was done using LimeSDR following the work done in the final degree project named Remote Radio Head using LimeSDR and ODROID-XU4[24]. To have a general knowledge of in which position is this hardware on the SDR market and why we have selected it, a simple comparison table was done(table2.2). Parameter HackRF One Ettus B200 Ettus B210 BladeRF x40 RTL-SDR Frequency Range 1MHz-6GHz 70MHz-6GHz 70MHz-6GHz 300MHz-3.8GHz 22MHz-2.2GHz RF Bandwidth 20MHz 61.44MHz 61.44MHz 40MHz 3.2MHz Sample Depth 8 bits 12 bits 12 bits 12 bits 8 bits Sample Rate 20MSPS 61.44MSPS 61.44MSPS 40MSPS 3.2MSPS Transmitter Channels 1 1 2 1 0 Receivers 1 1 2 1 1 Duplex Half Full Full Full N/A Interface USB 2.0 USB 3.0 USB 3.0 USB 3.0 USB 2.0 Programmable Logic Gates 64 macrocell CPLD 75k 100k 40k (115k avail) N/A Chipset MAX5864, MAX2837, RFFC5072 AD9364 AD9361 LMS6002M RTL2832U Open Source Full Schematic, Firmware Schematic, Firmware Schematic, Firmware No Oscillator Precision +/-20ppm +/-2ppm +/-2ppm +/-1ppm ? Transmit Power -10dBm+ (15dBm @ 2.4GHz) 10dBm+ 10dBm+ 6dBm N/A Price $299 $686 $1,119 $650 $10 Table 2.2: SDR market comparison [14]. As we can see the most of boards can reach from a few MHz up to 6GHz or at least a few GHz frequency, with a wide BW at least of 3.2 MHz. In addition most of these acquisition boards includes an FPGA what facilitates its configuration and extend its usability to a wide range of applications. Looking at what is on the market we choose the 2 explained setups.They are interesting for CHAPTER 2. PROJECT OBJECTIVE: IMPLEMENTATION OF A RRS & RAU 13 different reasons. The ZedBoard setup uses an ad9361, which is a hexadecimal value of a kind of brown color but also a high performance, highly integrated RF Agile Transceiver of Analog Instruments that was specifically designed for his use on 3G or 4G base station applications. The problem of this transceiver is that it’s evaluation board costs round 750 USD, which can be quite expensive if we take into account that any RF system may be composed by other several elements. In fact this is the transceiver IC that uses the Ettus B210. For the other setup the challenge was to find another transceiver that could perform as good as the ad9361 but for a quite lower price, with that objective the LimeSDR board was chosen. It has a transceiver IC named LMS7002M this is the second-generation lime microsystems field programmable IC transceiver, and was improved to cover a wider range of frequencies and thought specifically for 2G, 3G ,4G and WiFi implementations, but a great feature of LimeSDR is that the whole board just costs 299 USD, what is less than the half of the ad9361 development board reaching same bandwidth and up to 3.6 GHz LO frequency, what makes the LimeSDR a quite competitive board. 2.2.1. ZedBoard based RRS This setup is composed in the RRS side for a Zedboard and a FMComms3 board. 2.2.1.1. ZedBoard This is the first element of the setup which actuates as remote processor for the remote radio, is the equivalent to the odroid on the other setup. The ZedBoard[19] is a development board based on Xilinx Zynq R -7000 and has a set of FMC (LPC) connectors that allow the communication with the FMcomms 3 board, that is the development board for the ad9361. Figure 2.2: ZedBoard caption ZedBoard detailed description CHAPTER 3. RSS PROTOTYPE VALIDATION AND TESTS This section presents the implementation. Giving a quick overview to the methodologies used and the processes followed to develop the basic first board codes. 3.1. Objectives of this section This section presents the initial steps for the RRH implementation, as well as the methodology and tests used to check the proper functionality of the setup. Also it is interesting to denote that the Zedboard setup is the most extensively explained. As already explained in previous sections, LimeSDR setup was continued from another project and therefore only a quick overview for the LimeSDR setup is exposed. The VNF is an interface of communications between the RAU and the RSS. This is connected using gigabit Ethernet and the connection between the remote computation and the RF board (inside RSS) is as explained, two different connections, one for each setup. Due the setup requirements: on the Zedboard setup the connection is done via FMC connector and on the LimeSDR setup is done using USB3.1. This VNF is split in 2 different codes: the cloud code (RAU) and the RSS code. It is important to have this 2 different codes even if during the test both are run on the same board because their functions are completely different. The code placed on the RAU is the responsible of generating and processing data while the code placed on the RRS is the one that is connected to the RF board. The latter is also the responsible to transmit and receive data on RF and send it to the other side as a base band signals. 3.2. Methodology We organized project development description into several sections. They describe the development phases. The project has been divided in three main steps: 1. API test program In this step the idea is to get familiar with the board API and have a basic knowledge of the board capabilities. 2. Standalone VNF In this step the objective is to generate the Remote interface of the remote radio head and the functions to transmit the data.It needs to be tested using the Standalone version of the VNF. That requires to generate the signal samples. 3. Connect to RAU At this point the remote functions must be done and connected with the RSS. After that the full VNF must be implemented and therefore the final tests carried out. The code was designed to be as modular as possible, in order to apply possible modifications, improvements or integrations as simple as possible. For that reason the design was 21 22 Remote Radio Head for C-RAN thought using separate independent code blocks as shown in the figure 3.1. Figure 3.1: VNF general schema As shown in figure 3.1 the general VNF schema is composed by several blocks (small rectangles painted in yellow) and also by planes (bigger rectangles painted in different colors).The blocks are somehow equivalent to functions while the planes are logic separation layers. It is important to separate the data plane from the control plane. This is because both must send useful data and motorization of the transmission at same time. Then being separated as different layers, we can make calls to both entities from different threads if necessary. The happy idea of this schema is to have each layer as an independent thread. This is a general schema, meaning some of the planes or functions are from the RRS side and others on the RAU side. 3.3. FMComms 3-API Initial test To create the first test code for the Zedboard setup we used the libiio[20] library. ”Libiio has been developed and is released under the terms of the GNU Lesser General Public License, version 2. This open-source license allows anyone to use the library for proprietary or open-source, commercial or non-commercial applications. This choice was motivated by the fact that Analog Devices is a company that principally sells hardware. This library provides the clients with a better and easier way of using this hardware.” For that first iteration, the objective is to use the board to transmit and receive RF signals. That requires to properly setup the board configuration parameters, like BW or LO frequency, to perform RF operations according our specifications. CHAPTER 3. RSS PROTOTYPE VALIDATION AND TESTS 23 The code implemented to fulfill this objective can be found on the appendix A. The most relevant is to know the initialization order of the different parameters, that is quite important for the correct operation of the transceiver. We can identify several functionalities and therefore implementation stages of the code. First of all, we need to find the device, then the TX and RX paths and finally the TX and RX channels. Once the devices are created and in order to store data, we define the buffers that are linked to TX and RX. In the moment of creating the TX and RX channels we must also configure their parameters: bandwidth, sampling frequency and the local oscillator frequency. As explained before, the board has also the capability of defining a FIR filter as well as path gain for RX or TX. Also interpolation and decimation options, that are not easy to get to, are defined. Analog Instruments released a Matlab program[23] that allows an easier configuration of the filters by configuring the parameters on the program. This generates the TX and RX configuration files. Figure 3.2: FMComms Filter Wizard caption The code has been organized around functional blocks. Each functional block has been checked in standalone mode. First we have checked the signal generator by saving the generated samples into a binary file that we plotted using a python code (Annex B) In order to transmit or receive, it is important to take into account the data format that the AD9361 expects. AD9361 expected binary format each I or Q word with the 12-bit signed format, but on the code the most similar format is a int 16. As the AD9361 bus-width is 12- bit, same bits as the ADC capability. Therefore Bit number 11 becomes Bit number 15. So they must be shifted by 4 and the lower 4 bits are ignored to get the expected 12 bit format. BufferBit1514131211109876543210 AD9361Bit11109876543210XXXX The signal generator creates a sine table that constantly is being pushed to the TX buffer, to push the data according to the AD9361 documentation we used the following code: 24 Remote Radio Head for C-RAN ( ( i n t 1 6 t ∗) p dat ) [ 0 ] = ( ( i n t 1 6 t ) ( ( t x b u f f e r [ i ] >> 16)&0xFFFF ) ) ; / / Real ( I ) ( ( i n t 1 6 t ∗) p dat ) [ 1 ] = ( i n t 1 6 t ) ( ( t x b u f f e r [ i ])&0xFFFF ) ; / / Imag (Q) As can be seen, we stored a 32 bit integer inside the table. As we need int16 samples, we apply a mask to avoid the I and Q samples to affect the other component. Applying ”0xFFFF” mask we get just the first 16 bits suppressing the last 16 bits. For that reason when getting the inphase samples first we shift the 16 bits to avoid getting the last 16, and then apply the mask. Each code piece developed has been tested by analyzing its radiofrequency behavior. The development of the code has been done connecting the board to the oscilloscope and the spectrum analyzer by a SMA to SMA cable and a T splitter. That allowed to take time and frequency measurements at same time. But once the TX code has been tested the wire has been changed for an antenna that receives the signal and sends it to the devices. We used the signal generated by the transmitter as input for the receiver part while developing and testing the required receiver code. We developed several tests in order to analyze the transmitter and receiver performance and the impact of specific implementations of the transmitter and receiver signal processing. 3.3.1. One tone test The tone test basically consists in generate a tone and transmit at a specific frequency to check deviation of the signal and spurious check. Figure 3.3: Zedboard setup with test code implementing one tone test This is a interesting caption(fig.3.3) because it shows 2 interesting things. First is that we find out that there are harmonics, and the second is that outside the TX BW there is no signal. The figure has been taken from a sine generated at 300 KHz with a LO at 2.16 GHz and BW 3MHz. So the signal and harmonics can be seen only from 2158.5 MHz to 2161.5 MHz, as the signal frequency is 0.3 MHz higher than the LO frequency.Te lower frequency band has more harmonic frequencies than on the upper side. We measured the power of the sine (-59 dBm) and the power of the nearest harmonic (-85 CHAPTER 3. RSS PROTOTYPE VALIDATION AND TESTS 25 dBm), what means that the original signal is 24 dB stronger than the harmonic and round 40 dB higher than the noise. Also was checked the periodicity of the harmonic signals that was, as expected round 300 KHz. All the measures have been taken with a RX antenna distance of round 40 cm from the transmitter. We also tested the FMComms3 devices using both a gain of -6 dB and 0dB. These are the two possible gains for the TX side. 3.3.2. Two tone test The two tone test is useful to measure the third order interception point (IP3), that is an indicator for nonlinear systems and devices. The test is based on the concept of nonlinearity modeling using a low order polynomial, derived from a Taylor series expansion. The interception point can be easily seen looking at the input vs output power of the system in a logarithmic scale. This produces a straight line with slope 1. But for the third-order nonlinear product, the output rises 3 dB at output for each dB increase at the input. This can be measured by checking the spectrum generated with 2 tones at the input knowing that the third order inter modulation product appears at a certain combination of tone’s frequencies. Being the two tones frequencies ωaand ωb ω(IP3) = 2ωa−ωb(3.1) and because of symmetry this component also appears at 2ωb−ωa Therefore we can know the difference between signal power and IP3 power by measuring the difference of power between their signals. Getting ∆P=Pout −Pout3 Figure 3.4: Zedboard setup with test code 2 tone test From the caption 3.4 we can see that thee are spurious frequencies at the expected frequencies, knowing that two sine signals where transmitted at 2160.27 MHz and 2160.0 MHz.Giving a 3rd intermodulation point spurious at: ω(IP3) = 2∆2160.27 −2160.0=2160.54MHz (3.2) 26 Remote Radio Head for C-RAN With a difference of power of ∆P= (−59 −(−85)) = 26dBm Since this test is still using the ZedBoard the gain was not modified. 3.3.3. BW test This is the last test that has been performed. The idea of this test is to check if the bandwidth set on the configuration is being transmitted. For this test a noise signal is generated and transmitted which results in an spectrum occupancy, showing a relevant power level, defined by the RF bandwidth selected by the configuration parameter. Figure 3.5: Zedboard setup with test code bandwidth test On the caption 3.5 we can see that the BW is as expected 3MHz and centered at 2.16 GHz but some continuous signal has been introduced also on the TX. Notice that the carrier signal appears. To know the maximum achieved BW was tested to increase the BW and reached up to 7 MHz without problems on TX ,after that frequency the signal was lost and only the carrier was appearing. Probably due the time that took the sampler to TX the signal was smaller than the time that took to the processor to generate the signal samples. 3.4. LimeSDR-API Initial test As said before the LimeSDR setup comes from another project [24], and therefore no tests where done at this section, the test came from the other project , and simply are useful in order to compare both setups. About the LimeSDR is interesting to know that the device must be found on first instance to get the reference and then there are 2 ways to load the configuration to the board. The first one is loading a configuration file: LMS LoadConfig ( device , ” / path / to / f i l e . i n i ” ) The second one is doing it manually initiating a certain TX or RX channels and setting the frequencies using the corresponding commands. CHAPTER 3. RSS PROTOTYPE VALIDATION AND TESTS 27 In this case, as the configuration is expected to be dynamically changing, depending on what the actual application requires. The best option is to configure the parameters manually. In order to bring the option of having a modification during the program execution avoiding a forced restart of the program. On the case of the LimeSDR the parameters are mostly the same bandwidth, sample rate, local oscillator frequency, but in the LimeSDR the interpolation/decimation as also the gain can be easily set, just exactly as the rest of the elements. Another important option is the auto-calibration. LimeSDR board during start up it is capable to perform an auto-calibration process, to check the proper working of the ports. We carried out similar tests to the Zedboard ones. The results are exposed on the following pages. 3.4.1. One tone test On the LimeSDR the tests where done by J.Cerezo and included inside [24], this tests where done with a direct connected SMA to SMA cable, with a LO frequency of 1 GHz and a BW of 2MHz. Figure 3.6: LimeSDR setup with test code one tone test As it can be seen there is a clear sine signal, the signal has no harmonics until the gain gets to the 95% of the maximum TX gain of the LimeSDR. As the tests where done by cable connection the capture is much more clear than the ones that where done with the Zedboard setup. Also we have to take into account that this was not taken by a spectrum analyzer it was taken with an oscilloscope with fast Fourier transform (FFT) capability, what can produce a less exact results. 28 Remote Radio Head for C-RAN 3.4.2. BW test The bandwidth test was done at the same LO frequency but using the LimeSDR maximum bandwidth to transmit. Figure 3.7: LimeSDR setup with test code bandwidth test As can be seen from the figure it can be seen that there is a quite clear signal with a SNR of almost 30 dB. CHAPTER 4. RSS-RAU COMMUNICATION After a basic implementation was done on the board the idea was to define a communication schema that could be valid for almost all the boards. This was thought trying to minimize the sent parameters and taking into account that the base band samples must be processed on the cloud (RAU) and then sent to the RSS. For this reason the figure 4.1 was followed, separating in two different paths the control Figure 4.1: VNF connections diagram messages and the data messages. 4.1. Objectives of this section The 4.2 shows the states where the VNF can be. Three states where defined to keep a simple program logic. Figure 4.2: VNF stats diagram 4.1.1. Two tone test This three states are quite simple to understand, the INIT state, is done for configuring the board, when the RSS is in INIT state is waiting for a configuration message, which contains the following parameters: mname STAT: State where the VNF must be on. RRH opMODE: Tells if must working on stand alone mode or in connected to RAU mode. 29 36 Remote Radio Head for C-RAN BIBLIOGRAPHY [1] INNOVATIONS: Nutaq. A short history of software-defined radio (SDR) technology. [online] Available at: https://www.nutaq.com/blog/short-history-software-defined- radio-sdrtechnology.[Accessed 2 May 2018]. [2] Mitola, J. : ”Software radios-survey, critical evaluation and future directions”. Telesystems Conference.(NTC-92.),(1992) ix,3,4,5 [3] Primidi. Software defined radio history. [online] Available at: https://www.primidi.com/software-defined-radio/history. [Accessed 5 May 2018]. [4] Radio, G. N. U. ”The gnu software radio.” [online] Available at: https://gnuradio. org [Accessed 5 May 2018]. 3,6 [5] Elecraft Inc:KX3 Transceiver specifications.[online] Available at: http://www.elecraft.com/KX3/kx3.htm[Accessed 5 May 2018]. ix,6 [6] HRD Software, LLC: Ham radio deluxe.[online] Available at: http://ham-radio-deluxe.com/ [Accessed 7 May 2018]. 6 [7] Elektronikreparaturen aller:SDR-Transceiver ”OVI40” [online] Available at: https://www.electronicrepair.de/ovi40-order-page [Accessed 7 May 2018]. 6 [8] Stephanie Chiao:The impact of software-defined radio on C4ISR. [online] Available at: https://www.c4isrnet.com/opinion/the-compass/2016/06/03/the-impact-of -software-defined-radio-on-c4isr/ [Accessed 15 May 2018]. 7 [9] Michael Peck:’Game changer’: Army wants an unmanned electronic warfare vehicle. [online] Available at: https://www.c4isrnet.com/unmanned/robotics/2017/05/23/game-changer-army -wants-an-unmanned-electronic-warfare-vehicle/ [Accessed 15 May 2018]. 7 [10] GNSS-SDR, CTTC,[online] Available at: https://gnss-sdr.org/ [Accessed 15 May 2018]. ix,7 [11] Chih-Lin, I., Li, H., Korhonen, J., Huang, J., and Han, L. “RAN Revolution with NGFI (xHaul) for 5G”. Journal of Lightwave Technology.36(2), 541–550. (2018) ix,8,9 [12] Charlie Ashton, Wind River, Ltd.: ”Will New CRAN Architecture be the Trigger for Widespread Deployments?” [online] Available at: http://blogs.windriver.com/wind river blog/2016/02/will-new -cran-architecture-be-the-trigger-for-widespread-deployments.html [Accessed 20 May 2018]. 8 [13] Information Sciences Institute and University of Southern California : Internet Protocol, Darpa internet program. [online] Available at: tools.ietf.org/html/rfc791#page-11 [Accessed 21 May 2018]. 11 37 [14] Lime Microsystems Ltd: Lime SDR official webpage. [online] Available at: https://myriadrf.org/projects/limesdr/ [Accessed 10 Jun 2018]. ix,xi,12, 15,17 [15] Lime Microsystems Ltd: Lime SDR official API documentation webpage. [online] Available at: http://docs.myriadrf.org/LMS API/index.html [Accessed 10 Jun 2018]. 15 [16] ODROID, INC : Odroid main webpage.[online] Available at: odroidinc.com/collections/odroid-single-board-computers/products/odroid-xu4 [Accessed 15 Jun 2018]. 17 [17] Devlin, Malachy, VITA Technologies : ”VITA 57 (FMC) opens the I/O pipe to FPGAs”. [online] Available at: http://vita.mil-embedded.com/articles/vita-fmc-opens-io-pipe-fpgas/ [Accessed 17 Jun 2018]. 14 [18] Analog Devices, Inc: AD-FMCOMMS3-EBZ product main page [online] Available at: http://www.analog.com/en/design-center/evaluation-hardware-and-software/ evaluation-boards-kits/EVAL-AD-FMCOMMS3-EBZ.html#eb-overview [Accessed 20 Jun 2018]. 14 [19] Avnet, Inc: ZedBoard product main page [online] Available at: zedboard.org/product/zedboard [Accessed 30 Jun 2018]. 13 [20] Avnet, Inc: libiio documentation main page [online] Available at: http://analogdevicesinc.github.io/libiio/ [Accessed 20 Jun 2018]. 22 [21] Rodriguez, Veronica Quintuna and Guillemin, Fabrice: ”Cloud-RAN modeling based on parallel processing” IEEE Journal on Selected Areas in Communications.36(3), 457–468. (2018) 8 [22] Saunders, Brad; Nardozza, Liz (25 July 2017). ”USB 3.0 Promoter Group Announces USB 3.2 Update”. USB.org. USB 3.0 Promoter Group. Retrieved 27 July 2017. 17 [23] Analog Devices Inc. FMComms filter Wizard for Matlab main page. [online] Available at: https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms2-ebz /software/filters [Accessed 10 Jun 2018]. 23 [24] Jordi Cerezo: Remote Radio Head using LimeSDR and ODROID-XU4. 12,26,27 APPENDICES APPENDIX A. ZEDBOARD BOARD TEST CODE USING LIBIIO 1/∗ 2∗AD9361−FMCOMMS 3 wi th ZedBoard t e s t i n g example 3∗ 4∗This l i b r a r y is free software ; you can r e d i s t r i b u t e i t and / or 5∗modify i t under the terms of the GNU Lesser General Public 6∗License as published by the Free Software Foundation ; e i t h e r 7∗version 2.1 of the License , or ( at your option ) any l a t e r version . 8∗ 9∗This l i b r a r y i s d i s t r i b u t e d in the hope t ha t i t w i l l be useful , 10 ∗but WITHOUT ANY WARRANTY; without even the implied warranty of 11 ∗MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 ∗Lesser General Public License f o r more d e t a i l s . 13 ∗ 14 ∗∗/ 15 #include <s t d l i b . h> 16 #include <stdbool .h> 17 #include <s t d i n t . h> 18 #include <string .h> 19 #include <si gnal . h> 20 #include <stdio .h> 21 #include <math . h> 22 #include <complex . h> 23 #ifdef APPLE 24 #include <i i o / i i o . h> 25 #else 26 #include <i i o . h> 27 # en di f 28 //#include </home / analog / Desktop / l i b i i o / i i o −private .h> 29 30 /∗helper macros ∗/ 31 #define KHZ( x ) ( ( long long) ( x∗1000.0 + . 5 ) ) 32 #define MHZ( x ) ( ( long long) ( x∗1000000.0 + . 5 ) ) 33 #define GHZ( x ) ( ( long long) ( x∗1000000000.0 + . 5 ) ) 34 #define M PI 3.14159265358979323846 35 #define ASSERT( expr ) { \ 36 i f ( ! ( expr ) ) { \ 37 ( void) f p r i n t f ( stder r , ” a ssert ion f a i l e d (%s:%d )\n ” , FILE , LINE ) ; \ 38 ( void) abort ( ) ; \ 39 } \ 40 } 41 42 /∗RX i s input , TX i s output ∗/ 43 enum iodev {RX, TX }; 44 45 /∗common RX and TX streaming params ∗/ 46 struct stream cfg { 47 long long bw hz ; / / Analog banwidth in Hz 48 long long f s hz ; / / Baseband sample r ate in Hz 49 long long l o hz ; / / Local o s c i l l a t o r frequency i n Hz 50 const char∗rfport ; / / Port name 51 }; 52 41 53 /∗s t a t i c scratch mem f o r s t r i n g s ∗/ 54 s t a t i c char tmpstr [ 6 4 ] ; 55 56 /∗IIO s t r u c t s require d f o r streaming ∗/ 57 s t a t i c s t r u c t iio context ∗ctx = NULL; 58 s t a t i c s t r u c t iio channel ∗r x 0 i = NULL; 59 s t a t i c s t r u c t iio channel ∗rx0 q = NULL; 60 s t a t i c s t r u c t iio channel ∗t x 0 i = NULL; 61 s t a t i c s t r u c t iio channel ∗tx0 q = NULL; 62 s t a t i c s t r u c t i i o b u f f e r ∗rxbuf = NULL; 63 s t a t i c s t r u c t i i o b u f f e r ∗tx buf = NULL; 64 65 static bool stop ; 66 67 /∗cleanup and e x i t ∗/ 68 s t a t i c void shutdown () 69 { 70 p r i n t f ( ”∗Destroying buffers\n ” ) ; 71 i f ( rxbuf ) {i i o b u f f e r d e s t r o y ( rxbuf ) ; } 72 i f ( tx bu f ) {i i o b u f f e r d e s t r o y ( txbu f ) ; } 73 74 p r i n t f ( ”∗Disabling streaming channels\n ” ) ; 75 i f ( r x 0 i ) {i i o c h a n n e l d i s a b l e ( r x 0 i ) ; } 76 i f ( rx0 q ) {i i o c h a n n e l d i s a b l e ( r x0 q ) ; } 77 i f ( t x 0 i ) {i i o c h a n n e l d i s a b l e ( t x 0 i ) ; } 78 i f ( tx0 q ) {i i o c h a n n e l d i s a b l e ( t x0 q ) ; } 79 80 p r i n t f ( ”∗Destroying context\n ” ) ; 81 i f ( ctx ) {iio context destroy(ctx); } 82 e x i t (0 ) ; 83 } 84 85 s t a t i c void handle sig ( int sig ) 86 { 87 p r i n t f ( ” Waiting f o r process to f i n i s h . . . \n ” ) ; 88 stop = t ru e ; 89 } 90 91 /∗check r et urn value of a t t r w r i t e fu n ct i on ∗/ 92 s t a t i c void errchk ( int v , const char∗what ) { 93 i f ( v <0) {f p r i n t f ( stderr , ” Er ro r %d w r i t i n g to channel \”%s \”\nvalue may not be supported .\n ” , v , what ) ; shutdown ( ) ; } 94 } 95 96 /∗writ e a t t r i b u t e : long long i n t ∗/ 97 s t a t i c void w r c h l l i ( struct iio channel ∗chn , const char∗what , long long v al ) 98 { 99 errchk ( i i o c h a n n e l a t t r w r i t e l o n g l o n g ( chn , what , val ) , what ) ; 100 } 101 102 /∗read a t t r i b u t e : long long i n t ∗/ 103 s t a t i c void r d c h l l i ( struct iio channel ∗chn , const char∗what , long long ∗val ) 104 { 105 errchk ( i i o c h a n n e l a t t r r e a d l o n g l o n g ( chn , what , val ) , what ) ; 106 107 } 108 109 /∗w ri te a t t r i b u t e : s t r i n g ∗/ 110 s t a t i c void w r c h s tr ( struct iio channel ∗chn , const char∗what , const char∗ s t r ) 111 { 112 errchk ( i i o c h a n n e l a t t r w r i t e ( chn , what , s t r ) , what ) ; 113 } 114 115 /∗helper fu n ct i on generating channel names ∗/ 116 s t a t i c char∗get ch name ( const char∗type , int id ) 117 { 118 s n p r i n t f ( tmpstr , sizeof ( tmpstr ) , ”%s%d ” , type , id ) ; 119 return tmpstr ; 120 } 121 122 /∗re turns ad9361 phy device ∗/ 123 s t a t i c s t r u c t iio device∗get ad9361 phy ( struct iio context ∗ctx ) 124 { 125 struct iio device ∗dev = i i o c o n t e x t f i n d d e v i c e ( ctx , ” ad9361−phy ” ) ; 126 ASSERT( dev && ”No ad9361−phy found ” ) ; 127 return dev ; 128 } 129 130 /∗find s AD9361 streaming IIO devices ∗/ 131 static bool get ad9361 stream dev ( struct iio context ∗ctx , enum iodev d , struct iio device ∗∗dev ) 132 { 133 switch ( d ) { 134 case TX: ∗dev = i i o c o n t e x t f i n d d e v i c e ( ctx , ” cf−ad9361−dds−core−lpc ” ) ; return ∗dev != NULL; 135 case RX: ∗dev = i i o c o n t e x t f i n d d e v i c e ( ctx , ” cf−ad9361−lpc ” ) ; return ∗dev != NULL ; 136 default : ASSERT( 0) ; return false ; 137 } 138 } 139 140 /∗find s AD9361 streaming IIO channels ∗/ 141 static bool get ad9361 stream ch ( struct iio context ∗ctx , enum iodev d , struct iio device ∗dev , int chid , struct iio channel ∗∗chn ) 142 { 143 ∗chn = i i o d e v i c e f i n d c h a n n e l ( dev , get ch name ( ” voltage” , chid ) , d == TX) ; 144 i f ( ! ∗chn ) 145 ∗chn = i i o d e v i c e f i n d c h a n n e l ( dev , get ch name ( ” a l t v o l t a g e ” , chid ) , d == TX) ; 146 return ∗chn != NULL ; 147 } 148 149 /∗f i n d s AD9361 phy I IO c o n f i g u r a t i o n channel w it h i d chid ∗/ 150 static bool get phy chan ( struct iio context ∗ctx , enum iodev d , int chid , struct iio channel ∗∗chn ) 151 { 152 switch ( d ) { 153 case RX: ∗chn = i i o d e v i c e f i n d c h a n n e l ( get ad9361 phy ( c tx ) , get ch name ( ”voltage” , chid ) , f a lse ) ; return ∗chn != NULL; 154 case TX: ∗chn = i i o d e v i c e f i n d c h a n n e l ( get ad9361 phy ( ctx ) , get ch name ( ”voltage” , chid ) , true ) ; return ∗chn != NULL; 155 default : ASSERT( 0) ; return false ; 156 } 157 } 158 159 /∗find s AD9361 l o c a l o s c i l l a t o r IIO c o n figu r a t ion channels ∗/ 160 static bool get lo chan ( struct iio context ∗ctx , enum iodev d , struct iio channel ∗∗chn ) 161 { 162 switch ( d ) { 163 / / LO chan i s always output , i . e . true 164 case RX: ∗chn = i i o d e v i c e f i n d c h a n n e l ( get ad9361 phy ( c tx ) , get ch name ( ” a l t v o l t a g e ” , 0) , tru e ) ; return ∗chn != NULL; 165 case TX: ∗chn = i i o d e v i c e f i n d c h a n n e l ( get ad9361 phy ( ctx ) , get ch name ( ” a l t v o l t a g e ” , 1) , tru e ) ; return ∗chn != NULL; 166 default : ASSERT( 0) ; return false ; 167 } 168 } 169 170 /∗ap pli es streaming c o n f i g ur a t i o n through I IO ∗/ 171 bool cfg ad9361 streaming ch ( struct iio context ∗ctx , struct stream cfg ∗cfg , enum iodev type , int chid) 172 { 173 struct iio channel ∗chn = NULL; 174 175 / / Configure phy and l o channels 176 p r i n t f ( ”∗Acquiring AD9361 phy channel %d\n ” , chid ) ; 177 i f ( ! get phy chan ( ctx , type , chid , &chn ) ) {return false ; } 178 wr ch str ( chn , ” r f p o r t s e l e c t ” , cfg−>r f p o r t ) ; 179 w r c h l l i ( chn , ” rf bandwidth ” , cfg−>bw hz ) ; 180 w r c h l l i ( chn , ”sampling frequency” , cfg−>fs h z ) ; 181 182 / / Configure LO channel 183 p r i n t f ( ”∗Acquiring AD9361 %s l o channel\n ” , type == TX ? ”TX” :”RX” ) ; 184 i f ( ! get lo chan ( ctx , type , &chn ) ) {return false ; } 185 w r c h l l i ( chn , ”frequency” , cfg−>lo hz ) ; 186 return tr ue ; 187 } 188 bool chkcfg ad9361 streaming ch ( struct iio context ∗ctx , struct stream cfg ∗cfg , enum iodev type , int chid ) 189 { 190 struct iio channel ∗chn = NULL; 191 192 / / Configure phy and l o channels 193 / / p r i n t f ( ” ∗Acquiring AD9361 phy channel %d\n ” , chid ) ; 194 i f ( ! get phy chan ( ctx , type , chid , &chn ) ) {return false ; } 195 /∗r d c h l l i ( const s t r u c t iio cha nne l ∗, const char ∗, long long∗) 196 chn A p o in t e r to an i i o c h a nn e l s t r u c t u r e 197 a t t r A NULL−terminated s t r i n g corresponding to the name of the a t t r i b u t e 198 val A p oin ter to a long long v ari a ble where the value should be stored ∗/ 199 r d c h l l i ( chn , ” rf bandwidth ” , &cfg−>bw hz ) ; 200 r d c h l l i ( chn , ”sampling frequency” , &cfg−>fs hz ) ; 201 i f ( ! get lo chan ( ctx , type , &chn ) ) {return false ; } 202 r d c h l l i ( chn , ”frequency” , &cfg−>lo h z ) ; 203 return tr ue ; 204 } 205 / / PLOT CONFIG 206 #define NUM POINTS 5 207 #define NUM COMMANDS 2 208 209 #define TABLE SZ 1048576 / / 1024∗1024 210 211 212 213 /∗simple c o n f i g u ra t i o n and streaming ∗/ 214 int main ( int argc , char ∗∗argv) 215 { 216 / / TABLE TO FIT THE SIGNAL 217 / / const i n t t x s i z e = 1024∗512; 218 int ∗t x b u f f e r ; 219 / / t x b u f f e r = malloc ( f ∗(d ? 8 : 4) ) ; / / [ 2 ∗t x s i z e ] ; 220 221 / / Streaming devices 222 struct iio device ∗tx ; 223 struct iio device ∗rx ; 224 225 / / RX and TX sample counters 226 s i z e t nrx = 0; 227 s i z e t ntx = 0; 228 229 // Stream configurations 230 struct stream cfg rxcf g ; 231 struct stream cfg t xcf g ; 232 233 / / Listen to c t r l +c and ASSERT 234 s ig nal ( SIGINT , handle sig ) ; 235 236 / / RX stream conf ig 237 r xc fg . bw hz = MHZ( 60 .0) ; / / 2 MHz r f bandwidth 238 r xc fg . fs hz = MHZ(6 0.0 ) ; / / 2.5 MS/ s rx sample r ate 239 r xc fg . lo hz = GHZ( 2.3 9) ; / / 2 GHz r f frequency 240 r xc fg . r f p o r t = ”A BALANCED” ;/ / port A ( se lec t fo r r f freq . ) 241 242 / / TX stream c onf ig 243 t xcf g . bw hz = MHZ( 60. 0) ; / / 1.5 MHz r f bandwidth 244 t xcf g . fs h z = MHZ(60 .0 ) ; / / 2.5 MS/ s t x sample rate 245 t xcf g . lo h z = GHZ(2. 39 ) ; / / 2 GHz r f frequency 246 t xcf g . r f p o r t = ”A” ;/ / p or t A ( s el ec t f o r r f f re q . ) 247 int s i g f r e q = MHZ( 2 ) ; 248 249 250 251 / / i n t t x s i z e = t xc f g . fs h z / 2 ; 252 253 254 t x b u f f e r = malloc (TABLE SZ∗sizeof(int) ) ; / / [2∗t x s i z e ] ; 255 256 p r i n t f ( ”∗Creating the TX wave\n ” ) ; 257 short i p a r t , q pa rt ; 258 259 p r i n t f ( ”∗With size %i ” ,TABLE SZ) ; 260 for (int i = 0; i <TABLE SZ ; i ++){ 261 /∗The l a t e s t version of the fmcomms IIO scope plug−i n supports the TEXTU optio n v a l i d range with the ’TEXTU ’ o ption i s : 262 +−−−−−−−−−−−−+−−−−−−−−−−−−−−+ 263 |Board |Range | 264 +−−−−−−−−−−−−+−−−−−−−−−−−−−−+ 265 |fmcomms1 |+/−32767.0 | 266 |fmcomms2 / 3 / 4 |+/−2047.0 | 267 +−−−−−−−−−−−−+−−−−−−−−−−−−−−+