Design and Study of Cognitive Network Physical Layer Simulation Platform

and Applied Analysis 3 1 2 3 5 4 8 7 6 9 10 11 12 13 14 15 LSB MSB Scrambled data Unscrambled data Figure 3: Pseudorandom binary sequence generator for data scrambler. constellation are roughly the same, and then reduce the PAPR (peak-average power ratio). The sequence generator of Scrambler is shown in Figure 3. The data scrambler is initialized on each burst with 011011100010101. The FEC (forward error correction) module adds redundancy bit to improve the possibility of recovery from error transmission. The constraint length of the Binary ConvolutionCoder is equal to 7 and its generator polynomials are 1710 and 1330, respectively.The other coding rates are obtained by puncturing. The Interleaver is turbo-like interleaver with a parameter of {p, q, j}. The value of {p, q, j} is determined by the coded block.The interleaving table can be obtained in the following way. K represents the size of the coded block and m is the number of iterations. When m = j, the interleaving table is generated:


Introduction
Currently, wireless communication is developing towards multimedia applications which require higher data rates.Due to the natural characteristics of frequency resources, the historical strategy of static allocation has been unable to meet the growing demand of devices with high data rates.There is an urgent need for a technology to detect usable frequencies and enable dynamic usage of these frequencies.Cognitive radio technology emerges in response to this need.
Cognitive radio arises to be a tempting solution to the spectral congestion problem by introducing opportunistic usage of the frequency bands that are not occupied by licensed users [1].The core of cognitive radio is spectrum sensing technique.The spectrum will be first sensed to decide whether it is being used by the licensed users.If the spectrum is not in use, the current frequency can be used for unlicensed users.
In December 2003, the U.S. Federal Communications Commission (FCC) announced a revision of the Part 15 in its rules.The revision states that "provided with the functions of cognitive radio, a wireless terminal, even for unlicensed purposes, is allowed to use the existing licensed wireless resources." This revision laid a legal foundation for the new wireless resource management technology.The first IEEE 802.22 working group that was based on cognitive radio was established in November 2004, with the purpose to address the wireless wide area network access using cognitive radio technology in broadcast and TV bands [1].
IEEE 802.22 is known as a cognitive radio standard for its cognitive characteristics.The IEEE 802.22-basedWRAN (wireless regional area network) works in the TV band and, by sensing the portion that is not occupied or has been vacated in the TV band, uses the current frequency for wireless communication without interfering with the signals of other TV channels.The IEEE 802.22 technology represents a specific application of cognitive radio technology in the wireless area.It is characterized by flexible and self-adaptive reasonable configuration of spectrum without interference to the authorized user.The technology is mainly comprised of spectrum sensing, coexistence, channel management, multichannel binding, and OFDMA [2].
The WRAN spectrum sensing technique can be broadly divided into two categories: blind sensing technique and signal specific sensing technique.Blind sensing technique does not have to know the signal characteristics but detects frequency based on energy [3][4][5], eigenvalue [3,5,6], or cyclostationarity [3,7].Signal specific technique detects  frequency based on features of specific signal type and its detection of existing signal systems like ATSC, PAL, and DVB is investigated in [8][9][10].CBP (coexistence beacon protocol) is a protocol proposed in the 802.22 standard to address the coexistence and interconnection of adjacent WRAN systems.CBP helps to identify adjacent networks, realize coexistence between them, and achieve resource sharing between base stations [2].
When the WRAN system senses available frequencies, efficient use of these frequencies is needed in uplink and downlink transmissions.The WRAN deploys OFDMA as a transmission technique at the physical layer.The throughput of the system is determined by the transmission and reception performance of OFDMA.This paper is intended to provide a MATLAB test platform for the OFDMA technique based on IEEE 802.22 WRAN and the proposed platform is expected to serve as a test framework for equipment and chip manufacturers and even for specification improvements.This paper also suggests a set of receiver algorithms with excellent performance and strong robustness to verify the correctness of the platform.
The paper is organized as follows.Section 2 describes the physical layer of WRAN and offers the parameters of the key parts; the test platform for the downlink physical layer of WRAN is divided into modules with detailed descriptions in Section 3; Section 4 states the process of designing synchronization algorithm of the test platform and the details of algorithm.Finally, the paper concludes with the test results of the platform, verification of the algorithm performance, and illustration of the correctness of the platform.

