% Problem 2

close all
clear all

% Load the various vectors
load preamble.mat
load rx_samples.mat

% Define parameters
SPS = 5; % Samples per symbol

% Find the start of the preamble within the received samples. If your code
% works properly, you should find that the preamble starts at the sample
% number 211.


ind = ...

% Extract from the received samples the portion corresponding to the 1000
% transmitted BPSK data symbols and process it accordingly in order to
% generate the sufficient statistics about the transmitted data symbols.
% Plot the result. If your code works properly, you should obtain a rotated
% (and noisy) BPSK constellation.




% Perform differential decoding. Assume that the first symbol is either a
% +1 or a -1 and then decide on the following symbols depending on the
% phase difference between two consecutive values of the sampled output of
% the matched filter.




% At this point, using the transmitted data symbols given to you, one can
% compute the symbol error rate (SER). If your code works properly, this
% should be either 0, if your assumption about the first symbol was
% correct, or 1, if your assumption about the first symbol was wrong.


SER = ...
