function [templateFrame, rotations] = genTemplateFrame()

starlinkConstants

% Load reference template rotations from .mat file (generated from exemplar frames analysis).
data = load('referenceTemplate.mat', 'referenceTemplateRotations');
rotations = data.referenceTemplateRotations;

templateIQ = exp(1j * rotations * pi/2);
templateIQ(rotations==-1) = 0;

templateFrame = sqrt(sl.N) * ifft(templateIQ);
templateFrame = [templateFrame(end-sl.Ng+1:end,:); templateFrame];
templateFrame = reshape(templateFrame, [numel(templateFrame) 1]);

end
