# Determining signal using Optimal receiver(Matched filter)

I'm given a signal that has been passed through a noisy channel using binary polar signaling with a pulse value of p(t) = 1. The receiver is coherent and the length of each pulse (in samples) is 10 samples. I'm given:

the pulse signal used to represent the symbol/bit '1' = [3.1623, 3.1623, 3.1623, 3.1623, 3.1623, 3.1623, 3.1623, 3.1623, 3.1623, 3.1623]
the number of samples taken from each symbol = 10
the number of symbols, i.e., bits, sent in the signal (there are 8-bits per character) = 248
the variance of the noise in the AWGN channel = 28
the mean of the noise in the AWGN channel = 0
the energy of the p_sampled signal = 100


Using this information I need to find the values of the received symbols using an optimal receiver or a matched filter.

I implemented the correlation receiver realization of this in MATLAB:

So for my example, I've chosen T0 = 10 and since polar signalizing is used, I threshold the sampled signal as m = 1 if y(T0) > 0 else m = 0

This is my code:

 p_of_t = [3.1623 3.1623 3.1623 3.1623 3.1623 3.1623 3.1623 3.1623 3.1623 3.1623]

for idx = 1:numSymbols % for each symbol transmitted

r_of_t = x_of_t(tmp+1 : idx*samplesPerSymbol); % 10 samples of the received noise + message
y_of_t_at_tm(idx) = sum(r_of_t .* p_of_t);

if(y_of_t_at_tm(idx) > 0)
decision(idx) = 1;
else
decision(idx) = 0;
end

tmp = idx*samplesPerSymbol;
end


I have two questions:

1. Will the Optimal filter decode ALL the bits from the received signal, correctly?
2. Is my implementation of the filter correct?

The reason I ask is that when I try to verify my implementation by generating my own polar signal for a message and using the above implementation as a receiver and decode the sampled bits, I do not get the original message back. There is an error of one bit.

I will appreciate any leads. Thank you.

• one error bit out of how many? – Stanley Pawlukiewicz Feb 24 at 15:38
• I tested on Hello World! which was 96 bits – Abhijith Feb 24 at 15:51
• Looks good at first sight.... could the error be in how x_of_t is generated? – MBaz Feb 24 at 20:39
• When I don't add noise to my polar signal, and try to decode just the polar signal with my implementation, it decodes it correctly so I'm guessing x_of_t is fine. – Abhijith Feb 24 at 20:50
• In general, does the optimal receiver decode the message a 100% correct? Or this filter's design is the best we can do( not necessarily 100% accurate) compared to other filters and hence termed optimal? – Abhijith Feb 24 at 20:52