PHY Layer Description
In accordance with the IEEE 802.22 standard, the physical layer of WRAN is responsible for the data encoding, modulation, transmission, and so forth.The physical layer of WRAN is based on the OFDMA transmission technique and the data is transmitted on the subchannel allocated.The main system parameters of WRAN are shown in Table 1.
The frame structure of WRAN is shown in Figure 1.The first OFDM symbol is Frame Preamble, which is a training sequence with a fixed format; frame preamble is followed by  symbols and the  depends on the system bandwidth and the size of CP.

Channel Coding.
The Channel coding process is shown in Figure 2, which includes the processing of Scrambler, FEC, Interleaver, and constellation mapping.
Scrambler is used to scramble the bit data, eliminate consecutive 0 or 1, ensure that the probabilities of each constellation are roughly the same, and then reduce the PAPR (peak-average power ratio).The sequence generator of Scrambler is shown in Figure 3.The data scrambler is initialized on each burst with 011011100010101.
The FEC (forward error correction) module adds redundancy bit to improve the possibility of recovery from error transmission.The constraint length of the Binary Convolution Coder is equal to 7 and its generator polynomials are 1710 and 1330, respectively.The other coding rates are obtained by puncturing.
The Interleaver is turbo-like interleaver with a parameter of {, , }.The value of {, , } is determined by the coded block.The interleaving table can be obtained in the following way. represents the size of the coded block and  is the number of iterations.When  = , the interleaving table is generated: ,, ()] mod ] mod .
The Constellation mapping module maps symbol with complex value according to the input bit sequence and constellation.

Constellation Mapping and Modulation.
WRAN mainly uses the constellation points of BPSK, QPSK, 16QAM, and 64QAM.BPSK is mainly used for pilots and preambles.The data symbols use QPSK, 16QAM, and 64QAM.The mapping for QPSK, 16QAM, and 64QAM is performed according to Gray-coding constellation mapping.

OFDM Subcarrier
Allocation.Among the 2048 subcarriers in each OFDM symbol, 384 subcarriers are null subcarriers (left guard band, right guard band, and DC subcarriers) with 0 amplitude and 0 phase.The remaining 1680 subcarriers are useful subcarriers, including 1440 data subcarriers and 240 pilot subcarriers.The 1680 subcarriers are divided into 60 subchannels, each of which includes 24 data subcarriers and 4 pilot subcarriers.
The pilot pattern will be repeated every 7 OFDM symbols and 7 subcarriers in the time and frequency domains, respectively, for the specific rule, as shown in Figure 4.
Before being allocated, the data subcarriers have to go through symbol interleaving first.Symbol interleaving is

Fundamental of WRAN Downlink
Test Bench

WRAN Transmitter. WRAN adopts the matured COFDM (coded-orthogonal frequency division multiplex)
technique whose transmitter is designed in accordance with the IEEE 802.22 standard.The chart of processing the signal at the physical layer is shown in Figure 5.
The control parameter of the Random Source module is burst size.Burst size depends on parameters like the type of modulation and coding rate.The code rate of the channel coding module is 1/2, 2/3, 3/4, and 5/6.Controlling the pattern of puncturing will yield the data of coding rate.The control parameter of subcarrier allocation + pilot insertion is ofdm index, which is used to decide the offset of pilot insertion.The task of OFDM modulation consists of IFFT transformation and CP insertion.The CP size is used to control the size of the CP portion.

