% Problem 3

close all;
clear all;

% Load the received signal and the C/A code
load rx_signal_gps.mat
load ca_code.mat


% In the following we ask you to implement a matched filter receiver. The
% matched filter is matched to the pulse shape used by the satellite.
% Please follow strictly the instructions given below.

% Specify the matched filter
h_mf = ...
    

% Pass the received signal through the matched filter
...
    

% Plot the eye diagram at the output of the matched filter
...
    

% Write a code that estimates the delay of the channel, based on the eye
% diagram. For simplicity, you can assume that the eye diagram is
% symmetrical with respect to the horizontal axis.
...
    

% Once you find the estimate of the delay, use it to downsample the matched
% filter output to generate the sufficient statistics
...
    

% Use the sufficient statistics to estimate the bits transmitted by the
% satellite.
estimated_bits = ...
    

% If everything you did above was correct, you should obtain the bits
% stored in transmitted_bits.mat
load transmitted_bits.mat
number_of_errors = nnz(estimated_bits - transmitted_bits)



