Research Article
FPGA Implementation of Physical Layer of Cognitive Radio
School of Computing, SASTRA University, Thanjavur, 613402, India
R. Muthaiah
School of Computing, SASTRA University, Thanjavur, 613402, India
Radio spectrum is rare natural resource which is used for wireless communications like mobile phones, Wi-Fi, XG, etc. The RF band is divided into unlicensed and licensed bands in order to optimum usage of the radio spectrum. The user using licensed band should pay for using a spectrum band exclusively to avoid interferences with others. In an unlicensed or license-free band, anyone can use the spectrum and it is free of cost. Large portions of the licensed spectrum are used occasionally or not at all due to many external factors such as geographical variations or traffic loads on a licensed band. This under utilization of the licensed band by the user leads to the development of Cognitive Radio (CR). Software Defined Radio (SDR) provides the flexibility of reconfiguring the hardware components using software. CR is based on SDR where the spectrum sensing capability is added which is essential for next-generation wireless devices.
Spectrum sensing is defined as the technique where the unlicensed users or Secondary Users (SU) will continuously monitor the licensed user or Primary Users (PU) when it is free, SU will occupy that particular frequency band otherwise the user will quit that band and jump to the other free band. This will avoid interferences with other users (Aldar, 2010). The CR transceiver is a device that automatically alters its transmission and reception parameters according to the sensed information to avoid interference. OFDM based transmission technique is employed in CR due to low inter symbol interference and high baud rate. The main advantage of using OFDM in cognitive radio is low Peak to Average Power Ratio (PAPR). The transmitter of cognitive radio is not implemented in FPGA in previous works. But the present work is connected with the design of spectrum sensing function and transmitter. The implementation of Cognitive Radio transmitter for wireless communication on a single FPGA is done and studied.
CR TRANSMITTER ARCHITECTURE
OFDM for wireless communication: All wireless data communication systems use some modulation technique to encode digital data before transmission. The encoded data can be transmitted either serial or parallel pattern. The Parallel data transmission is more advantageous because it reduces multipath fading. In OFDM, the data which have to be transmitted is split into some number of parallel data streams known as subcarriers. The subcarriers are modulated using techniques like BPSK, QPSK, QAM, FSK, etc. prior to transmission (Haykin, 2005).
The duration of the OFDM symbol will be long due to the presence of many subcarriers. These are very closely placed with no interferences between them. This reduces the effect of Inter Symbol Interference (ISI) at the receiver and also the available bandwidth is efficiently used (Osman and Ashok, 2011). ISI is caused due to multi path fading where the transmitted signal takes two or more paths when reflected by buildings or other obstructions and will reach the receiver at a different time. Some of these reflected paths will take more time than the direct path from transmitter to receiver. The delayed multipath signal will overlap with the next OFDM symbol. The amount of overlap can be small because the OFDM symbol duration is long when compared to serial modulation where the amount of overlap can span several short symbols. To remove ISI completely guard intervals are inserted at the OFDM symbol, the receiver will omit these guard intervals. In this project, cyclic prefix is used as the guard interval which is an imitation of last part of symbol. It is inserted at the start off of every OFDM symbols.
OFDM-CR transmitter: The transmitter is designed by the high-level design tool, Xilinx System Generator which runs sunder MATLAB Simulink. The block diagram of transmitter is shown in Fig. 1, which contains the following blocks, PRBS, data scrambler, convolution encoder, interleaver, data mapper, pilot and preamble symbols and IFFT in the transmitter. The whole transmitter architecture is implemented in Virtex-5 FPGA.
Source: The input data is random binary sequences (1s and 0s) generated a by Pseudo Random Binary Sequence (PRBS) generator. PRBS is implemented using Linear Feedback Shift Register which uses a XOR gate at the beginning of the first shift register that will XORs the taps together with the outcome going to the first register. In this 6 registers are used.
Fig. 1: | Cognitive radio transmitter architecture |
Scrambler: Scrambling is a coding technique which is used to secure the data at low cost. Scrambler will randomize the digital data to avoid long sequences of 1s and 0s. From long strings of same number timing information cannot be retrieved at the output since there is no immediate transition in the input data (Bhat, 2009). Here scrambler is designed with 7 shift registers and 2 modulo-2 adders.
Convolution encoder: It is also an encoding technique which is very important in wireless communication because noise and other external factors can change bit sequences. It introduces redundant bits into the data, so transmitting data size will be larger than the original data. The error occurred during transmission can be easily found. The redundant bits are introduced into the data stream by linear shift registers and modulo-2 adders. The rate of the encoder can be 1/2 (two output bits for every input bit), 1/3 (three output bits for every input bit).
Interleaver: The encoded data from the convolution encoder is given to the interleaver which randomize the order of the data (may contain errors fed during transmission) so that the noise can be identified distinctly at the receiver this leads to better error correction. Rectangular block interleaver is used where the inputs are written in row-wise then inter-row and column permutations are made and the output is taken column-wise. The transmitter architecture in the system generator is shown in Fig. 2.
Mapper: The interleaved data bits are given to the constellation mapper where they are modulated using BPSK, QPSK and FSK etc., techniques. This work concentrates on QPSK constellation the in phase and quadrature data are stored in separate ROM.
Fig. 2: | Transmitter in system generator |
Mapping is done to improve the bandwidth efficiency which describes capability of a modulation method to accommodate data, within the limited bandwidth.
Pilot: In each mapped OFDM symbol pilot, signal are inserted in the subcarrier -21, -7, 7, 21 and dc zero at 26 to make communication robust against phase noise and frequency offsets due to multipath fading. The values of the pilot subcarriers are {1, 1, 1 and 1}. Multipath fading can affect subcarrier frequencies. As the symbols of the pilot subcarrier are known to the receiver, the receiver can make use of these pilots to find the channel conditions.
Preamble: It is necessary to begin each frame with some preamble symbols so that the receiver can easily detect the start of the transmission. Preambles are of the short and long preamble. Short preamble followed by the long preamble should be added at the beginning of each OFDM symbol (Feng et al., 2009).
IFFT: The input given to the IFFT is in the format 5 OFDM data, 1 pilot symbol, 13 data carriers, 1 pilot symbol, 6 data carriers, a dc zero, 6 data carriers, 1 pilot , 13 data carriers, 1 min pilot symbol, 5 data samples and 11 zeros which form 52 subcarriers. But the length of OFDM symbol should be 64 subcarriers hence the input is extended further with the cyclic prefix of size 12. Thus, 64 OFDM symbol is obtained in time the domain which is then transmitted.
SPECTRUM SENSING
The main functions of CR are spectrum sensing, management, sharing and mobility. The techniques for spectrum sensing can be classified as: transmitter detection, cooperative detection and interference based detection. In transmitter detection, the free band is found by continuous observation of weak signal of CR (Cabric et al., 2004). Cooperative detection is done by combining the performance of several CRs. In the above techniques, the sensing time is more and complex to design. In this study, the sensing is done using energy detection technique (Wang, 2009). The proposed spectrum sensing architecture is shown in Fig. 3. The blocks used are primary users, buffer, peak detector, math function (square, log), threshold and priority. The whole architecture is designed using Simulink. Sine waves generated by sine wave generator at different frequencies are taken as input which is directed to the buffer block (Mitola and Maguire, 1999). It reallocates each column of the input samples to a new frame size. By reducing the input sample frame size the output frame rate will be increased. Here the frame size is fixed as 100. The output from the buffer is given to the peak detector which will find the number of extreme values in the input signal by comparing the current value with the previous and next values. Then signal is squared and logarithm is taken to enhance the signal strength. The spectrum sensing architecture in Simulink is shown in Fig. 4.
Fig. 3: | Block diagram of spectrum sensing |
Fig. 4: | Spectrum sensing architecture |
Fig. 5: | Simulink results for CR transmitter |
In the threshold block, comparator is used to compare the input signal with the predefined (threshold) value so that the signals below the threshold value (another user is using) will be ignored only strong signals will be given to the output (Malik et al., 2010). The priority block will decide which primary user is using the spectrum and which user is not using (idle).
COGNITIVE RADIO IMPLEMENTATION AND RESULTS
The first channel in Fig. 5 shows the source data. The succeeding channel shows the scrambled, convolution encoding, mapped data, IFFT real and IFFT imaginary outputs, respectively. The digital output for OFDM based CR in shown in Fig. 6 and 7.
Fig. 6: | Digital output for OFDM-CR system |
Fig. 7: | Digital output for IFFT |
Fig. 8: | Simulink results for spectrum sensing |
Figure 6 shows the source and scrambled data in first and second channel. The pilot and preamble symbols are given in third and fourth channel, respectively. Figure 7 shows the IFFT real and imaginary outputs in the first and second channel, respectively. Figure 8 shows the Simulink output of spectrum sensing where the first three channels represent the primary users. The fourth channel is output showing which user is using the band at the particular time. The threshold value is fixed as 1.95. Consider the highlighted portion the output is 5(101) shows that the users 1 and 3 are idle and user 2 is using.
Fig. 9: | ChipScope Pro output for transmitter |
Table 1: | Device utilization summary |
The transmitter is implemented in FPGA family virtex 5, device XC5VLX50 with speed -1.The Output is checked in ChipScope. Figure 9 shows the output from the transmitter as tapped by ChipScope pro. The FPGA resource utilization summary is shown in Table 1.
The SDR brings flexibility, cost efficiency and power to drive wireless communication forward, with wide-reaching benefits in the field radio communications. The various issues like spectrum allocation are overcome using the next giant leap in radio communication-cognitive radio. The CR provides an intelligent and simpler approach for the issues faced by SDR. The designed cognitive radio provides an innovative approach for the implementation of transmitter and the sensing unit. The OFDM based transmitter and sensing unit design reduces the inter-symbol interference and consumes less detection time of the spectrum, thereby the spectrum sensing unit provides a comfortable sharing and mobility of its spectrum range. Receiver design is one of the main objectives that are aimed in the near future. The synthesis and implementation are done using MATLAB and Xilinx tools and are verified to accuracy.