In the last blog we discussed how we were able to get the constallation and thus the bits from the input file. In this blog we will look at how we are accurately obtaining the sync positions within the file.
Both the Meteor and Funcube signals have some synchronization bits in them and are sent at regular intervals. Our goal is to detect these bits as accurately as possible. Since this (both Meteor and Funcube) is a digital system if we compare the output bits with the sync bits, we would not find the sync location very accurately, because the bit out frequency is at baud rate. The meteor has a 120 bit long sync bit sequence , funcube has a 32 bit long sync sequence .
Getting the location of sync at baud rate is simple, we can just slide the needle (sync) across the bitstream until we encounter an almost perfect match (a few bit errors are common). This can be used to accuratey find the sync, as we know the accurate sync will lie close in the range of this crude sync. In order to do this, we can multiply the PLL correction factor (refer to the block diagram) to this range (around the crude sync) of samples at high sampling rate and use an appropriately expanded needle (sync bit sequence) and correlate to find the peak. This peak will be the accurate enough location of the sync.
Here is the result of a sync detection of meteor m2 satellite, we can see that this is a very good result, we can even see the doppler effect in action.
One of the things to keep in mind while decoding meteor is that, since the constallation has four points, it will still look the same if flipped/rotated. So there is not only one sync sequence but several (flip all bits, flip every other bit etc.) Hence all these sequences had to be used to find the sync.
Here is the result of a sync detection of funcube satellite. This is an okay result, but considering that the sync in funcube is only sent once every 5 seconds, I think this is a fair result.
Since funcube signal has only a few khz of bandwidth the doppler effect is very prominant. Hence the correction can be done manually by selecting a -f such that it is almost at the mean position of signal or use the –freqshift flag and the script will automatically attempt to correct the shift. The offset can be calculated by doing a fourier transform and the correction can be done by multiplying every sample with a complex exponential (e^(2*pi*i*offset)) to correct it. The offest is gradually changed so that the PLL can keep up with the changes or even increasing the PLL bandwidth could help.