Channel Model.
The channel model, in addition to embracing the characteristics of wireless transmission, introduces the impacts of timing offset, frequency offset, and phase offset, as shown in Figure 6.The multipath channel model uses the Power Delay Profile in the DVB system.Its parameters include the sampling rate of signal and the size of Doppler.This module introduces the impacts of frequency selectivity and time variance.The AWGN channel module is the additive white Gaussian noise whose main function is to simulate the interference of adjacent channels and in-band.Its parameter is SNR.Based on the SNR, the power of the AWGN noise can be calculated.
Module named timing offset simulates the timing offset to input signals.The control parameter of timing offset is timing offset.Module Phase & Frequency Offset simulates carrier phase offset and carrier frequency offset.The model of the module is shown as follows: where Δ = freq offset + freq offset step *  + freq offset random variance * randn( );  = phase offset + phase offset step *  + phase offset random variance * randn ( ), where  is  the sequence number of the OFDM symbol and randn is a normal distribution generating function.

WRAN Receiver.
The OFDMA downlink receiver is shown in Figure 7.After downconversion and low-pass filtering, the received signal is fed to an analog-to-digital (A/D) converter, where it is sampled with frequency   = 1/  ⋅ () can be expressed as It is assumed here that the channel has  paths, and   represents the relative time delay of the mth path,  error represents the timing offset, and () represents additive noise.The CP is removed after the synchronization and the following signal results: The DFT output ⃗   has entries where   () is the additive noise, () is the channel frequency response of the th subcarrier () = ∑ −1 =0 () −2/ , and () is the sampling signal of It can be observed from the above equation that OFDM can be seen as a set of parallel transmissions over  Gaussian channels with different complex-valued attenuations ().The channel equalizer can estimate the gain value of each subcarrier and the one-tap equalizer can be used to eliminate the impact of channel gain.The criteria of the equalizers can be designed based on the criterion of ZF or MMSE [11].The output of the equalizers needs the demapping and decoding modules to restore the original bit.

Synchronization Tasks.
The most important impact of transmitting/receiving frequency offset is the loss of intersubcarrier orthogonally which further results in ICI.ICI is somewhat similar to AWGN and will reduce the SNR [12] of the receipt signal.For the AWGN channel and the fading channel, this reduction grows with the increase in the square of the number of subcarriers.Table 3 shows the relationship between the attenuation value of SNR and the normalized frequency offset Δ.
Similar to the frequency offset, the phase noise offset and the sampling clock offset can result in ICI and reduce the SNR of received signal as well.The scope of their impact is shown in Table 3, which proved that the sampling clock offset impacts each subcarrier differently.As a subcarrier stays far away from the DC frequency position, the SNR shows a large attenuation value.
The symbol timing offset does not have an impact on the system performance significantly.If the length of cyclic prefix arg max is larger than the length of channel impulse response, the orthogonality among subcarriers will not be damaged as long as the timing position stays within the effective range (from the cyclic prefix starting in the length of channel impulse response to the end of the cyclic prefix).A slight timing offset will only lead to the phase rotation of data symbols and this can be compensated in the channel equalization module, thus causing no damage to the orthogonality.If the capture position is outside the effective range, ISI and ICI will appear and the system performance will be deteriorated strongly.
The frequency offset, the timing synchronization, and the frequency synchronization error should satisfy the following condition [13][14][15] in order to keep the loss of system performance within an acceptable range: Δ ⋅   ≪ 0.02.
The synchronization module will ensure that the residual offset will meet the condition above.

