<< Chapter < Page | Chapter >> Page > |
%% Time Synchronization (RECEIVER)
% ------------------------------------------------------------------------% Description: This implements Schmidl and Cox's symbol frame timing
% synchronization algorithm. The idea is that by zeroing out% the odd frequencies for the training symbol, we produce an
% OFDM symbol that has two periods within the normal OFDM% symbol frame, whereas a normal symbol has only one period.
% By sliding a window in time and multiplying sample by% sample two successive windows of length half of the normal
% symbol and one of them conjugated, the magnitude peak% should hit '1' and represent the exact start of the frame
% for the training symbol. Thus it as well as the data symbol% can be extracted
%% Inputs: signal - Input waveform, sampled from LABVIEW
% size_of_fft - Size of fft for symbol size% Outputs: index - Index of start of timing frame
% agc - Automatic gain control factorfunction [index agc]= tsync(signal, size_of_fft)
%%signal_size = size(signal,2); % Signal size
L = size_of_fft/2; % Length of sliding windowslide_length = signal_size-size_of_fft+1; % Total window slide length
P = zeros(1,slide_length); % Initilize the arraysR = zeros(1,slide_length);for n=1:slide_length
for m=1:LP(n) = P(n) + conj(signal(n+m-1))*signal(n+m+L-1);
% Conjugate pairR(n) = R(n) + abs(signal(n+m+L-1))^2; % Normalizing factor
endend
M = (abs(P).^2);%./(R.^2);% This is the actual timing metric used. Note the algorithm calls for
% the normalization factor. However, due to peak-to-average power% issues, we experienced issues with the algorithm choosing false peaks
% that were greater than 1. After much experimenting, removing the% normalization factor and boosting the signal power of just the
% odd-channels in the training symbols made this algorithm robust.for n=1:slide_length
[value index]= max(M); % Find peak
if((index+2*size_of_fft-1)>signal_size)
M = M(1:index-1); % If peak is near the end, and the symbols cut off, back up and pick another one.else
breakend
endagc = R(index); % Output normalizing factor for automatic gain control (optional)end
Notification Switch
Would you like to follow the 'Fully configurable ofdm sdr transceiver in labview' conversation and receive update notifications?