### Hometask - 1 
### Lecture 1 and 2 based materials

### Task description ###

1. Generate 5000 samples of matrix A (size: 4x4) and keep in the memory
for all numerical experiments.

2. Set precoding vector p_tx to match the matrix A properties as
maximum as possible in terms of capacity (det(A*p_tx) -> max.
   (precoding.m)

3. Map one-bit symbol (-1/+1) from 1x1 to 4x1:  x = p_tx * s.

4. Compute b = Ax.

5. Add gaussian noise (sigma is variation parameter for analysis):
 b = b + n.

6. Solve noise equation: Ax = b, that define x as estimation value.
	a) solve as linear system
	b) solve as maximum likelyhood solution (ML)
   (receiver.m)

7. Find a way to define s by known p_tx and estimated x.
   (receiver.m)

8. Check: how many s = s ?...
P_error = 1 - <right s> / <number of samples>

9. P_error can be defined as function of deviation of noise (sigma).
   building diagram for comparison.

### Notes ###
m-files in this directory have working version of the program.
Some updates in precoding.m  and receiver.m are required.
Corresponding part of the code marked by line:  -=-=-=-=-

To verify that all scripts work well, there is png-file with diagrams:
(reference_diag.png)

You need run (hm1.m) to get result.

**********************************
The scripts can be used in MATLAB, as well as in Octave.
If you are going to use Octave, then your Octave version has to
include Statistics Package Version 1.4.0
(https://octave.sourceforge.io/statistics/index.html)
to support function wishrnd().