# Ofdm symbol estimation

Hi,
I am trying to see ofdm_frame _acquisition.cc code. Here to find the
training symbol phase difference, the code subtracts one symbol from
another and takes norm function like norm(symbol[i]-symbol[i+2]). But
how
will that give the phase difference. Now symbol[i] and symbol[i+2] are
complex values. How will we get the phase by taking the norm of the
same.

secondly how is coarse frequency calculated in the code. The code here
multiplies the knownsymbol phase *received symbol phase like in the
below
code.

void
digital_ofdm_frame_acquisition::correlate(const gr_complex *symbol, int
zeros_on_left)
{
unsigned int i,j;

std::fill(d_symbol_phase_diff.begin(), d_symbol_phase_diff.end(), 0);
for(i = 0; i < d_fft_length-2; i++) {
d_symbol_phase_diff[i] = norm(symbol[i] - symbol[i+2]);
}

// sweep through all possible/allowed frequency offsets and select the
best
int index = 0;
float max = 0, sum=0;
for(i = zeros_on_left - d_freq_shift_len; i < zeros_on_left +
d_freq_shift_len; i++) {
sum = 0;
for(j = 0; j < d_occupied_carriers; j++) {
sum += (d_known_phase_diff[j] * d_symbol_phase_diff[i+j]);
}
if(sum > max) {
max = sum;
index = i;
}
}

// set the coarse frequency offset relative to the edge of the
occupied
tones
d_coarse_freq = index - zeros_on_left;
}

can anybody please tell me how the formula in the code explains the
coarse
frequency estimation algorithm. The paper by schmidl and cox gives some
maximisation formula to calculate it. So i am confused about it.