the filter needs to cut off the high sidband.
rf signal has two frequencies at +0.1 and -0.1
when we mix it with 0.1 (or you can choose =-0.1) we get the sum and the difference:
0.1 + 0.1 = 0.2 (high sideband)
0.1 - 0.1 = 0 (our dream dc)
the filter must pass dc but cut highband at 0.2 (of Fs)
the function fir1 that I used cuts off at 0.3 of Nyquist (i.e. 0.3/2 of Fs = 0.15 so is just right for single tone).
bwt this costas loop seems horrible to control compared to my previous work on qpsk/qam which was predictable.
in this loop even if reverse the sense of error I get same result.
so surely this is not how it should be done. If you make research and find out I will be interested to know.
Should we use filter for the error (I tried IIR and IIR + a second accum and lost control).