Timing-based location stimation for OFDM signals with applications in LTE, WLAN and WIMAX
Abstract
[ANGLÈS] Literature study of various preamble-based and non-preamble-based timing synchronization algorithms in OFDM - Implementation (in Matlab) of the following preamble-based algorithms: Schmidl, Minn, Park, Kim, Ren and Kang. Implementation (in Matlab) of Correlation-Based Timing Synchronization and MUltiple SIgnal Classification estimators. Comparison of various timing estimation algorithms in single path (static) and multipath (fading) channels.
Full text
VICTOR JUAREZ-LERIA TIMING-BASED LOCATION ESTIMATION FOR OFDM SIGNALS WITH APPLICATIONS IN LTE, WLAN AND WIMAX Master of Science Thesis Examiners: Docent, Dr. Elena-Simona Lohan Elina Laitinen Examiners and topic approved by the Faculty Council on 8 th February 2012
i Abstract TAMPERE UNIVERSITY OF TECHNOLOGY Erasmus Programme JUAREZ-LERIA, VICTOR: Timing-Based Location Estimation for OFDM Signals with Applications in LTE, WLAN and WiMAX Master of Science Thesis, 60 pages, 5 Appendix pages March 2012 Examiner: Elena-Simona Lohan and Elina Laitinen Keywords: Orthogonal Frequency Division Multiplexing, preamble, synchronization. Orthogonal Frequency Division Multiplexing (OFDM) has gained importance in recent years and it is the technique selected for wireless systems, such as Long-Term Evolution (LTE) for 4G communications systems, Wireless Local Area Networks (WLAN) or WiMAX TM . For this reason, OFDM systems have been under study in order to develop more accurate mobile stations positioning, both in outdoors and indoors environments. Nevertheless, OFDM systems require high timing synchronization accuracy in order to be able to receive the signal correctly, which makes timing synchronization estimation a key issue in OFDM receivers. Propagation is especially complicated over wireless channels, where the presence of multipath propagation, high level of interference signals or the obstruction of Line Of Sight (LOS) path make timing estimation even more difficult in indoor environments. The research results presented in this thesis focus on the study of different coarse positioning techniques for wireless networks using OFDM signals, for various static single path channels and fading multipath channels. The methods under study are based on timing synchronization algorithms and various preambles embedded in the OFDM signal. Also Correlation-Based Timing Synchronization estimators (CBTS) and Multiple Signal Classification (MUSIC) approaches are investigated. The performance of the studied estimation algorithms is analyzed in terms of Root Mean Square Error (RMSE), obtained from computer simulation results and the aim is to provide a detailed comparison of various OFDM preamble-based timing estimators.
ii Table of Contents ABSTRACT ...................................................................................................................................................... I TABLE OF CONTENTS ............................................................................................................................... II LIST OF SYMBOLS ..................................................................................................................................... IV LIST OF ACRONYMS ................................................................................................................................. VI 1 INTRODUCTION .................................................................................................................................. 1 1.1 B ACKGROUND .................................................................................................................................. 1 1.2 T HESIS O BJECTIVE AND C ONTRIBUTIONS ......................................................................................... 2 1.3 T HESIS O RGANIZATION ..................................................................................................................... 3 2 THE OFDM CONCEPT ........................................................................................................................ 4 2.1 L ONG T ERM E VOLUTION .................................................................................................................. 6 2.1.1 Physical channels ........................................................................................................................ 6 2.1.2 Modulation types ......................................................................................................................... 9 2.1.3 LTE Frame structure ................................................................................................................. 11 2.2 W IRELESS L OCAL A REA N ETWORKS .............................................................................................. 12 2.2.1 Modulation types ....................................................................................................................... 12 2.2.2 802.11n standard ....................................................................................................................... 12 2.2.3 802.11b/g standard .................................................................................................................... 13 2.3 W I MAX ......................................................................................................................................... 13 2.4 P OWER SPECTRAL DENSITY ............................................................................................................. 14 2.5 P ARAMETERS OF THE DIFFERENT SYSTEMS ..................................................................................... 17 3 LOCATION PRINCIPLES ................................................................................................................. 18 3.1 R ECEIVED S IGNAL S TRENGTH (RSS) .............................................................................................. 18 3.2 T IME O F A RRIVAL (TOA) ............................................................................................................... 19 3.3 T IME D IFFERENCE O F A RRIVAL (TDOA) ....................................................................................... 19 3.4 A NGLE O F A RRIVAL (AOA) ........................................................................................................... 20 4 TIMING ESTIMATION WITH OFDM............................................................................................. 22 4.1 C ORRELATION - BASED TIMING SYNCHRONIZATION ......................................................................... 22 4.2 P REAMBLE - BASED .......................................................................................................................... 22 4.2.1 Schmidl preamble ...................................................................................................................... 22 4.2.2 Minn metric ............................................................................................................................... 24 4.2.3 Park preamble ........................................................................................................................... 26 4.2.4 Kim preamble ............................................................................................................................ 27 4.2.5 Ren preamble ............................................................................................................................. 29 4.2.6 Kang preamble .......................................................................................................................... 30 4.3 M ULTIPLE SIGNAL CLASSIFICATION ................................................................................................ 32 5 SIMULATION MODEL ...................................................................................................................... 34
iii 6 SIMULATION RESULTS FOR TIMING ......................................................................................... 36 6.1 C OMPARISON FOR VARIOUS SNR VALUES ...................................................................................... 36 6.2 C OMPARISON FOR VARIOUS NUMBER OF SUB - CARRIERS ................................................................. 40 6.3 C OMPARISON FOR VARIOUS GUARD INTERVAL LENGTHS ................................................................ 44 6.4 C OMPARISON FOR VARIOUS OFDM SYMBOL TIMES ....................................................................... 45 7 CONCLUSIONS AND OPEN ISSUES ............................................................................................... 47 REFERENCES .............................................................................................................................................. 49 APPENDIX .................................................................................................................................................... 53
iv List of symbols a(h m ) Correction factor for h m b i i-th BS p-th complex data symbol of the k-th OFDM symbol n-th sample of Zadoff-Chu sequence ∆f Sub-carrier spacing ∆Θ Οrientation of the unknown mobile station ∆ PRS PRS sub-frames offset ∆ Normalized difference between the theoretical and real start of an OFDM Measurement uncertainty f c Carrier frequency Carrier frequency offset h(t) Channel impulsive response h b BS effective antenna height h m MS antenna height I PRS PRS configuration index N Number of subcarriers N cp Samples of the CP N PRS PRS sub-frames N FFT FFT length n(t) AWGN Θ i i-th relative AOAs of the sent signals from b i i-th BS position
v MS position r(t) Received signal s(t) Emitted signal n-th sample of the k-th emitted OFDM symbol. Useful length of an OFDM symbol CP time length T PRS PRS period Sampling time u Unknown MS Generic time measurement relative to reference point i
vi List of acronyms AOA Angle of Arrival AP Access Point ARQ Auto Repeat Request AWGN Additive White Gaussian Noise BS Base Station BPSK Binary Phase Shift Keying CAZAC Constant Amplitude Zero Auto-Correlation CBTS Correlation Based Timing Synchronization CP Cyclic Prefix CSP Correlation Sequence of the Preamble DC Direct Current DFT Discrete Fourier Transformation DwPTS Downlink Pilot Signal FDD Frequency Division Duplex GI Guard Interval GNSS Galileo Navigation Satellite System GP Guard Period GPS Global Positioning System ICI Inter-Carrier Interference IDFT Inverse Discrete Fourier Transformation IFFT Inverse Fast Fourier Transformation LTE Long Term Evolution
vii MBSDN Multimedia Broadcast over Single Frequency Network MS Mobile Station MUSIC Multiple Signal Classification NLOS Non Line Of Sight OFDM Orthogonal Frequency Division Multiplexing PN Pseudo Noise PRS Positioning Reference Signal PSD Power Spectral Density QAM Quadrature Amplitude Modulation QPSK Quadrature Phase Shift Keying RSS Received Signal Strength SC-FDMA Single Carrier – Frequency Division Multiplexing Access SNR Signal to Noise Ratio SoO Signals of Opportunity TDD Time Division Duplex TDOA Time Difference Of Arrival TOA Time Of Arrival UE User Equipment WLAN Wireless Local Area Networks WMAN Wireless Metropolitan Area Networks
1 1 Introduction 1.1 Background Wireless positioning for Mobile Stations (MS) has been steadily gaining importance during the last years. The MS accurate positioning needs have been increasing, both indoors and outdoors, in order to improve navigation, fraud detection, automatic bills, e-marketing and other location-based services and applications. In addition to these improvements, mobile net functionalities such as handovers could have a much better performance if accurate positioning information were available. For this reason, it is necessary to improve wireless positioning [1]. Nowadays, there is a good accuracy in wireless positioning, in good atmospheric conditions, by using the Global Navigation Satellite Systems (GNSS), such as Global Positioning System (GPS) or the Galileo system in Europe. The accuracy of these systems worsens with bad channel conditions, or even disappears in indoor locations. The reason is that they need at least four satellites with good enough signal strength reaching the receiver [2]. Moreover, frequency allocations suitable for GNSS services are getting crowded [3]. Another drawback about the current positioning system is the need to produce MS with extra antennas to communicate with the satellites at low carrier-to-noise ratios. Although there are higher sensitivity receivers and other improvements to reach better results, accuracy is highly lagging in the presence of interferences, multipath channel or the blockage of the buildings [4]. The so-called Signals of Opportunity (SoO), which means basically any available wireless signal initially not meant for positioning, could complement the GNSS services on the cases mentioned before. These opportunity signals are communication signals, such as broadcast signals for mobile phones, which can be used for positioning purposes although they were not designed with this in mind. The SoO classification is sometimes controversial, and some do not include cellular systems into SoO class, arguing that many cellular systems, such as Long Term Evolution (LTE), have already signals specifically optimized for positioning [3] [5] [6]. Orthogonal Frequency Division Multiplexing (OFDM) technique is under study to achieve better wireless positioning performance [3]. That is because OFDM has been chosen in many communication systems for its robustness in multipath channels and its high transmission rate in wireless communications networks. Although it has many
8 There are other interesting signals for positioning purposes, which are the synchronization signals. These signals are useful for the user terminal, especially to search for the cell and to synchronize with the BS. On one hand, the primary synchronization signal is generated by a Zadoff-Chu sequence, with ‘u’ 25, 29 or 34 depending on the cell we are, as defined in eq. (3). On the other hand, the secondary synchronization signal is formed by interleaved concatenation of binary sequences [22]. = K ) L M N * OP = 0 , 1 , … , 30 ) L M N * N U OP = 31 , 32 , … , 61 W (3) Fig 2-5Mapping of PRS (normal CP) [22] Fig 2-6 Mapping of PRS (extended CP) [22]
9 2.1.2 Modulation types Firstly, data streams are modulated with Binary Phase Shift Keying (BPSK), Quadrature Phase Shift Keying (QPSK), Quadrature Amplitude Modulation (16-QAM or 64-QAM) modulations on the physical layer. After that, OFDM modulating is done with 15 kHz as subcarrier spacing and 4.7 µ s as duration of the CP, using the normal mode, or 16.7 µ s using the extended mode, which is used in dispersive situations [23]. The modulations, used to generate the input data symbols ( from Fig 2-1), transform binary inputs (0 or 1) into complex data symbols formed as x = I + jQ. BPSK: a single bit is mapped as the following table shows: Table 2-2 BPSK mapping [22] I Q 0 1 / √ 2 1 / √ 2 1 − 1 / √ 2 − 1 / √ 2 QPSK: two consecutive bits are mapped as shown in Table 2-3: Table 2-3 QPSK mapping [22] I Q 00 1 / √ 2 1 / √ 2 01 1 / √ 2 − 1 / √ 2 10 − 1 / √ 2 1 / √ 2 11 − 1 / √ 2 − 1 / √ 2 16-QAM: four consecutive bits are mapped as follows: Table 2-4 16-QAM mapping [22] I Q I Q 0000 1 / √ 10 1 / √ 10 1000 − 1 / √ 10 1 / √ 10 0001 1 / √ 10 3 / √ 10 1001 − 1 / √ 10 3 / √ 10 0010 3 / √ 10 1 / √ 10 1010 − 3 / √ 10 1 / √ 10 0011 3 / √ 10 3 / √ 10 1011 − 3 / √ 10 3 / √ 10 0100 1 / √ 10 − 1 / √ 10 1100 − 1 / √ 10 − 1 / √ 10 0101 1 / √ 10 − 3 / √ 10 1101 − 1 / √ 10 − 3 / √ 10 0110 3 / √ 10 − 1 / √ 10 1110 − 3 / √ 10 − 1 / √ 10 0111 3 / √ 10 − 3 / √ 10 1111 − 3 / √ 10 − 3 / √ 10
10 64-QAM: six consecutive bits are mapped as: Table 2-5 64-QAM mapping [22] I Q I Q 000000 3 / √ 42 3 / √ 42 100000 − 3 / √ 42 3 / √ 42 000001 3 / √ 42 1 / √ 42 100001 − 3 / √ 42 1 / √ 42 000010 1 / √ 42 3 / √ 42 100010 − 1 / √ 42 3 / √ 42 000011 1 / √ 42 1 / √ 42 100011 − 1 / √ 42 1 / √ 42 000100 3 / √ 42 5 / √ 42 100100 − 3 / √ 42 5 / √ 42 000101 3 / √ 42 7 / √ 42 100101 − 3 / √ 42 7 / √ 42 000110 1 / √ 42 5 / √ 42 100110 − 1 / √ 42 5 / √ 42 000111 1 / √ 42 7 / √ 42 100111 − 1 / √ 42 7 / √ 42 001000 5 / √ 42 3 / √ 42 101000 − 5 / √ 42 3 / √ 42 001001 5 / √ 42 1 / √ 42 101001 − 5 / √ 42 1 / √ 42 001010 7 / √ 42 3 / √ 42 101010 − 7 / √ 42 3 / √ 42 001011 7 / √ 42 1 / √ 42 101011 − 7 / √ 42 1 / √ 42 001100 5 / √ 42 5 / √ 42 101100 − 5 / √ 42 5 / √ 42 001101 5 / √ 42 7 / √ 42 101101 − 5 / √ 42 7 / √ 42 001110 7 / √ 42 5 / √ 42 101110 − 7 / √ 42 5 / √ 42 001111 7 / √ 42 7 / √ 42 101111 − 7 / √ 42 7 / √ 42 010000 3 / √ 42 − 3 / √ 42 110000 − 3 / √ 42 − 3 / √ 42 010001 3 / √ 42 − 1 / √ 42 110001 − 3 / √ 42 − 1 / √ 42 010010 1 / √ 42 − 3 / √ 42 110010 − 1 / √ 42 − 3 / √ 42 010011 1 / √ 42 − 1 / √ 42 110011 − 1 / √ 42 − 1 / √ 42 010100 3 / √ 42 − 5 / √ 42 110100 − 3 / √ 42 − 5 / √ 42 010101 3 / √ 42 − 7 / √ 42 110101 − 3 / √ 42 − 7 / √ 42 010110 1 / √ 42 − 5 / √ 42 110110 − 1 / √ 42 − 5 / √ 42 010111 1 / √ 42 − 7 / √ 42 110111 − 1 / √ 42 − 7 / √ 42 011000 5 / √ 42 − 3 / √ 42 111000 − 5 / √ 42 − 3 / √ 42 011001 5 / √ 42 − 1 / √ 42 111001 − 5 / √ 42 − 1 / √ 42 011010 7 / √ 42 − 3 / √ 42 111010 − 7 / √ 42 − 3 / √ 42 011011 7 / √ 42 − 1 / √ 42 111011 − 7 / √ 42 − 1 / √ 42 011100 5 / √ 42 − 5 / √ 42 111100 − 5 / √ 42 − 5 / √ 42 011101 5 / √ 42 − 7 / √ 42 111101 − 5 / √ 42 − 7 / √ 42 011110 7 / √ 42 − 5 / √ 42 111110 − 7 / √ 42 − 5 / √ 42 011111 7 / √ 42 − 7 / √ 42 111111 − 7 / √ 42 − 7 / √ 42
11 2.1.3 LTE Frame structure The transmitted signal is organized in 1ms duration sub-frames, each one consisting of 14 or 12 OFDM symbols, depending on the CP used. As we can see on Fig 2-7, the frame is composed with ten sub-frames. Fig 2-7 LTE frames [19] LTE reaches an efficient utilization of resources. This happens due to the channel quality monitoring done by the scheduler every 1ms, both in time and frequency. For this reason, the scheduler is a key element of the downlink management; it is able to assign radio resources and transmission rates efficiently [19]. According to Fig 2-7, some differences exist while processing the physical layer - Working with Frequency Division Duplex (FDD): there are two carrier frequencies f UL and f DL which transmit simultaneously. - Working with Time Division Duplex (TDD): there is a unique carrier and the downlink and uplink transmissions are separate in time, providing flexibility to configure the uplink and the downlink. Sufficiently large guard periods are needed to be able to switch between transmission and reception mode without overlapping. For this reason, the special frames Downlink Pilot Signal (DwPTS), Guard Period (GP) and Uplink Pilot Signal (UpPTS) from Fig 2-7 are created [19]. The working bandwidth can be 1.4, 3, 5, 10, 15 or 20 MHz depending on the channel conditions (Fig 2-8), with a carrier frequency that can be allocated in many frequency bands. Fig 2-8 Bandwidth flexibility [19]
12 2.2 Wireless Local Area Networks Another system that uses OFDM technique is Wireless Local Area Networks (WLAN) or 802.11 family [20]. In what follows, we will focus on the most used systems nowadays, namely 802.11b/g and 802.11n. 2.2.1 Modulation types The modulations used, both in 802.11n and 802.11b/g, are BPSK, QPSK, 16-QAM and 64- QAM depending on the environmental conditions [26]. These modulations are explained in section 2.1.2. 2.2.2 802.11n standard This is the standard corresponding to multiple antenna transmission and it is widely spread nowadays. Firstly, the data streams are encoded through various steps, namely source and channel encoding, following by interleaving (see Fig 2-9). Secondly, these data streams are spatially mapped in order to obtain the complex data symbols. Said spatial mapper distributes the complex symbols among the transmitter antennas (N t in Fig 2-9). Before transmitting into the air, an N point IFFT is applied to each stream and the cyclic prefix (CP) is added to it. As in the LTE case, the CP is created by adding the last part of the symbol at the beginning of said symbol. In this case, the length of the CP is always N FFT /4 [26]. The system works with 64 sub-carriers at 20 MHz, using from -28 to -1 and +1 to +28 to transmit, and 128 sub-carriers at 40 MHz, using from -58 to -2 and +2 to +58 to transmit [26]. The other sub-carriers are used as guard intervals and pilots. Fig 2-9 802.11n transmitter [26]
13 2.2.3 802.11b/g standard This is a single-antenna WLAN standard that is also widely encountered in practice. The OFDM symbols are generated following the block diagram shown in Fig 2-10. In this case, the bandwidth can only be 20 MHz, using the same 64 sub-carriers distribution that 802.11n uses. OFDM signals are only used in 802.11g, which is backwards compatible with 802.11b because it can manage the previous system and the new one. Although 802.11b is still the most common among the two, we are not going to focus on it because it does not use OFDM (but rather spread spectrum). Fig 2-10 802.11g transmitter [20] 2.3 WiMAX WiMAX belongs to the Wireless Metropolitan Area Networks (WMAN) aiming at coverage radius of few tens of Km. It is described in the 802.16 standardization documents [18]. The physical layer of this protocol is based on an OFDM modulation and designed to work with NLOS paths, in the 10-66 GHz band with a great flexibility to optimize the service according to cell planning, cost, capacity, etc. BPSK modulation is used in the preamble of the downlink (Fig 2-11), but data symbols can use BPSK, QPSK, 16-QAM or 64-QAM. Fig 2-11 DL frame structure [17]
14 As Fig 2-12 shows, the preambles are formed by one or two OFDM symbols with a CP before each of them. The first symbol uses sub-carriers that are multiples of 4, so in time domain there are four repetitions of fragments with a length of 64 samples. The second symbol uses the even sub-carriers, which results in two repetitions of 128 sample fragments in time domain [18]. Fig 2-12 IEEE 802.16 DL preamble structure [18] 2.4 Power spectral density The Power Spectral Density (PSD) of the LTE signal is the Fourier transform of the signal autocorrelation function. The PSD of an OFDM signal depends on the characteristics of four signal operations performed at the transmitter side: the Inverse Discrete Fourier Transform (IDFT) modulation, the insertion of the (CP or ZP) time guard interval, the pulse shaping, and the interpolation filtering [24]. An analytical expression of OFDM signal has been derived in [24] and is given below: ] = | _ ` a | U b c d e 1 2 U + 2 cos f 2 % ∆ g d e 1 2 d e 1 − 2 h ) * + ( U ( ) * + , i (4) Where • n denotes discrete time index. • N is the number of sub-carriers. • M is the symbol length. • g P [n] denotes the n-th sample of the pulse shaping window. • T s denotes sampling interval employed in the OFDM transmitter. • _`U denotes the variance of the data symbols. • ∆ f is the subcarrier defined as 1/(NT s ). • G i (f) represents the frequency spectrum of the pulse shape. For rectangular pulse shapes, the PSD reduces to: ] j = _ ` U b / -k l − ∆ b m 0 U ( ) * + , (5) An equivalent definition from [25] is shown in (6).
15 ] = n o p − q ∆ o U ( U r + ) ( U r , q = ± 1 , ± 2 , … , ± 2 (6) where: - R s is the symbol rate 1/T b . - W(f) is the Fourier transform of the time-window function from (7). p = -k cos % tu 1 − 4 tu U U ) LM t v (7) - T TR is the transition time An LTE theoretical spectrum is shown in Fig 2-13 and the simulated version is shown in Fig 2-14. Fig 2-13 Theoretical PSD example, IEEE 802.11 a −20 −10 0 10 20 0 10 20 30 40 Theoretical PSD example, IEEE 802.11 a Frequency [MHz]
16 Fig 2-14 Simulated PSD example, LTE 0 1 2 3 4 x 104 0 200 400 600 800 1000 1200 Frequency sample PSD
17 2.5 Parameters of the different systems The parameters from the different wireless systems using OFDM are shown in Table 2-6. In here we focus on physical layer parameters. Table 2-6 OFDM system parameters LTE WLAN WiMAX [17] 802.11n 802.1(b)/g Carrier frequencies [MHz] Finland: 800 MHz [27] Spain: 800MHz/2.6GHz [17] 2.4/5 GHz 2.4 GHz 10 - 66 GHz FFT lengths 128 - 2048 64 - 128 64 256 Number of used sub-carriers 72 – 1200 [28] 56 - 114 52 200 Bandwidths 1.4, 3, 5, 10, 15 and 20 MHz 20, 40 MHz 20 MHz 20 MHz Guard interval lengths Normal CP (4.7 µ s) 160 for l = 0 N FFT /4 N FFT /4 N FFT /4, N FFT /8, N FFT /16, N FFT /32 144 for l = 1,2,…,6 Ext. CP (16.7 µ s) 512 for l = 0,1,…,5 1024 for l = 0,1,2 Presence of preambles for timing synchronization (yes/no) yes yes yes yes Modulation types BPSK QPSK 16QAM 64QAM BPSK QPSK 16QAM 64QAM BPSK QPSK 16QAM 64QAM Presence of pilot channels for synchronization Pos i tioning Reference signal (PRS) and Synchronization signals (primary and secondary) N/A N/A
24 Fig 4-1 Example of Schmidl metric for AWGN channel (SNR = 30 dB) Fig 4-2 Schmidl derivative function 4.2.2 Minn metric This method is based on a specifically designed training symbol that also has a repetitive structure, as Schmidl case, and, as a consequence, robust timing estimation can be obtained by correlating the repetitive parts. Minn proposed extra divisions of the preamble [39]. A modified preamble (20) is proposed to avoid the plateau uncertainty from Schmidl, where A is a pseudorandom complex sequence of length N/L, with L being a power of two, usually two or four but notice that larger values of L gives a timing metric trajectory with a −1.5 −1 −0.5 0 0.5 1 1.5 2 x 104 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Delay [m] Schmidl −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 x 104 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 Delay [m] Schmidl derivative
25 steeper roll off [39]. The signs of each part are designed to achieve the sharpest timing metric. Preamble h = ± A N L r ± A N L r ± A N L r …± A N L r (20) A new metric (21) is used in this method, where L is the number of preamble parts and each preamble part contains M samples. Moreover, the metric elements definition changes slightly in (22) and (23) compared to Schmidl metric. where M Minn d = L L - 1 2 | P h d | 2 E Minn d 2 (21) P Minn d = r * d + m· M + k · h ) * k = 0 L - 2 m = 0 r d + m + 1 M + k (22) E Minn d = | r d + k + m· M | 2 -1 m =0 M - 1 k =0 (23) and b(m) is p(m)·p(m+1), where p(m) denotes the sign of the repeated parts of the training symbol. One of the Minn’s preamble structures, balanced between complexity and accuracy, is defined in eq. (24), with L being four and M being N/4 [11]. As a result, M Minn , P Minn and E Minn are simplified in eq. (25), eq. (26) and eq. (27), respectively. This was the choice of our implementation as well. Preamble h = A N r A N r - A N r - A N 4 r (24) M Minn d = 4 3 2 | P h d | 2 E Minn d 2 (25) P Minn d = r * d + m· 4 + k · ( / ) * k=0 U m=0 r d + m + 1 · 4 + k (26)
26 E Minn d = r d + k + m· 4 2 3 m =0 N / 4 - 1 k =0 (27) The metric from eq. (25) is plotted in Fig 4-3 after sending an OFDM signal with Minn’s preamble over an AWGN channel. Fig 4-3 Example of Minn metric for AWGN channel (SNR = 30 dB) 4.2.3 Park preamble Park [12] realizes that between the peak value of the timing metric and the next value there is only a small difference due to metric values being almost the same around the correct starting point. Park method reduces the error of the estimation in ISI channels by using a new preamble structure defined in eq. (28), where A is a complex PN sequence, B is its symmetric sequence, and * denotes the conjugate operation. Preamble e = A N 4 r B N 4 r A * N 4 r B * N 4 r (28) Park’s method has the same advantages that Schmidl’s have because of using the same preamble structures, but making a metric even sharper than the algorithms from sections 4.2.1 and 4.2.2 [12]. This method uses the metric (29) to take advantage of the fact that A and B are symmetric, but using (30) and (31) definitions, giving a peak value at correct symbol timing position and almost zero at other position, as Fig 4-4 shows, because this preamble structure increases the difference between adjacent peak values. This happens −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 x 104 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Delay [m] Minn
27 because P park is designed to have N/2 different pairs of product between two adjacent values. Simulation results conclude that Park’s estimator is unbiased [12]. M Park d = | P Park d | 2 E Park d 2 (29) where P P ark (d) = r d - k ·r d + k N 2 k=0 (30) E P ark (d) = | r d + k | 2 N 2 k=0 (31) An example of Park metric for 30 dB SNR is shown in Fig 4-4. Fig 4-4 Example of Park metric for AWGN channel (SNR = 30 dB) 4.2.4 Kim preamble To increase the differences between the metric’s peak and the other values, Kim [13] proposes preamble (32), where A is a complex PN sequence, B is designed to be symmetric with A and * denotes the conjugate operation. −1 −0.5 0 0.5 1 1.5 2 2.5 3 x 104 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Delay [m] Park
28 ]< ¢ = A N 4 r B * N 4 r A N 4 r B * N 4 r (32) The metric is (33) in this case, and it is designed taking into account the fact that B * is symmetric and conjugate with A. M ¢ d = | P Kim d | 2 E Kim d 2 (33) where P Kim (d)= r d – k + N 2 r d + k + N 2 N 2-1 k=0 (34) and E Kim d = r d + k + N 2 2 N 2 -1 k=0 (35) By using P Kim definition from eq. (34), which has N/2 significantly different pairs of product between two adjacent values, the metric in Fig 4-5 has an impulse response shape with its maximum at correct symbol timing position. Fig 4-5 Example of Kim metric for AWGN channel (SNR = 30 dB) −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 x 104 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Delay [m] Kim
29 4.2.5 Ren preamble A new preamble (36) is defined to enlarge the difference between consecutive positions of the metric from eq. (37) [14]. This method uses a constant envelop preamble which consists of two Constant Amplitude Zero Auto-Correlation (CAZAC) sequences, of length N/2, multiplied with the Hadamard product by a real PN sequence of length N, whose values are +1 or -1. The real PN sequence is used to take advantage of the constant envelop preamble because it increases the difference M Ren (d) – M Ren (d+1) . The operator o indicates the Hadamard product, which is defined as element by element multiplications of two vectors. ]< u¤ = C N 2 r C N 2 r oS N (36) The working definitions for this method are given by (38) and (39), where s k is the k-th element of S N . M u¤ d = | P Kim d | 2 E Kim d 2 (37) P Ren (d)= s k s k+N2 r · r * d + k ·r d + k + N 2 N 2-1 k=0 (38) E R en d = 1 2 | r d + k | 2 N 2-1 k=0 (39) The metric in Fig 4-6, which is based on finding the highest correlation between two repeated sequences, has its peak at correct symbol timing position and much smaller values at incorrect positions due to the correlation property of S N weighted factors. Ren’s metric is robust to frequency offset as reported in [14].
30 Fig 4-6 Example of Ren metric for AWGN channel (SNR = 30 dB) 4.2.6 Kang preamble The performance of previous algorithms is directly related to the preamble structure, so they cannot be generalized to every OFDM system because each system specifications define their own preamble structures. Kang presented in [15] a timing synchronization method which is independent of the preamble A N . The new method consists of creating a new sequence, called correlation sequence of the preamble (CSP), which is defined in eq. (40), C ≜ A* o § `` , (40) where A * denotes the element by element conjugate of an arbitrary preamble A of length N, and A circ,a denotes the circular shift of A by an amount equal to a . The optimum shift value a can be found where the autocorrelation of C has an impulsive shape. Transposed vectors p T and q T are defined as the sign of the real part of C T and the sign of its imaginary part, respectively, as Fig 4-7 shows. Note that real and imaginary parts are calculated separately because computational complexity may be reduced. −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 x 104 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Delay [m] Ren
31 Fig 4-7 CSP, p and q block diagram [15] Once the shift value a has been found by calculating where the difference, between the peak of CSP autocorrelation and the mean value of it, is maximum (see Appendix), the CSP sequence is used during the estimation process to calculate the correlation between the received signal and the CSP sequence itself. The receiver is able to estimate correct timing point by finding the maximum of the metric from eq. (41). Said metric is shown in Fig 4-9 and it is defined by using eq. (42) and eq. (43). Vector V n is defined in eq. (44), where R (n,N) is the vector with the received signal samples [r(n), r(n+1), …, r(n+N-1)]. To summarize the whole metric definition, a block diagram is shown in Fig 4-8 M Kang d = o P Kang d o E Kang d (41) P Kang d ≜ Re ¨ © t + Im ¨ « t (42) E Kang d = ‖ n ¨ ‖ + ‖ n ¨ ‖ (43) V VV V n ≜ R RR R n , N * o R RR R n , N circ , a (44)
32 Fig 4-8 Block diagram of Kang metric [15] Fig 4-9 Example of Kang metric for AWGN channel (SNR = 30 dB) 4.3 Multiple signal classification Multiple Signal Classification (MUSIC) estimator is a super-resolution algorithm [40] that calculates a pseudo spectrum as in eq. (45), whose maximum gives the estimated delay of the signal. S MUSIC = 1 ∑ o q k H v( τ) o 2 ( -1 k=L p (45) −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 x 104 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Delay [m] Kang
33 where L p is the number of estimated multipath components from the channel model, N denotes the total number of equally spaced frequencies, q k is the k-th noise eigenvector (eigenvectors corresponding to N-L p smallest eigenvalues) of the covariance matrix of the received signal, the upper index H denotes the Hermitian operation, and v(τ k ) is defined by (46), where super index T denotes transpose operation and ∆f is the separation between sub-carriers. v τ k = l 1 e - j 2 π ∆ f τ k … e - j 2 π ( N - 1 ) ∆ f τ k m T (46) The pseudo spectrum block diagram and its graphic representation are shown in Fig 4-10 and Fig 4-11, respectively. Fig 4-10 Block diagram of MUSIC super-resolution algorithm [40] Fig 4-11 Example of MUSIC pseudo spectrum for AWGN channel (SNR = 30 dB) −20 −10 0 10 20 30 40 0 0.2 0.4 0.6 0.8 1 MUSIC pseudospectrum Delay [m]
40 6.2 Comparison for various number of sub-carriers Once the SNR is set up to 30 dB, system performance evaluation continues by comparing every algorithm for different FFT lengths. First of all, Fig 6-7 shows that none of the metrics are depending on the number of subcarriers used from the total of FFT subcarriers. Fig 6-7 Metrics comparison for different number of used subcarriers at 30 dB Once it is observed that there is no dependence with the number of used subcarriers, the algorithms performance is evaluated in terms of FFT length. Simulation results show that an OFDM system with CBTS estimator is independent of FFT length at good SNR, as Fig 6-8 shows us, whereas Fig 6-9 shows that MUSIC algorithm performance is much better when using preambles divided into two equal parts rather than the other preamble structures. That confirms our choice of Schmidl’s preamble. 500 600 700 800 900 1000 1100 0 5 10 15 20 25 30 Number of used sub−carriers RMSE (m) Schmidl Minn Park Kim Ren Kang CBTS Schmidl MUSIC Schmidl
41 Fig 6-8 CBTS comparison for different number of FFT subcarriers at 30 dB Fig 6-9 MUSIC comparison for different number of FFT subcarriers at 30 dB After these considerations, the simulator runs with every metric, including best CBTS and best MUSIC estimators, at SNR equal to 0 dB. Notice that oversampling factor is chosen equal to two only when using MUSIC algorithm. Simulation results in Fig 6-10 show that RMSE decreases with FFT length, which makes sense with theoretical previsions because RMSE definition has the FFT length in its denominator. 0 500 1000 1500 2000 2500 −1 −0.5 0 0.5 1 FFT length RMSE (m) CBTS Schmidl CBTS Minn CBTS Park CBTS Kim CBTS Ren CBTS Kang 0 200 400 600 800 1000 1200 0 50 100 150 200 250 300 350 FFT length RMSE (m) MUSIC Schmidl MUSIC Minn MUSIC Park MUSIC Kim MUSIC Ren MUSIC Kang
42 Fig 6-10 Metrics comparison over single path with SNR = 0 dB Because of Schmidl metric RMSE is so high, the zoomed in part from previous figure is shown in Fig 6-11, where CBTS, MUSIC and Ren algorithms are not dependent on FFT length. Fig 6-11 Zoom in of single path performance from Fig 6-10 Now the SNR is fixed at 30 dB and Fig 6-12 shows a comparison between best MUSIC estimator, CBTS estimator and each metric under study. We observe that MUSIC, CBTS and Ren algorithms are not depending on FFT length at highest SNR value. 0 200 400 600 800 1000 1200 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2x 104 FFT length RMSE (m) Schmidl Minn Park Kim Ren Kang CBTS Schmidl MUSIC Schmidl 0 100 200 300 400 500 600 700 800 900 1000 0 500 1000 1500 2000 FFT length RMSE (m) Schmidl Minn Park Kim Ren Kang CBTS Schmidl MUSIC Schmidl
43 Fig 6-12 Metrics comparison over single path with SNR = 30 dB Finally, Fig 6-13 shows the system performance when the signal travels across a Rayleigh fading multipath channel. Fig 6-13 Metrics comparison over Rayleigh fading multipath channel, with SNR = 30 dB The main difference between single path and multi path channel is that Kang is the algorithm with the best accuracy in multipath channels independently of FFT length at 0 200 400 600 800 1000 1200 0 100 200 300 400 500 600 700 800 FFT length RMSE (m) Schmidl Minn Park Kim Ren Kang CBTS Schmidl MUSIC Schmidl 0 200 400 600 800 1000 1200 0 2000 4000 6000 8000 10000 12000 FFT length RMSE (m) Schmidl Minn Park Kim Ren Kang CBTS Schmidl MUSIC Schmidl
44 good SNR, whereas CBTS, MUSIC and Ren are the best algorithms over single path channels because the three of them are robust to FFT length. The FFT length is set to 1024 for the following sections, because the metrics that are depending on it have better performance with higher number of subcarriers. 6.3 Comparison for various guard interval lengths This section evaluates the system simulator performance when the GI parameter is changed to 1/32, 1/16, 1/8 or 1/4 of the FFT length, according to parameters from section 2.5. To begin with, system performance in terms of GI length is evaluated in Fig 6-14 over a single path AWGN channel. None of the metrics under study are affected by the GI length. We can now say that MUSIC has better performance than Kim, Park and Kang algorithms because MUSIC algorithm is the only one that reaches zero meters error over single path from the best four algorithms mentioned in section 6.1. Fig 6-14 Metrics GI comparison over AWGN single path To continue with, an evaluation of the system over a Rayleigh fading multipath channel is done in Fig 6-15, which confirms that Kang is the best algorithm over multipath channel at high SNR, followed by MUSIC, Park and Kim as seen at the end of section 6.1. 0 0.05 0.1 0.15 0.2 0.25 0 5 10 15 20 25 30 Guard interval (% of FFT length) RMSE (m) Schmidl Minn Park Kim Ren Kang CBTS Schmidl MUSIC Schmidl
45 Fig 6-15 Metrics GI comparison over Rayleigh fading multipath channel The conclusion is that OFDM systems are not affected by the GI length. 6.4 Comparison for various OFDM symbol times In this section, FFT length and SNR are fixed to 1024 subcarriers and 30 dB, respectively, the GI is fixed to 1/4 of the FFT length because it is the length used in the three OFDM systems under study (LTE, WLAN and WiMAX). System performance evaluation continues by simulating for different OFDM symbol times in Fig 6-16 for single path AWGN channel. OFDM symbol time T b is the inverse of sub-carrier spacing (∆f), whose values are 7.5 kHz, 15 kHz and 60 kHz in these simulation results. Fig 6-16 Sub-carrier spacing comparison in single path channel with SNR = 30dB 0 0.05 0.1 0.15 0.2 0.25 0 100 200 300 400 500 600 700 800 Guard Interval (% of FFT length) RMSE (m) Schmidl Minn Park Kim Ren Kang CBTS Schmidl MUSIC Schmidl 0 1 2 3 4 5 6 x 104 0 10 20 30 40 50 60 70 Sub−carrier spacing (Hz) RMSE (m) Schmidl Minn Park Kim Ren Kang CBTS Schmidl MUSIC Schmidl
46 As theory predicted, it is observed that the performance of the estimators is better with bigger ∆f and, as a consequence, smaller OFDM symbol times. It makes sense because the error definition in eq. (47) has ∆f as a denominator. Despite of what theory predicted, Minn, Ren, CBTS and MUSIC algorithms are robust to ∆f in single path AWGN channels. Fig 6-17 shows simulation results for Rayleigh fading multipath channel, where we can observe that Kang is the best algorithm because it has the lowest RMSE and it is the only algorithms which is robust to ∆f. Fig 6-17 Sub-carrier spacing comparison over Rayleigh fading multipath channel with SNR = 30dB 0 1 2 3 4 5 6 x 104 0 100 200 300 400 500 Sub−carrier spacing (Hz) RMSE (m) Schmidl Minn Park Kim Ren Kang CBTS Schmidl MUSIC Schmidl
47 7 Conclusions and open issues This thesis addressed the issue of preamble-based timing synchronization in OFDM systems with the goal of cellular-based positioning. The main observation has been that typically, the preamble-based approaches do not offer sufficient timing accuracy for positioning applications in realistic channel conditions with low to moderate SNRs and multipath fading. The starting point has been the Schmidl algorithm based on a simple 2-part preamble, which has also been the basis of all the preamble-based algorithms developed further on. While Schmidl algorithm can be used as benchmark, it typically has the worst performance among the considered algorithms due to a flat region in its maximum levels that is equal to the guard interval length. Simulation results show that the lengths of the GI or the number of used subcarriers are not affecting the system performance neither in single path nor multipath channels (those simulations were done at equal bandwidths). It is observed that the performance of the estimators, both in single and multipath channels, is better with larger frequency spacing ∆f and, as a consequence, smaller OFDM symbol times. That happens as expected, because larger frequency spacing means larger bandwidths and thus better timing accuracy. For the same reason, it is also observed that high FFT length values improve the system performance. Focusing on single path channel, simulations results show that Minn, Ren, CBTS and MUSIC algorithms are robust to OFDM symbol time. Results also show that Schmidl algorithm is the worst one whereas Minn or Ren algorithms only work properly for SNR values higher than 0 dB. It is observed that MUSIC is the best algorithm under study in the full range of SNR values, and at sufficiently high FFT length, reaching zero delay error even at -20 dB SNR, followed by Kim, Park and Kang algorithms, which have a similar performance. It is also observed that CBTS, MUSIC and Ren algorithms are suitable for LTE, WLAN and WiMAX because of its robustness to the number of FFT subcarriers (MUSIC algorithm is only robust to FFT length for the algorithms based on preambles with two identical parts). As a result, MUSIC algorithm with a preamble structure divided into two equal parts is the best algorithm over single path AWGN channel. Evaluating the simulator performance over Rayleigh fading multipath channel, we can observe that Schmidl, Minn and Ren algorithms are clearly the worst among the algorithms under study, whereas MUSIC, Park, Kim and Kang algorithms have the best (and similar) performance. Kang algorithm is the only one that reaches zero error at the highest SNR value, while the others may still have a residual bias or may need even higher SNR than
48 those typical to an OFDM system in moderate to good channel conditions. Furthermore, results show that Kang is robust to the number of FFT subcarriers so it can be used in LTE, WLAN and WiMAX. In addition to this, Kang algorithm is the only algorithm that is robust to OFDM symbol time. Although MUSIC, Park, Kim and Kang algorithms have a similar performance when compared for various SNR values, we can conclude that Kang algorithm is the best one in multipath channel because it reaches zero meters error and it can be used with the three OFDM systems and with any kind of preamble structure. To sum up, MUSIC algorithm is the best choice over single path channels, as long as the transmitted preamble is divided into two equal parts. For multipath fading channels, Kang is offering the best performance among the studied algorithms. However, preamblebased algorithms such as Kang’s have much lower implementation complexity than superresolution algorithms such as MUSIC. The complexity of various algorithms has not been studied in this thesis and it remains an open issue worthy to address in the continuation. Also, as a general conclusion, other timing algorithms than those based on preambles should be studied and investigated for high-accuracy positioning with OFDM systems. Such approaches are open issues in the literature regarding OFDM-based timing estimates.
49 References [1] C. Mensing, S. Plass, and A. Dammann, “Synchronization Algorithms for Positioning with OFDM Communications Signals,” in 4th Workshop on Positioning, Navigation and Communication, 2007, vol. 2007, pp. 205-210. [2] L. Dai, Z. Wang, J. Wang, and Z. Yang, “Positioning with OFDM signals for the nextgeneration GNSS,” IEEE Transactions on Consumer Electronics, vol. 56, no. 2, pp. 374-379, May 2010. [3] I. Mateu, M. Paonni, J.-L. Issler, and G. H. Hein, “A search for spectrum,” InsideGNSS, pp. 65-71, 2010. [4] D. Serant, O. Julien, L. Ries, P. Thevenon, M. Dervin, and G. W. Hein, “The digital TV case,” InsideGNSS, pp. 54-62, 2011. [5] G. Seco-granados, F. Zanier, M. Crisci, S. En-, and T. Nether-, “Preliminary Analysis of the Positioning Capabilities of the Positioning Reference Signal of 3GPP LTE,” in 5th European Workshop on GNSS Signals and Signal Processing, 2011. [6] C. Yang, “Signals of Opportunity for Positioning,” in ION Southern California Section Meeting, 2011, no. 650, pp. 1-35. [7] X. Wang, “OFDM and Its Application to 4G,” in 14th Annual Wireless and Optical Communications Conference, 2005, p. 69. [8] A. J. Weiss and O. Bar-shalom, “Efficient direct position determination of orthogonal frequency division multiplexing signals,” IET Radar, Sonar and Navigation, vol. 3, no. 2, pp. 101-111, 2009. [9] H. Ni, G. Ren, and Y. Chang, “A TDOA location scheme in OFDM based WMANs,” IEEE Transactions on Consumer Electronics, vol. 54, no. 3, pp. 1017- 1021, Aug. 2008. [10] T. M. Schmidl and D. C. Cox, “Robust frequency and timing synchronization for OFDM,” IEEE Transactions on Communications, vol. 45, no. 12, pp. 1613-1621, 1997. [11] H. Minn, M. Zeng, and V. K. Bhargava, “On timing offset estimation for OFDM systems,” IEEE Communications Letters, vol. 4, no. 7, pp. 242-244, Jul. 2000.
56 E_Park(d)=sum(abs(recvd_signal_zeropad(d:d+Len_all/2)).^2); end; Park_metric=(abs(P_Park)./(E_Park)).^2; %timing estimation is [~, maxipos1]=max(Park_metric); t_est_Park=maxipos1-Len_all/2; case 4 %Kim Len_all=N_FFT; %N_FFT or length(recvd_signal); recvd_signal_zeropad=[zeros(1,2*Len_all) recvd_signal zeros(1,2*Len_all)]; for d=1:2*Len_all+1, E_Kim(d)=sum(abs(recvd_signal_zeropad(d+Len_all/2:d+Len_all-1)).^2); P_Kim(d)=sum(recvd_signal_zeropad(d+Len_all/2:d+Len_all).*fliplr(... conj(recvd_signal_zeropad(d+Len_all:d+Len_all+Len_all/2)))); end; Kim_metric=(abs(P_Kim)./E_Kim).^2; %timing estimation is maxipos1=find(Kim_metric>1); t_est_Kim=maxipos1(end)-Len_all-2; case 5 %Ren Len_all=N_FFT; recvd_signal_zeropad=[zeros(1,Len_all) recvd_signal zeros(1,Len_all) zeros(1,Len_all)]; for d=1:2*Len_all+1, P_Ren(d)=sum(s1(1:Len_all/2).*s1(1+Len_all/2:Len_all).*conj(... recvd_signal_zeropad(d+1:d+Len_all/2)).*recvd_signal_zeropad(d+1+Len_all/ 2:d+Len_all)); E_Ren(d)=0.5*sum(abs(recvd_signal_zeropad(d:d+Len_all- 1)).^2); end; Ren_metric=(abs(P_Ren)./E_Ren).^2; %timing estimation is [~, maxipos1]=max(Ren_metric); t_est_Ren=maxipos1-Len_all; case 6 %Kang Len_all=N_FFT; %N_FFT or length(recvd_signal); recvd_signal_zeropad=[zeros(1,Len_all) recvd_signal zeros(1,Len_all)]; for d=1:2*Len_all+1, V=conj(recvd_signal_zeropad(d:d+Len_all- 1)).*circshift(recvd_signal_zeropad(d:d+Len_all-1),shift); E_Kang(d)=norm(real(V))+norm(imag(V)); P_Kang(d)=real(V)*p'+imag(V)*q'; end; Kang_metric=(P_Kang./E_Kang).^2; %timing estimation is [maximum, ~]=max(Kang_metric); maxipos1=find(Kang_metric>maximum-1); t_est_Kang=maxipos1(end)-Len_all-1; end; end;
57 disp(['True Delay and Estimated delays in meters for Schmidl, Minn, Park, Kim, Ren and Kang']) [D t_est_Schmidl t_est_Minn t_est_Park t_est_Kim t_est_Ren t_est_Kang]*Derr_T %Following function is used to simulate the system channel %Channel_part function ######################################### function [ recvd_signal,D ]=Channel_part(tx_signal,SNR,foffset,T_OFDM); %Add random delay; here given in samples D=round(10*rand(1,1)); del_sig=[zeros(1,D) tx_signal(1:end-D)]; %Add AWGN s=randn(1,length(del_sig)); sigma=sqrt(1/(10^(SNR/10))); %normalize sigma to signal power: power_timedomain = mean(abs(x).^2)) sigma=sigma*sqrt(mean(abs(tx_signal).^2)); S=(s-mean(s))/sqrt(var(s)); noise=sigma.*S; awgn_signal=del_sig.*exp(1i*2*pi*foffset*[1:length(del_sig)]/N)+noise; %Pass the ofdm signal through the channel recvd_signal=awgn_signal; end %Following function is used to find shift value for Kang algorithm %shift_decision function ######################################### function [ out ] = shift_decision( signal, Nfft ) for i=1:length(signal) C = conj(signal).*circshift(signal,i); autocor = xcorr(C); max_corr = max(autocor); m = (mean(autocor(1:Nfft-1)) + mean(autocor(Nfft+1:end)))/2; shift_out(i)=(max_corr-m); end [~, out] = max(shift_out); end