Design and implementation in USRP of a preamble-based synchronizer for OFDM systems
Authors, José Herrera-Bustamante, Vanessa Rodríguez-Ludeña, A.G. Correa-Mena, Diego Barragán-Guerrero
DDesign and implementation in USRP of apreamble-based synchronizer for OFDM systems
José Herrera-Bustamante, Vanessa Rodríguez-Ludeña, A.G. Correa-Mena and Diego Barragán-Guerrero
Departamento de Ciencias de la Computación y Electrónica (DCCE), Universidad Técnica Particular de Loja-EcuadorEmail: [email protected], [email protected], [email protected], [email protected]
Abstract —The Orthogonal Frequency Division Multiplexing(OFDM) is one of the most widely adopted schemes in wirelesstechnologies such as Wi-Fi and LTE due to its high transmissionrates, and the robustness against Intersymbol Interference (ISI).However, OFDM is highly sensitive to synchronism errors, whichaffects the orthogonality of the carriers. We analyzed several syn-chronization algorithms based on the correlation of the preamblesymbols through the implementation in Software-Defined Radio(SDR) using the Universal Software Radio Peripheral (USRP).Such an implementation was performed in three stages: framedetection, comparing the autocorrelation output and the averagepower of the received signal; time synchronism, where the cross-correlation based on the short and long preamble symbols wasimplemented; and the frequency synchronism, where the CarrierFrequency Offset (CFO) added by the channel was detected andcorrected. The synchronizer performance was verified throughthe USRP implementation. The results serve as a practicalguide to selecting the optimal synchronism scheme and showthe versatility of the USRP to implement digital communicationsystems efficiently.
Keywords —OFDM, synchronization, USRP, SDR, IEEE802.11.
I. I
NTRODUCTION
The Orthogonal Frequency Division Multiplexing (OFDM)technique is one of the most common modulation schemescharacterized by dividing the available wireless channel band-width into several orthogonal subcarriers [1]. OFDM alsoprovides low Intersymbol Interference (ISI) [2], efficient useof the spectrum, and a simpler equalization. Thus, OFDMguarantees robustness communication in both Additive WhiteGaussian Noise (AWGN) channels and multi-path Rayleighchannels. Due to these characteristics, OFDM has beenadopted in the physical layer of the IEEE 802.11 standardand its amendments. However, a precise synchronism must beachieved to maintain the mentioned characteristics.Synchronism is a crucial step to receive transmitted in-formation correctly. In an OFDM system, it is divided intothree stages: frame detection, time synchronism, and frequencysynchronization. The frame detection is carried out by com-paring the autocorrelation of the received signal against itsaverage power; the time synchronism determines the beginningof the information in the frame through cross-correlation of thereceived signal with a training sequence (i.e., short and longpreamble symbols); and, finally, the frequency synchronismis used to align the frequency between the carriers of thereceiver (RX) and the transmitter (TX), reducing the Inter-Carrier Interference (ICI). The last stage detects the phase of the received signal through a correlation-based scheme, wherethat phase is used to correct the Carrier Frequency Offset(CFO) introduced by the wireless channel [3].In that regard, we implemented an effective synchronism so-lution for multi-carrier communication systems in a SoftwareDefined Radio (SDR) platform, i.e., the Universal SoftwareRadio Peripheral (USRP) [4]. In particular, we investigated theperformance of the preamble-aided synchronization algorithmsin an SDR environment, using GNU Radio. Together withthe Ettus USRP N210 equipment capabilities, GNU Radiobecomes a robust platform to simulate, test, and improvecommunication systems’ critical stages.This paper is organized as follows. In Section II aresummarized the main characteristics of the OFDM technique,as well as, the particularities of the IEEE 802.11a preambleand the channel model. In sections III, IV, and V the threestages to perform the preamble-based synchronizer design aredescribed: frame detection, time synchronism, and frequencysynchronism, respectively. In Section VI, the results and dis-cussion of the performance of the synchronization algorithms,in terms of the variance, are shown. Finally, in Section VIIthe conclusions are presented.II. S
ETTING THE ENVIRONMENT
A. Preamble-aided synchronization: the IEEE 802.11 stan-dard
In a multi-carrier communication system, the synchroniza-tion stage is usually carried out through the correlation of thepreamble symbols. Such a scheme is known as preamble-aidedsynchronization. Some IEEE 802.11 standards have adopteda deterministic preamble to facilitate packet synchronization.Throughout this paper, we use the well-known IEEE 802.11apreamble sequence to simulate and implement the algorithmsin the USRP.The IEEE 802.11a standard and its amends are used inWireless Local Areas Networks (WLANs), which supportspeeds up to 54 Mbps, and employ OFDM as the modulationtechnique due to its optimum performance in highly dispersivechannels. Moreover, it uses 52 subcarriers out of 64 availableto deal with the adjacent channel interference (ACI), 48 ofthem convey user data, 4 are pilot tones for phase tracking,and the remaining 12 are null tones [5]. (cid:13) a r X i v : . [ ee ss . SP ] A ug . Preamble and channel model As shown in Fig. 1, the OFDM preamble sequence iscomposed of two sets of short and long symbols. The tenshort symbols, consisting of 16 complex samples, are knownas the Short Training Sequence (STS). The two long symbols,composed of 64 complex samples, represent the Long TrainingSequence (LTS) [6]. Usually, the STS is used in framedetection and the LTS in time and frequency synchronism.Between the STS and LTS are added 32 Cyclic Prefix (CP)samples, reaching 320 samples in the full-frame. The OFDMscheme, aided with this preamble, reduces the ISI effect andmakes the system robust against the multipath fading.In Fig. 2 the procedure to generate the IEEE 802.11a pream-ble is shown. The preamble construction method detailed in[5] is used to generate a sequence in Python.The channel model scheme is shown in Fig. 3, where s ( t ) represents the transmitted signal, and r ( t ) is the receivedsignal affected by the channel noise and the frequency offset ∆ f . The so-called tapped-delay channel has been selected asthe channel model for this work, in particular, the A andC versions of the European Telecommunications StandardsInstitute (ETSI) channel models [7]. These models include themultipath fading behavior, frequency deviation, and AWGNchannel. For simulation purposes, we added the frequencyoffset by multiplying the transmitted signal by a complexexponential, where the value of each offset represents theoptimal ( ∆ f = 0 kHz), moderate ( ∆ f = 100 kHz) and severe( ∆ f = 200 kHz) conditions. C. GNU Radio blocks and system setup
All synchronism stages were designed using Python andembedded into a custom block denominated Out-Of-Tree(OOT) module inside the GNU Radio Companion (GRC)interface. Each OOT block, created through the gr_modtool performs dedicated processing on the received preamble. The
Vector Source provides the values obtained in the preamblegeneration to be transmitted and the
WX GUI Scope Sink graphically shows the response over time of each detector.Frame Detector detects the presence of the package. Itsimplementation is based on Fig. 4. Time synchronism based onSTS and LTS symbols is implemented according to schemesshown in Fig. 5a and Fig. 5b, respectively. CFO Detectorestimates and compensates the magnitude of CFO introducedby the channel. Such detection is based on Fig. 6. In all theschemes, the Cascaded Integrator–Comb (CIC) works as a
Fig. 1. OFDM preamble sequence compose of STS and LTS symbols, usedbefore data frame.
Index of subcarriers
STS
IFFTIndex of subcarriers
LTS
IDFT
STS → IDFT
STS
IDFT
STS
IDFT
STS (1:32)
IDFT
LTS
IDFT
LTS CP * IFFT
STS CP LTS symbol
IDFT
LTS → IDFT
LTS (33:64) → CP Fig. 2. IEEE 802.11a preamble generation scheme.
100 kHz200 kHz s(t) r(t) +x AWGN f j t e f Fig. 3. AWGN channel model including CFO. moving average filter. In this paper, the implemented algo-rithms are based on the correlation of the preamble symbols.For test purposes, only LTS and STS were sent between TXand RX; thus, the preamble is transmitted repeatedly from oneUSRP to another, running the implemented algorithms in eachtransmission.All synchronization algorithms were implemented in atransceiver system mounted on two PCs with Ubuntu 14.04 op-erating system, and its Gigabit Ethernet ports were connectedto USRP N210 modules. WSS016 omnidirectional antennaswere used for the radio interface. A 900 MHz frequency carrierwas set up, a transmitter gain of 30 dB, a sampling frequencyof 20 MHz, and BPSK signaling as the digital modulationscheme.
Autocorrelation R [ n ] CIC Filter | · | ² ˃ x (·)² CIC Filter
Power P [ n ] Accumulator CIC Filter
Detection r [ n ] Fig. 4. Frame Detection algorithm scheme. eros: 304 IDFT
STS (1:16) STS Position n xc-max Window (152:168)
Cross Correlation Ʌ[ n ] r [ n ] (a) Zeros: 256 IDFT
LTS
LTS Position n xc-max Window (
Cross Correlation Ʌ[ n ] r [ n ] (b)Fig. 5. Time Synchronization algorithm schemes for: (a) STS and (b) LTS. e − j f t f = nT s CIC Filter Synchronized Preamble s [ n ] Autocorrelation R [ n ] r [ n ] r [ n ] arg ( R [ n ]) x Fig. 6. CFO Detection algorithm scheme with preamble synchronization.
III. F
RAME DETECTION
Frame detection informs the presence or absence of a frame(user information) at the receiver. The frame detection methodimplemented in this work is based on the Schmidl and Coxalgorithm [8], where the received signal r n is correlated withits delayed conjugate version r ∗ n . The delay length (in samples)is equal to a short symbol duration. Thus, the correlation isdenoted by: R [ n ] = L − (cid:88) m =0 (cid:0) r n + m r ∗ n + m + L (cid:1) , (1)where L represents the delay (16 samples, corresponding to ashort symbol length).A frame is detected if the ratio M [ n ] between the square ofthe absolute value of R [ n ] and the signal power P [ n ] reachesa threshold. These parameters are defined as follows: P [ n ] = L − (cid:88) m =0 | r n + m + L | , (2) M [ n ] = | R [ n ] | P [ n ] > threshold. (3)According to (1), the correlation output R [ n ] is a complexparameter. To compute its modulus we have applied an ap-proximation where | R [ n ] | is calculated by: | R [ n ] | ≈ |R { R [ n ] }| + |I { R [ n ] }| , (4) where R {·} and
I {·} denote the real and imaginary part ofa complex number, respectively. In [9][10], it has shown thatan optimal threshold for frame detection is equal to the powerof the received signal divided by two. Rewriting equation (3),we have: | R [ n ] | > . P [ n ] . (5)Such a simplification has an additional advantage becausea division by two is straightforwardly implemented as ashift register, optimizing the hardware resources and reducingprocessing latency.The frame detection scheme, based on (5), is shown inFig. 4. The preamble length is 320 complex values, whichis equivalent to a signal period of 16 µs . As shown in Fig.7a, the ratio between the absolute value of the correlation andthe received power, indicates the presence of the frame at thereceiver. Fig. 7b shows the output of (5). Given that we sentseveral times the preamble through the channel, it is obtaineda pulse train (see Fig. 8), which indicates the frames detectedand the effectiveness of the implemented algorithm.IV. T IME SYNCHRONISM
Time synchronism is defined as the detection of the sampleposition where the frame or user information begins [11]. Likeframe detection, this synchronism can be carried out by takingadvantage of the preamble structure.The implemented algorithm is based on the cross-correlation, and it is mathematically expressed as: Λ[ n ] = L − (cid:88) m =0 ( c ∗ m r n + m ) , (6)where c ∗ m is the complex conjugate of the preamble samplesand the cross-correlator inputs are the samples of the receivedsignal r n . Such a cross-correlator needs L complex multi-plications to compute each output value, representing a highcomputational cost. However, this cost is compensated due to Autocorrelation _ Power + Threshold
Sample A m p li t ud e | R [ n ] | ( P [ n ])
0 50 100 150 200 250 300 (a)
Detection Detection + samples accumulator Sample
0 50 100 150 200 250 300 A m p li t ud e (b)Fig. 7. (a) Autocorrelation waveform | R [ n ] | and signal power P [ n ] (b)Frame detected M [ n ] > threshold. .0 0.2 0.4 0.6 0.8 1.0 Time (µs)
0 5 10 15 20 25 30 35 40 C o un t s Scope Plot
Fig. 8. Frame detection output pulse on each signal received. the results show that this detection is more precise than theautocorrelation algorithms.The position n xc max of the maximum value of | Λ[ n ] | ,which provides the beginning of the user information, isdefined as [12]: n xc max = arg max ( | Λ[ n ] | ) . (7)The time synchronism schemes that process the STS andLTS samples were implemented according to Fig. 5a and Fig.5b, respectively. In severe channel conditions, synchronizationbased on LTS is preferred because its output has a greatermagnitude. Also, with STS, ten peaks have to be detected.Instead, with the LTS, only two peaks need to be identified,which implies a reduction in the algorithm’s computationalload.The IEEE802.11a standard specifies that the autocorrelationpeaks must be located at the sample number 160 for the STSand 320 for LTS. However, due to the channel noise andthe propagation delay, a random displacement of the positionof the symbol is expected. For this reason, equation (7) isperformed within a window that is equal in size to the numberof symbol samples.The results obtained after the implementation of the STSand LTS detectors are shown in Fig. 9. To obtain a correctcorrelation, zero inputs values at the beginning of each symbol(to complete the 320 signal samples) were added. Ten peakscorresponding to the STS symbols are shown in Fig. 9a; whilein 9b appears two peaks of the LTS symbols and the third oneof smaller magnitude. The last peak is located at the endingposition of the CP, and it is formed with the first 32 LTSsamples.V. CFO DETECTOR AND F REQUENCY SYNCHRONISM
The main objectives of the frequency synchronism are todetect and compensate for the CFO ∆ f and the carrier phaseerror φ . The ICI causes both impairments as a consequenceof the Doppler effect, whose impact results in loss of orthog-onality between subcarriers [13].The Doppler effect, caused by the relative movement be-tween transmitter and receiver, provokes a signal variation intime and frequency domains [14]. Thus, the frequency shiftbetween the transmitted and received signal is computed by: ∆ f = φ πnT s , (8)where T s is the sample time and φ = 2 πn ∆ f . -0.03 -0.02 -0.01 0 Time (µs)
400 450 500 550 600 650 700 750 C o un t s Scope Plot (a) -2 -1 0 1
Time (µs)
60 65 70 75 80 85 90 95 C o un t s Scope Plot (b)Fig. 9. Time synchronization scheme output with (a) STS and (b) LTS.
When passing through the channel, the signal is affected bythe ∆ f frequency offset. Therefore, the information reachesthe receiver with a different carrier frequency (i.e., ∆ f = f tx − f rx ). The diagram used in this stage is shown in Fig. 6. Forsimplicity, the effect of additive white Gaussian noise was nottaken into account.To implement the CFO detector, the received signal r n from(1) is replaced by the product between the discrete trainingsequence and a complex exponential with phase equal to ∆ f .Hence, we obtain a simplified autocorrelation R [ n ] defined as: R [ n ] = exp( − j π ∆ f LT s ) L − (cid:88) m =0 ( s n + m s ∗ n + m + L ) , (9)where s n is a short symbol and s ∗ n is the complex conjugate.The phase of the autocorrelation R [ n ] is proportional to thephase offset φ introduced by the channel, i.e. φ ≈ arg( R [ n ]) .It allows finding the value of the CFO ∆ f through: ∆ f = arg( R [ n ])2 πLT s , (10)where L = 16 . Once the value of ∆ f is known, to compensatethe frequency offset, the received signal is multiplied by acomplex exponential with phase equal to − ∆ f as s n = r n exp( − j π ∆ f nT s ) . (11)If ∆ f is similar to the frequency offset, the phase differenceis compensated and the frame can be considered synchronized.Fig. 10 shows the autocorrelation output used for theCFO detection. These waveforms change depending on theseparation between the TX and the RX. Thus, in Fig. 10a andFig. 10b the distance was 0.3 m and 6 m, respectively. Time (µs)
5 10 15 20 25 30 35 40 45 C o un t s Scope Plot (a) -0.006
Time (µs)
5 10 15 20 25 30 35 40 45 C o un t s Scope Plot (b)Fig. 10. Autocorrelation output used for the CFO detection at: (a) 0.3 m and(b) 6 m of distance between the USRPs.
VI. R
ESULTS AND DISCUSSION
Considering the frame detection scheme of Fig. 4, the trans-mitted continuous signal containing the preamble sequencewas successfully detected in each transmission. The resultingwaveform is an active signal (plateau-shaped) when at leasttwo successive short symbols are correlated (32 first samples).Each OFDM preamble was transmitted under slightly differ-ent channel conditions. Thus, it will result in different detectedvalues for the time and frequency offset. The variance σ of thedetected values x i is the metric used to assess the performanceof the time and frequency synchronization algorithms. Analgorithm whose variance is the smallest is more efficient. Thisvariance is computed by: σ = N (cid:80) i =1 ( x i − ¯ x ) N , (12)where ¯ x is the sample mean and N is the number of trials.The obtained histograms for the STS and LTS synchronizersare shown in Fig. 11a and Fig. 11b, respectively, whichindicates an optimal performance of the implemented schemes,since they have a prominent value close to sample numbers160 (STS) and 320 (LTS), as it is expected. The variance ofthe detected positions in this algorithm was computed and itsresult is shown in Table I.According to Table I, the cross-correlation scheme usingSTS obtains a lower variance, making this scheme the mostaccurate algorithm. However, it is worth noting that in Fig. 9b,the peak amplitude generated with the LTS cross-correlation isgreater than the magnitude of the peaks with STS. In this way,the LTS cross-correlation output would be useful in severechannel conditions. Sample N u m b er o f s a m p l e s
200 150 100 50 0 154 156 158 160 162 164 166 (a)
Sample N u m b er o f s a m p l e s
250 150 100 50 0 290 300 310 320 330 340 350 200 (b)Fig. 11. Histogram of the synchronizer output using (a) STS symbols and(b) LTS symbols. TABLE IVARIANCE OF TIME SYNCHRONIZATION ALGORITHMS
Algorithms Trials (N) σ Cross-correlation STS 300 6.589Cross-correlation LTS 300 45.040
We performed two tests to evaluate the performance ofthe implemented CFO detector. In the first test, the USRPswere 0.30 m apart while in the second test, the USRPs wereseparated 6 m. In Fig. 12 the histograms of the CFO valuesdetected with these two distances between the transmitter andthe receiver are shown. We computed the variance of thedetected frequency offset resulting in the numerical outcomesshown in Table II. As expected, the implemented algorithmdetects a higher CFO at a distance of 6 m, with a prominentvalue of 30 kHz, which is then compensated using the schemeshown in Fig. 6. VII. C
ONCLUSIONS
In this paper, a preamble-based synchronizer implementedin USRP for OFDM is reported. The OFDM synchronism isdivided into three stages: the packet or frame detection, timesynchronism, and frequency offset detection and correction. Inframe detection, the autocorrelation amplitude’s modulus wascompared against the average power of the signal multiplied Δ f [kHz] N u m b er o f s a m p l e s
250 150 100 50 0 0 2 4 6 8 10 12 14 200 (a) Δ f [kHz] N u m b er o f s a m p l e s
25 15 10 5 0 28 30 32 34 36 38 40 20 (b)Fig. 12. Histogram of the CFO values detected at: (a) 0.3 m and (b) 6 m ofdistance between the USRPs.ABLE IIVARIANCE OF THE FREQUENCY SYNCHRONIZATIONALGORITHM
Algorithm Distance TX-RX (m) Trials (N) σ CFO detector 0.3 300 2.200CFO detector 6 300 9.161 by a threshold. When the autocorrelated signal’s modulus washigher than half of the average power in at least 32 samples(equivalent to two STS symbols), the result was a step-type (plateau-shaped) active signal indicating the successfuldetection in the receiver of a transmitted frame.In time synchronism, the wireless channel noise causeda variation in the positions of the peaks of STS and LTScorrelation, as expected. Based on the results, cross-correlationwith STS yields a more accurate synchronism. Besides, it isrecommended to use in severe channel environments the cross-correlation scheme with the LTS.According to the practical experiments, the CFO detectedwith the implemented scheme is proportional to the separa-tion between the transmitter and receiver. At 0.3 m distancebetween the USRPs, the frequency offset was close to 0 kHz.As the distance between the USRPs raised, the CFO valueswere increased with each performed test. With a separationof 6 m in an indoor environment, an average of 32 kHz offrequency offset was detected.The implemented synchronization algorithms offer promis-ing results over the AWGN channel for an OFDM system,where it was shown to be suitable for preamble-based detec-tors. Finally, extending the proposed implementation to other802.11 amends would be of interest for future research.R
EFERENCES [1] M. M. Boter, “Design and Implementation of an OFDM-based Communication System for the GNURadio Plat-form,” Master’s Thesis, Institut für Kommunikation-snetze und Rechnersysteme, Universität Stuttgart, Dec.2009.[2] C. El Hajjar, “Synchronization Algorithms for OFDMSystems (IEEE802.11a, DVB-T): Analysis, Simula-tion, Optimization and Implementation Aspects.” Ph.D.dissertation, Friedrich-Alexander-Universitat Erlangen-Nurnberg, 2007.[3] S. Wensheng and Z. Yuanyuan, “A frame synchronizationand symbol timing synchronization algorithm in burst OFDM communication based on IEEE802.11a,” in , vol. 1, 2009, pp.190–193.[4] A. L. G. Reis, A. F. B. Selva, K. G. Lenzi, S. E. Barbin,and L. G. P. Meloni, “Software defined radio on digitalcommunications: A new teaching tool,” in
IEEE WirelessMicrowave Technology Conf. , Apr. 2012, pp. 1–8.[5] LAN/MAN Standards Committee, IEEE-SA StandardsBoard, Institute of Electrical and Electronics Engineers,and IEEE-SA Standards Board,
Supplement to IEEEStandard for Information Technology – High-Speed Phys-ical Layer in the 5 GHz Band . IEEE, 1999.[6] L. Zhou and M. Saito, “A new symbol timing synchro-nization for OFDM based WLANs,” in
IEEE 15th Int.Symp. on Personal, Indoor and Mobile Radio Comm. ,vol. 2, 2004, pp. 1210–1214 Vol.2.[7] J. Medbo and P. Schramm, “Channel Models for HIPER-LAN/2 in Different Indoor Scenarios,” in
The 13th IEEEInt. Symp. on Personal, Indoor and Mobile Radio Com-munications, 2002. , vol. 1. IEEE, Mar. 1998, pp. 125–129.[8] T. M. Schmidl and D. C. Cox, “Robust frequency andtiming synchronization for OFDM,”
IEEE Trans. onComm. , vol. 45, no. 12, pp. 1613–1621, Dec. 1997.[9] M. J. Canet, F. Vicedo, V. Almenar, J. Valls, and E. R. D.Lima, “A common FPGA based synchronizer architec-ture for Hiperlan/2 and IEEE 802.11a WLAN systems,”in
IEEE 15th Int. Symp. on Personal, Indoor and MobileRadio Comm. , vol. 1, Sep. 2004, pp. 531–535 Vol.1.[10] K. Yip, T. Ng, and Y. Wu, “Impacts of multipath fadingon the timing synchronization of IEEE 802.11a wirelessLANs,” in
IEEE Int. Conf. on Commun. (ICC) , vol. 1,2002, pp. 517–521 vol.1.[11] D. Barragán and L. Meloni, “Implementação em FPGAde algoritmos de sincronismo temporal para OFDM,” in
XXXI Simposio Brasileiro de Telecomunicações , 2013.[12] J. Xie, Y. Ding, S. Yang, and L. Qi, “FPGA implemen-tation of frame synchronization and symbol timing syn-chronization based on OFDM system for IEEE 802.11a,”in
Int. Symp. on Intelligent Signal Processing and Comm.Systems , Dec. 2010, pp. 1–4.[13] T.-D. Chiueh and P.-Y. Tsai,
OFDM Baseband ReceiverDesign for Wireless Communications . Wiley Publishing,2007.[14] Y. S. Cho, J. Kim, W. Y. Yang, and C. G. Kang,