Synchronization Modules
As the inaccurate timing of the symbol at the demodulating terminal causes the FFT window offset and ISI, the last 2 terms can be merged into one term, ISI(,  error ).The final demodulation signal can be expressed as  , error () =   ()  2( error /) + ISI (,  error ) .
As can be seen from the above equation, the inaccurate timing of the symbol brings two impacts.First, a phase rotation is added to the demodulation signal with accurate timing and the size of the phase rotation is proportional to the positions of subcarriers represented by .The phase rotation which is similar to the phase offset caused by the transmission channel does not affect the intersubcarrier orthogonal of the OFDM signal.ISI appears when the symbol timing offset exceeds a sampling point.
Abstract and Applied Analysis Phase offset exists in the demodulated signal only if the timing falls into the scope of the CP.The phase offset can be eliminated through channel equalization.The timing module is only required to meet this condition.
(a) Coarse Timing Synchronization.Because the OFDM signal has the component of CP, the CP-based ML algorithm [15,16] can be used.This algorithm is to find the joint estimation of the timing and the frequency.The schematic diagram is shown in Figure 8.
In the diagram,  = SNR/(SNR + 1).The CP-based ML algorithm is capable of fast synchronization and only needs to collect samples with the length of one OFDM symbol.The length of moving sum is usually the length of CP part.When the length of the CP is large, this algorithm can yield better precision.However, because WRAN has CP with a size of 128 (1/16) and even 64 (1/32), the precision is less satisfactory.
Schmidt and Cox (S&C) in [16,17] propose a new synchronization algorithm, which is based on a particular training sequence.It is composed of two identical halves of length /2 which is transmitted at the beginning of each frame.The first OFDM symbol of the WRAN frame is the preamble we wanted.When such a characteristic is present, it is feasible to use the Schmidt and Cox algorithm.The Schmidt and Cox algorithm has better precision than the CP based ML algorithm, but its correlation shows plateau at the peaks.
Although the estimation precision of S&C algorithm can meet the requirement, accurate timing can increase the estimation precision of frequency offset.A new method is proposed here to improve the timing estimation precision.Once the timing of the frame is found and the coarse frequency synchronization has been completed, the correlation between the local preamble and the received preamble can be used to generate the precise timing information.
Coarse timing synchronization adopts these three methods, and specific strategy of usage should be decided according to the current synchronization status.
(b) Timing Synchronization Scheme.In order to reduce the synchronization time, the CP based ML algorithm is first used to roughly estimate the timing offset which is shown in Figure 9; on this basis, the Schmidt and Cox algorithm is adopted to find the starting point of the frame; once the starting point of the frame is found, the method of Preamble correlation can be used to search within only a small scope and will be able to find the exact frame timing and symbol timing.The strategy diagram of timing synchronization is shown in Figure 10.
With the usage of the timing strategy, the estimated timing result is shown in the following diagram.Figure 11 shows a better performance.

