Time offset estimation for OFDM in MATLAB

This page of MATLAB source code covers time offset estimation for OFDM based system.

Time synchronization is very important in wireless as well as wireline communication between transmitter and receiver. In order to achieve this various techniques are employed. The most common method is to transmit fixed repeated pattern along with the data. This is also referred as preamble. Usually preamble is appended at the beginning.

Copy of the preamble which is used along with the data for transmission is usually stored at the receiver. Correlation of the received packet with the stored local copy has some unique characteristics. This unique feature is exploited for time offset estimation in most of the systems. On this page we will see time offset estimation for wimax system which is used for broadband communication between WiMAX system consists of two main parts subscriber station and base station. WIMAX has got many frequency bands depending on countrywide allocations. It is based on OFDM modulation concept.

As mentioned wimax preamble consists of two symbols, first symbol has pattern repeated four times and second symbol has pattern repeated twice. We will see time offset estimation based on first symbol preamble. This preamble correlate with itself has got 4 peaks as shown in the figure-1. The maximum peak will be at position index zero.

•  Preamble Symbol-1 correlated with itself will provide four peaks and symbol2 correlated with itself with provide the two peaks. The same is exploited for time offset estimation.
•  In time offset estimation received packet in time domain is correlated with the short preamble with CP stored locally at the receiver.
•  Determine the maximum peak and find the index of the same.
•  This index minus one provides the time offset in the packet.
•  Find below the matlab snippet for the same.

auto correlation short preamble with itself

clc;
close all;
clear all;
CP=64;
load file_wimaxtxpkt;
load file_wimax_preamble;
figure;plot(abs(corr(S1_tdcp1,S1_tdcp1)));
%%%%Adding time offset%%%%%%%%%%%%
Toff=input('Enter time offset any numeric number(for example 100):');
Tx_Packet=[zeros(1,Toff),Tx_Packet];

%%%%%%Time offset estimation%%%%%%%%%%%%%%%%%%%%
cor=corr(Tx_Packet,S1_tdcp1);
[m,n]=max(cor);
t_offset = n-1
figure;plot(abs(cor));

%%%%Time offset correction%%%%%%%%%%%%%%%%%%%%
Rx_pkt_corrected=Tx_Packet(t_offset+1:end);
cross correlation preamble with received preamble

The received packet correlated with the local copy of the preamble will shift the maximum peak from the zero position. This shift is proportional to the amount of time offset in the received packet. The same has been derived using the above matlab code.

Time offset correction

In the Time offset correction samples calculated in the aove algorithm has been skipped and the packet without this offset is fed to the next synchronization module in the receiver i.e. frequency offset estimation and correction.

The similar concept of time offset estimation and correction is employed in WLAN, LDACS based OFDM systems.

DOWNLOAD MAT FILES

Download MAT and other supporting files.

Useful Links to MATLAB codes

Refer following as well as links mentioned on left side panel for useful MATLAB codes.
OFDM Preamble generation  Time off estimation corr  Freq off estimation corr  channel estimation  11a WLAN channel  PN sequence generation  OFDMA Tx Rx  AES DES  carrier aggregation  CCDF  FIR Filter  IIR Filter  Low Pass FIR  Viterbi decoder  CRC8 CRC32 

RF and Wireless tutorials

WLAN  802.11ac  802.11ad  wimax  Zigbee  z-wave  GSM  LTE  UMTS  Bluetooth  UWB  IoT  satellite  Antenna  RADAR