How to find a know signal in another signal which contains other signals along with the signal i need in python I am working on BPSK with sound waves a carrier waves.

Actually I am modulating my data with some known sync bits along with the information I need to send. So the things I will be having at demodulation side is these sync bits and carrier wave.

So I am modulating these sync bits with carrier and cross correlating this modulated (over sync bits) wave with received wave at the transmiter. By doing this I want to find the exact time position (where these sync bits appear in received wave).

For this I am first crosscorelating received wave and my sync wave then, when I plot it I wil surely get a maximum where the sync wave in both signals coincide.

But I am not sure if this maximum is the position I need (when there is a DC offset or large amplitudes in the received signal, it can also create an extreme value)

So to overcome this, I autocorelated my sync wave with itself and took the
absolute difference between the all the values of crosscorelated matrix and
autocorelated value. Then I assumed which ever value has the least value as the
synced location.

This is also not working (I think as iam not sure that
the location iam getting is midpoint of sync or starting of sync). Is this
approach correct? 

Or are there any other approaches to find the starting sync position in received wave?

I also needed help in knowing whether if we use the first method (wher evr maxima comes in crosscorelation taking tht as sync location) is this location I got, is sync starting location or midpoint of sync?
I made a little research on detecting the sync_start location on my received signal.

First I modulated the bits (sync_start bits + data bits + sync_end bits) with a sine signal as my carrier, with a frequency of $20 \text{ kHz}$ and a total length of 10000 bits (including both sync_start and sync_end). 

I then converted this modulated wave into a .wav file 
and played it on my PC, while recording simultaniously on an another PC, using Pyaudio (Python). That gave me a recorded .wav - my received signal.

Now as I knew my sync bits value, I modulated them on the same carrier wave and cross correlated this with the received wave. 

Case 1:

$\text{bit length} = 10000$ (including sync_start and sync_end), 

$\text{number of sync_start bits} = \text{sync_end} = 2287$

The plot of cross correlation is as shown :



Case 2:

$\text{bit length} = 15000$



case 3:

$\text{bit length} = 20000$



As the data length increases(keeping our sync_start and sync_end same in all cases), the exact time stamps of sync_start_mid index and sync_end_mid index gets more accurate.

Note : For data bits here, I took all of them as $1$'s -- that might be the reason for the smaller amplitudes in the middle. I will add random data and see if I am getting the same inference.

Please correct me if there is any mistake in my inference. As far as now I am now able to exactly pinpoint the synchronization between transmitted and received waves.

I also wanted to know the limitations of length of the sync bits (because when my sync bits length gets smaller, the dominant peak location cannot be found from cross correlation).

And I am using a BPSK scheme.