Frequency Synchronization.
If we assume that the length of the channel response is shorter than the length of the cyclic prefix and the oscillators at the terminal and the transmitter have a frequency offset  error , the normalized frequency offset Δ relative to the subcarrier interval will be And the demodulated signal is generated: where  , is the output of DFT of the additive noise and ICI(, ) = (1/) ∑ −1 =0  2(+ error −)/ denotes the intersymbol interference.As can be seen from the above equation, the received signal is subject to not only the channel but also frequency offset.If the normalized frequency offset Δ is an integer, the difference between the final result  , and the actual transmitted sequence  , is that  , is the cyclic shift of  , .If the Δ is a decimal, ICI (, ) = 1   It can be deduced as The presence of a frequency offset will lead to the following impacts.Firstly, it will cause phase rotation of the receiving signal which will be reflected in the multiplicative factor  2 error (+  )/ ; secondly, the frequency offset will result in a fading term (sin  error / sin( error /))  error ((−1)/) ; finally, the frequency offset will damage the orthogonal among subchannels and result in the interference term , ICI(−).In order to understand the impact of Δ on the system performance, [18] suggests using the additive noise and the frequency offset to produce Δ and the effective SNR at the receiving terminal will be where If there is no white noise, the frequency offset has to meet the condition | error | ≤ 1.3 × 10 −2 so as to realize a 30 dB SNR at the receiving terminal.In this case, the error of the estimation precision of the frequency offset should be maintained at 1-2% of the subchannel interval.
(a) Coarse Frequency Synchronization.Because a fractional Δ will cause unrecoverable ICI, the CFS should first estimate and eliminate the impact.The CP-based MLE enables joint estimation of timing and frequency offset and its estimated metric [15,16] can be expressed as follows: In the case of ideal timing synchronization, the above equation can be changed into With the CP-based ML estimator,  usually represents the number of length of the CP, and the above equation is changed into (0) = ∑ −1 =0  * ()( + ).Given ( + ) = (), the estimated value thus is  = ∠(0)/2.Given the range of calculated phase [−, ],  is the fractional part of Δ.
The estimation precision of the frequency offset depends on the size of .The estimation outputs with four sizes of CP in WRAN are shown in Figure 12.
(b) Fine Frequency Synchronization.When the detector stays at the beginning of frame, the preamble can be considered to estimate the fractional Δ and the integer Δ.The processing of the signal is shown in Figure 13.
In the case of ideal timing synchronization, the estimator of fractional frequency offset is where  =  = /2; thus a more precise estimation of fractional frequency offset  = ∠(0)/ can be obtained.Because the length of  is larger than the cyclic prefix, this algorithm yields better precision than the CP-based ML estimator.
When the fractional frequency offset is estimated and corrected, the following metric can be used to estimate the integer frequency offset: where represents the PRBS sequence with length of 1681; PRBS rec (, ) represents the new sequence with length of 1861 structured by the receiving sequence demodulated by the OFDM demodulation;  = min(subcarrier ∈ Sliding Window) + 840 determines the starting position of the intercept data; when  = 0, there is no offset.See Figure 14.
The estimator of the integer frequency offset is expressed as Because the PRBS is constituted by the PN sequence, it is characterized by good correlation.Figure 15 shows the calculation result of () when the integer frequency offset (c) Frequency Synchronization Scheme.Closed-loop control is applied for frequency synchronization which can be divided into capture phase and tracking phase.At the capture phase, ML and PRBS-based algorithms are adopted to estimate and correct frequency offset.Since frequency offset is timevarying, the tracking phase follows capture phase.The tracking phase is based on the ML algorithm and uses a loop filter to filter the tracked error and improve the tracking precision.
The loop is as shown in Figure 16.
The design of the loop filter design needs to consider the speed of convergence and the residual error.If the loop filter factor is too small, although the residual offset is small after convergence, the convergence will be slow or even not happen at all; if the loop filter factor is too large, the convergence will be rapid, yet the residual offset will be large.So it should be designed carefully.
The decoding performance under different filter coefficients can be generated by simulating the receiving performance under different scenarios as follows: (i) the scenario with a fixed frequency offset tests the residual error performance of the frequency offset tracking loop; (ii) the scenario with a fixed frequency offset superimposed by a frequency offset changing linearly with time tests the error tracking performance of the frequency offset tracking loop; (iii) the scene with a frequency offset with normal distribution tests the anti-interference capability of the frequency offset tracking loop.
As is shown in Figures 17 and 18, a filter coefficient of 0.5 is appropriate for the loop as the loop shows excellent performance in residual frequency offset and bit error.synchronization and the OFDM demodulation processes [16][17][18].Module OFDM demodulator performs the following functions: remove the CP, DFT and extract the data subcarriers and pilot subcarriers; the implementation in this module can be carried out with reference to [2].The channel equalization adopts the transformation domain method and reference of its algorithm can be found in [11].Module Symbol demodulation conducts soft demodulation on the IQ signals and the soft bits of the output LLR forms are shown in [19].Module FEC decoder completes the bit deinterleaving, Viterbi decoding, and bit descrambling; bit deinterleaving and bit descrambling are the reverse operation of the transmitter, with reference to [2]; the trace back length of Viterbi decoding is 34.

