Barker code autocorrelation
Correlating a signal with itself is often called an "optimal filter". It is the best possible filter for detecting the signal. I am not up on all the tricks of encoding data for WiFi, but I think all you need to do is multiply your input string of data by your filter string (+1 +1 -1 +1) in hunks of 4 datums and add up the results. You will get a maximum when your filter lines up with the signal you want. The result is 4 isn't it? Any other sequence will be less. The Barker codes are chosen to produce the lowest possible values when the correlation fails - the sequences do not line up.

If this is not just an exercise, then it gets more complicated.