DSPRelated.com
Forums

A way of demodulating BFSK

Started by John E. Hadstate September 23, 2006
In this application I've already decided by other criteria 
that a segment of the incoming signal contains a BFSK signal 
to be demodulated and I know where the center frequency is.

Knowing the center frequency, I create two FIR bandpass 
filters corresponding to the locations and width of the 
"horns".  The FIR filters are of equal length and are 
slightly more than one bit-time in length at the specified 
sample rate.  I initialize two accumulators to zero.

I pass the incoming signal samples through both filters.

I compute the squared-magnitude output of both filters and 
add the results, sample-by-sample, to two corresponding 
accumulators.

Once per bit-time, I examine the two accumulators and 
whichever one has accumulated more "energy" is declared the 
winner for the purpose of deciding whether to emit a 0 or a 
1.  Then the accumulators are reset to zero.

Though I haven't seen it described anywhere, I'm guessing 
that this algorithm is not a new invention and others have 
already tried this.  That being the case, what is your 
experience with this algorithm's performance against other 
techniques for demodulating BFSK?  I'm guessing that it's 
vulnerable to highly selective fading or adjacent-channel 
interference and that these effects are more or less severe 
depending on the synchronization between the original bit 
state transitions and the resetting of the accumulators.



"John E. Hadstate" <jh113355@hotmail.com> wrote in message
news:fFaRg.14449$8s6.10495@bignews4.bellsouth.net...
> In this application I've already decided by other criteria > that a segment of the incoming signal contains a BFSK signal > to be demodulated and I know where the center frequency is. > > Knowing the center frequency, I create two FIR bandpass > filters corresponding to the locations and width of the > "horns". The FIR filters are of equal length and are > slightly more than one bit-time in length at the specified > sample rate. I initialize two accumulators to zero. > > I pass the incoming signal samples through both filters. > > I compute the squared-magnitude output of both filters and > add the results, sample-by-sample, to two corresponding > accumulators. > > Once per bit-time, I examine the two accumulators and > whichever one has accumulated more "energy" is declared the > winner for the purpose of deciding whether to emit a 0 or a > 1. Then the accumulators are reset to zero. > > Though I haven't seen it described anywhere, I'm guessing > that this algorithm is not a new invention and others have > already tried this. That being the case, what is your > experience with this algorithm's performance against other > techniques for demodulating BFSK? I'm guessing that it's > vulnerable to highly selective fading or adjacent-channel > interference and that these effects are more or less severe > depending on the synchronization between the original bit > state transitions and the resetting of the accumulators. > >
I think this is the standard text book implementation and should provide optimal demodulation. Your issue will be the time synchronization. If the baud rate is low enough that you can oversample by a reasonable factor then a simple peak picking algorithm should be enough for sync, but if it is a very high baud rate and small modulation index you may have to resort to an fm discriminator approach. The other draw back is that the implementation is not very flexible as you need to load a new set of filters for every different modulation index. -Clark
"Anonymous" <someone@microsoft.com> wrote in message 
news:z7bRg.38389$Md4.38040@tornado.southeast.rr.com...
> > I think this is the standard text book implementation
You must have better text books than I had. The authors of my textbooks didn't sharpen their chisels often enough. However, I do have Mr. Lyon's book on order ;-)
> and should provide optimal demodulation. > Your issue will be the time synchronization. If the > baud rate is low enough that you can oversample by a > reasonable factor then a simple peak picking > algorithm should be enough for sync,
The signal is highly oversampled with respect to the baud rate. However, I'm not quite sure how "peak-picking" fits here. Could you elaborate?
> but if it is a very high baud rate and small > modulation index you may have to resort to an fm > discriminator approach.
I am thinking about using a digital discriminator approach, but I've read that the performance with BFSK is not very good, and there's still the problem of synchronously decimating the sample rate to the baud rate. Sensitivity to noise is a problem because the demodulated data has very limited facilities for error detection/correction and the environment is typically very noisy.
> > The other draw back is that the implementation is > not very flexible as you need to load a new set of > filters for every different modulation index. >
In this application, the deviation and baud rate for the signal are established by international standards. Changing them would likely be a long process. The center frequency, however, can change depending on the setup of the receiver and the transmitter. I was surprised at the ease (and speed) with which I can synthesize a pair of FIR filters that are matched to the current situation. Having established the center frequency, some initialization, two IFFTs, two windowings, and two FFTs, done once, gives suitable frequency windows for the filters. On my systems, that's worst-case less than 2 msec. using 128-point FFTs and floating-point arithmetic. Thanks for your help. You've got me thinking about some improvements. -jeh
Anonymous wrote:
> "John E. Hadstate" <jh113355@hotmail.com> wrote in message > news:fFaRg.14449$8s6.10495@bignews4.bellsouth.net...
[...]
>>Knowing the center frequency, I create two FIR bandpass >>filters corresponding to the locations and width of the >>"horns". The FIR filters are of equal length and are
These are often called "mark" and "space" frequencies.
> I think this is the standard text book implementation and should provide > optimal demodulation.
[...]
> -Clark
"optimal"? If the FSK is continuous phase (CPFSK), you can do considerably better if you consider more than one symbol at a time. -- Mark Borgerding 3dB Labs, Inc Innovate. Develop. Deliver.
John E. Hadstate wrote:

> In this application I've already decided by other criteria > that a segment of the incoming signal contains a BFSK signal > to be demodulated and I know where the center frequency is. > > Knowing the center frequency, I create two FIR bandpass > filters corresponding to the locations and width of the > "horns". The FIR filters are of equal length and are > slightly more than one bit-time in length at the specified > sample rate. I initialize two accumulators to zero. > > I pass the incoming signal samples through both filters. > > I compute the squared-magnitude output of both filters and > add the results, sample-by-sample, to two corresponding > accumulators. > > Once per bit-time, I examine the two accumulators and > whichever one has accumulated more "energy" is declared the > winner for the purpose of deciding whether to emit a 0 or a > 1. Then the accumulators are reset to zero. > > Though I haven't seen it described anywhere, I'm guessing > that this algorithm is not a new invention and others have > already tried this.
In as much as you are using a pair of band-pass filters and comparing their output, yes, it's been done before.
> That being the case, what is your > experience with this algorithm's performance against other > techniques for demodulating BFSK?
Your biggest stumble is that you aren't synchronizing to the bit rate. You should sample at the point where your filters' outputs peak for any given bit -- sampling at a random time compared to the bit time may work sometimes, and may give you completely random results at others.
> I'm guessing that it's > vulnerable to highly selective fading or adjacent-channel > interference
Some forms of FSK -- particularly those with wide frequency shift relative to the bit time -- are said to be quite resistant to selective fading because of the redundant information. If you're _really_ clever you can detect the selective fading and shade your detection more and more toward OOK at the one frequency that's getting through. Dunno about adjacent-channel interference, although that's going to be a bad thing no matter what.
> and that these effects are more or less severe > depending on the synchronization between the original bit > state transitions and the resetting of the accumulators. >
Yes, these effects will be bad if you're not synchronized. Why don't you want to synchronize? PLL's can be implemented in these circumstances. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
Tim Wescott wrote:

> John E. Hadstate wrote:
(snip regarding BPSK)
>> Knowing the center frequency, I create two FIR bandpass filters >> corresponding to the locations and width of the "horns". The FIR >> filters are of equal length and are slightly more than one bit-time in >> length at the specified sample rate. I initialize two accumulators to >> zero.
>> I pass the incoming signal samples through both filters.
>> I compute the squared-magnitude output of both filters and add the >> results, sample-by-sample, to two corresponding accumulators.
>> Once per bit-time, I examine the two accumulators and whichever one >> has accumulated more "energy" is declared the winner for the purpose >> of deciding whether to emit a 0 or a 1. Then the accumulators are >> reset to zero.
(snip)
> In as much as you are using a pair of band-pass filters and comparing > their output, yes, it's been done before.
(snip)
> Your biggest stumble is that you aren't synchronizing to the bit rate. > You should sample at the point where your filters' outputs peak for any > given bit -- sampling at a random time compared to the bit time may work > sometimes, and may give you completely random results at others.
For an analog implementation, the output of the filters would be compared, and converted to a digital one/zero out the RS232 port. That then goes into a UART which determines at the appropriate time where the bits are. Usual UART operation is something like detecting the start bit (on a transition from one to zero, or mark to space), wait one half the bit time to be sure it is still zero, then count bit times and record the bits. UARTs commonly use a 16x clock, though some use 64x, to examine the input at the appropriate time. Finally, verify the stop bit and begin searching for a start bit again. In case the senders clock is fast and/or the receiver is slow one should begin searching for the next start bit immediately after verifying the stop bit. Some hysteresis would likely be applied to the filter outputs as part of the conversion to mark/space. -- glen
"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in 
message news:R_qdneUT0d873YfYnZ2dnUVZ_s6dnZ2d@comcast.com...
> Tim Wescott wrote: > > >> Your biggest stumble is that you aren't synchronizing to >> the bit rate. You should sample at the point where your >> filters' outputs peak for any given bit -- sampling at a >> random time compared to the bit time may work sometimes, >> and may give you completely random results at others. > > For an analog implementation, the output of the filters > would be > compared, and converted to a digital one/zero out the > RS232 port. > > That then goes into a UART which determines at the > appropriate time > where the bits are. > Some hysteresis would likely be applied to the filter > outputs as > part of the conversion to mark/space.
Thanks, Tim and Glen. Although the "dumb" approach (unsynchronized decimation) worked fairly well, I have figured out a non-linear algorithm for auto-synching the decimation boundaries to the sample stream. It involves monitoring the squared difference between the two accumulators and extending the decimation interval when necessary. It significantly improves performance in a noisy environment. Thanks to everyone for your interest and participation. -jeh
On Sat, 23 Sep 2006 14:55:58 -0400, "John E. Hadstate"
<jh113355@hotmail.com> wrote:

> >"Anonymous" <someone@microsoft.com> wrote in message >news:z7bRg.38389$Md4.38040@tornado.southeast.rr.com... >> >> I think this is the standard text book implementation > >You must have better text books than I had. The authors of >my textbooks didn't sharpen their chisels often enough. >However, I do have Mr. Lyon's book on order ;-)
Hi John, when the book arrives, if you tell me what is the "Printing Number" of your copy of the book, I'll send you an errata. Regards, [-Rick-]
On Wed, 27 Sep 2006 12:55:35 GMT, R.Lyons@_BOGUS_ieee.org (Rick Lyons)
wrote:

>On Sat, 23 Sep 2006 14:55:58 -0400, "John E. Hadstate" ><jh113355@hotmail.com> wrote: > >> >>"Anonymous" <someone@microsoft.com> wrote in message >>news:z7bRg.38389$Md4.38040@tornado.southeast.rr.com... >>> >>> I think this is the standard text book implementation >> >>You must have better text books than I had. The authors of >>my textbooks didn't sharpen their chisels often enough. >>However, I do have Mr. Lyon's book on order ;-) > >Hi John, > when the book arrives, if you tell me >what is the "Printing Number" of your copy of >the book, I'll send you an errata. > >Regards, >[-Rick-]
Hi Rick, Would it be possible to put the errata somewhere on the web so that we can get to it easily without bothering you ? Thanks.
John E. Hadstate wrote:

(snip)

> Although the "dumb" approach (unsynchronized decimation) > worked fairly well, I have figured out a non-linear > algorithm for auto-synching the decimation boundaries to the > sample stream. It involves monitoring the squared > difference between the two accumulators and extending the > decimation interval when necessary. It significantly > improves performance in a noisy environment.
That sounds similar to the way synchronous phase shift keying detectors work. As I understand it, they square the input signal, and use a PLL to lock onto the peaks. This depends on a sufficient number of phase shifts, so a scrambler is used before the phase modulator. -- glen