Simulation Results.
The transceiver of the WRAN Downlink can be implemented in accordance with the above algorithm.A comparison of the BER, BLER, and Raw BER can help to optimize the parameters of the modules and evaluate the performance losses of the modules.
Because the Raw BER is BER that is not corrected by FEC, it can be compared with the theoretical value to generate the performance losses of the estimation modules in synchronization and channels.The BER is the FEC decoded bit error ratio that can be used to evaluate the decoding performance.Since the Viterbi algorithm and the symbol demodulation are relatively mature, their performance losses are negligible.
With no timing offset, frequency offset, and phase offset, the simulation performance in the AWGN channel is compared with the theoretical value in Figure 19.Under the QPSK, 16QAM, and even 64QAM modulation, the simulation value is highly close to the theoretical value.
With a timing offset of 3 samples in the system, a frequency offset of 0.25, and a phase offset of 10 degree, the platform performance in the AWGN channel is shown in Figure 20 compared with the theoretical value.Under the QPSK, 16QAM, and even 64QAM modulation, the difference between the simulation value and the theoretical value is no With a timing offset of 3 samples in the system, a frequency offset of 0.25, and a phase offset of 10 degree, as a result of channel estimation, the simulation platform performance in the TU channel is compared with the theoretical value in Figure 21.The loss in SNR, about 1 dB, comes mainly from the residual frequency offset and the nonideal characteristics of channel estimation.
In terms of system performance and algorithm complexity, the WRAN-based link-level simulation platform shows good robustness and excellent performance with the algorithm provided.It provides a reference for the hardware implementation and serves as reference data for system-level simulation platforms.

Conclusion
After providing a detailed introduction to the physical layer of the IEEE 802.22 WRAN, this paper continues to focus on the functions of the link-level simulation platform and the module design.
In the receiver algorithm, timing synchronization and frequency synchronization are important for the OFDM Raw bit error ratio  system.Following the implementation of the simulation platform, the Raw BER performance is simulated to verify the performance of the platform and the simulation results show that the simulation platform performance in the AWGN channel is almost the same with the theoretical value.Under a nonideal case, the SNR loss of the platform is less than 1 dB, proving good performance of the platform and making the experiment to improve the WRAN feasible.

Figure 8 :
Figure 8: Structure of the ML estimator.

4. 1 . 1 ∑
Timing Synchronization.Since the terminal does not have the accurate timing information of the transmitter and the sampling clock drift with temperature drift, the signals at the terminal and the transmitter have the timing offset  error .Therefore, ⃗   receives  error samples from the next OFDM signal transmitted actually.As only  −  error sampling points are originally used for the OFDM signal, the actual   () is  , error () =   ()  2( error /) −  2 0 /  −=0  ( + )  2((−)/)

Figure 9 :
Figure 9: Timing offset estimation of ML estimator with different CP size.

Figure 11 :
Figure 11: Timing offset estimation provided by three methods.

Figure 12 :
Figure 12: Frequency offset estimation of ML estimator with different CP size.

Figure 13 :
Figure 13: Block Diagram of fine frequency synchronization module.

Figure 16 :
Figure 16: Closed-loop structure to track residual frequency offset.

Figure 17 :
Figure 17: BER performance provided by loop filter gain coefficients.

Figure 18 :
Figure 18: Residual frequency offset provided by loop filter gain coefficients.

Figure 19 :
Figure 19: BER performance comparison between simulation and theoretical value without frequency offset.

Figure 20 :
Figure 20: BER performance comparison between simulation and theoretical value with static frequency offset (ideal channel estimation).

Figure 21 :
Figure 21: BER performance comparison between simulation and theoretical value with static frequency offset (practical channel estimation).

Table 1 :
System parameters for WRAN.Frequency range allocated to the television broadcasting service in various parts of the world. a

Table 2 :
OFDM parameters for the three channel bandwidths.

Table 2 .
Channels with different bandwidths share the same parameters.The subcarrier spacing Δ is dependent on the bandwidth of the channel (6 MHz, 7 MHz, or 8 MHz).The cyclic prefix duration  cp could be one of the following derived values:  FFT /32,  FFT /16,  FFT /8, and  FFT /4.

Table 3 :
Impacts of different synchronization offsets on the system performance.
According to the WRAN downlink signal processing flow, the signals need to be processed in the following modules after going through the 5.1.Module Implementation.