DSPRelated.com
Forums

Who made the comment about modems and FSK signals?

Started by Brian Reinhold January 15, 2004
I think some respondant named 'v' made a remark in response to a post I made
last week regarding FSK decoding and filtering, but the post has been
removed.  The remark concerned the special processes that have to be done
detecting FSK tones that are very short in the sense that the number of
periods per pulse is barely more than one. I would like to get some more
info!

I have exactly that problem. A two tone FSK at 1200 baud. Tones 1300 Hz and
2100 Hz. The 1300 Hz signal is just a fraction more than a complete period!
Integrate and dump methods don't seem to work very well on this signal!

Brian


"Brian Reinhold" <breinhold@comcast.net> wrote in message news:<sXxNb.59269$Rc4.214834@attbi_s54>...
> I think some respondant named 'v' made a remark in response to a post I made > last week regarding FSK decoding and filtering, but the post has been > removed. The remark concerned the special processes that have to be done > detecting FSK tones that are very short in the sense that the number of > periods per pulse is barely more than one. I would like to get some more > info! > > I have exactly that problem. A two tone FSK at 1200 baud. Tones 1300 Hz and > 2100 Hz. The 1300 Hz signal is just a fraction more than a complete period! > Integrate and dump methods don't seem to work very well on this signal!
Looks like ITU-T V.23 specification to me. Hilbert transform method might work on this but I haven't tried it. You can find the details in an application note on FSK Demodulation on Texas instruments site (http://www.ti.com).
> Brian
Brian Reinhold wrote:

>I think some respondant named 'v' made a remark in response to a post I made >last week regarding FSK decoding and filtering, but the post has been >removed. The remark concerned the special processes that have to be done >detecting FSK tones that are very short in the sense that the number of >periods per pulse is barely more than one. I would like to get some more >info! > >I have exactly that problem. A two tone FSK at 1200 baud. Tones 1300 Hz and >2100 Hz. The 1300 Hz signal is just a fraction more than a complete period! >Integrate and dump methods don't seem to work very well on this signal! > >
Sounds like V.23 or Bell 202 (I forget which uses those those exact tones). Nothing very special is required. Many incoherent FSK techniques will work OK. You want fairly good temporal resolution of the transitions, as they are completely unpredictable in the general case. However, you only need to know at any moment whether you are more likely to be in the 0 or the 1 state - you don't usually care whether the signal is actually a V.23 signal or not. If you sample at 8kHz (usual telecoms rate), or 9.6kHz (often used in analogue interfaced modems) you have a number of samples per cycle, and correlation works rather well, even over a single cycle. If you use a low resolution DDS to generate quadrature tones at the 1 and 0 frequencies, and correlate these with the incoming signal, the higher correlation level should be the state you are in. Monitor this sample by sample, and you have adequate resolution of the time of the transitions for most uses. This works well with pretty awful SNRs. Regards, Steve
Steve,

Maybe I have a bug but I am not catching the tones when I change the baud
rate to 1200 with tones 1300 and 2100  from 100 and tones 1615 and 1785.  I
use a simple integrate and dump scheme.  I multiply the incoming signal with
the sine and cosine of each tone and integrate over one baud period. I do
this every sample and compare which integral gives the greatest value.

It sounds like you think that this method should work even in the presence
of noise.  If that is the case, I have a bug that is not showing up in the
slow case, so I'd better start looking!

Brian
"Steve Underwood" <steveu@dis.org> wrote in message
news:bu80th$ipa$1@home.itg.ti.com...
> Brian Reinhold wrote: > > >I think some respondant named 'v' made a remark in response to a post I
made
> >last week regarding FSK decoding and filtering, but the post has been > >removed. The remark concerned the special processes that have to be done > >detecting FSK tones that are very short in the sense that the number of > >periods per pulse is barely more than one. I would like to get some more > >info! > > > >I have exactly that problem. A two tone FSK at 1200 baud. Tones 1300 Hz
and
> >2100 Hz. The 1300 Hz signal is just a fraction more than a complete
period!
> >Integrate and dump methods don't seem to work very well on this signal! > > > > > Sounds like V.23 or Bell 202 (I forget which uses those those exact > tones). Nothing very special is required. Many incoherent FSK techniques > will work OK. You want fairly good temporal resolution of the > transitions, as they are completely unpredictable in the general case. > However, you only need to know at any moment whether you are more likely > to be in the 0 or the 1 state - you don't usually care whether the > signal is actually a V.23 signal or not. If you sample at 8kHz (usual > telecoms rate), or 9.6kHz (often used in analogue interfaced modems) you > have a number of samples per cycle, and correlation works rather well, > even over a single cycle. If you use a low resolution DDS to generate > quadrature tones at the 1 and 0 frequencies, and correlate these with > the incoming signal, the higher correlation level should be the state > you are in. Monitor this sample by sample, and you have adequate > resolution of the time of the transitions for most uses. This works well > with pretty awful SNRs. > > Regards, > Steve
Steve,

I have taken a close look at the integrate and dump scheme step by step as I
go through the sending of a dot-patterns (alternating 1's and 0's).  Since
the frequencies are
tone 1 = 1300 and tone 0 = 2100 and the baud rate 1200, there are 1 +1/12 of
a cycle for tone 1 and 1+ 3/4 of a cycle for tone 0.

The integrals of these two signals with itself over one baud period is not
equal, though the difference is close. However, the average of the two
signals over one baud period is quite different from 0!  At 1300 Hz the mean
is 3/(13pi) and at 2100 Hz the mean is -4/(11pi) assuming the signal
amplitude is one.

So what I am finding as I do the matching integration that one integration
is consistently larger than the other, so one tone appears to always last
longer than the other.  Normalizing by the integral with itself helps a
little, but not enough.  I'm wondering if it has to do with the magnitude of
the uneven period of tone1 with the tone 0 matcher and vice versa.

Have you ever heard of this problem and how to compensate for it?  When you
have LOTS of periods, these differences become so small that they don't
matter.

Brian
"Steve Underwood" <steveu@dis.org> wrote in message
news:bu80th$ipa$1@home.itg.ti.com...
> Brian Reinhold wrote: > > >I think some respondant named 'v' made a remark in response to a post I
made
> >last week regarding FSK decoding and filtering, but the post has been > >removed. The remark concerned the special processes that have to be done > >detecting FSK tones that are very short in the sense that the number of > >periods per pulse is barely more than one. I would like to get some more > >info! > > > >I have exactly that problem. A two tone FSK at 1200 baud. Tones 1300 Hz
and
> >2100 Hz. The 1300 Hz signal is just a fraction more than a complete
period!
> >Integrate and dump methods don't seem to work very well on this signal! > > > > > Sounds like V.23 or Bell 202 (I forget which uses those those exact > tones). Nothing very special is required. Many incoherent FSK techniques > will work OK. You want fairly good temporal resolution of the > transitions, as they are completely unpredictable in the general case. > However, you only need to know at any moment whether you are more likely > to be in the 0 or the 1 state - you don't usually care whether the > signal is actually a V.23 signal or not. If you sample at 8kHz (usual > telecoms rate), or 9.6kHz (often used in analogue interfaced modems) you > have a number of samples per cycle, and correlation works rather well, > even over a single cycle. If you use a low resolution DDS to generate > quadrature tones at the 1 and 0 frequencies, and correlate these with > the incoming signal, the higher correlation level should be the state > you are in. Monitor this sample by sample, and you have adequate > resolution of the time of the transitions for most uses. This works well > with pretty awful SNRs. > > Regards, > Steve
How does your matched filter look. Is it a FIR where the tap values form a
sine wave of the particular tone?

It is not suffiecient with only one matched filter for each branch (1300 and
2100 Hz branch). You can use two FIR filters for each branch (that is 2 FIR
in parallel for both 1300 and 2100 Hz), where the impulse of the two filters
are changed with 90 degrees. You simply just use a rectangular window to
truncate your impulse repsonse (a sine wave) in two different ways. Square
the two output you get from the parallel FIR filters in the 1300 Hz branch
and add them together. Do the same for the 2100 Hz branch and use the two
signals you now have (1 from the 1300 Hz branch and 1 from the 2100 Hz
branch) in the comparison you already mentioned.

I have used this method and it works well!

Regards
Peter Haslev


"Brian Reinhold" <breinhold@comcast.net> wrote in message
news:xWXNb.80861$I06.345573@attbi_s01...
> Steve, > > Maybe I have a bug but I am not catching the tones when I change the baud > rate to 1200 with tones 1300 and 2100 from 100 and tones 1615 and 1785.
I
> use a simple integrate and dump scheme. I multiply the incoming signal
with
> the sine and cosine of each tone and integrate over one baud period. I do > this every sample and compare which integral gives the greatest value. > > It sounds like you think that this method should work even in the presence > of noise. If that is the case, I have a bug that is not showing up in the > slow case, so I'd better start looking! > > Brian > "Steve Underwood" <steveu@dis.org> wrote in message > news:bu80th$ipa$1@home.itg.ti.com... > > Brian Reinhold wrote: > > > > >I think some respondant named 'v' made a remark in response to a post I > made > > >last week regarding FSK decoding and filtering, but the post has been > > >removed. The remark concerned the special processes that have to be
done
> > >detecting FSK tones that are very short in the sense that the number of > > >periods per pulse is barely more than one. I would like to get some
more
> > >info! > > > > > >I have exactly that problem. A two tone FSK at 1200 baud. Tones 1300 Hz > and > > >2100 Hz. The 1300 Hz signal is just a fraction more than a complete > period! > > >Integrate and dump methods don't seem to work very well on this signal! > > > > > > > > Sounds like V.23 or Bell 202 (I forget which uses those those exact > > tones). Nothing very special is required. Many incoherent FSK techniques > > will work OK. You want fairly good temporal resolution of the > > transitions, as they are completely unpredictable in the general case. > > However, you only need to know at any moment whether you are more likely > > to be in the 0 or the 1 state - you don't usually care whether the > > signal is actually a V.23 signal or not. If you sample at 8kHz (usual > > telecoms rate), or 9.6kHz (often used in analogue interfaced modems) you > > have a number of samples per cycle, and correlation works rather well, > > even over a single cycle. If you use a low resolution DDS to generate > > quadrature tones at the 1 and 0 frequencies, and correlate these with > > the incoming signal, the higher correlation level should be the state > > you are in. Monitor this sample by sample, and you have adequate > > resolution of the time of the transitions for most uses. This works well > > with pretty awful SNRs. > > > > Regards, > > Steve > >
I have "two" matched filters. The sine and cosine components of each
frequency.
I have four 'sums' going on:

'x' is the input sample.

sum_cos0 = sum_cos0 + x * cos0t - oldvaluec0;
sum_sin0 = sum_sin0 + x * sin0t - oldvalues0;
sum_cos1 = sum_cos1 + x * cos1t -oldvaluec1;
sum_sin1 = sum_sin1 + x * sin1t - oldvalues1;

where the 'oldvalues' come from an array which has the value of the product
N samples ago.

Next place the current product into this array of oldvalues to be indexed N
samples from now.
Generate the cos0t, sin0t, cos1t, and sin1t values for the next sample.

total0 = sum_cos0 * sum_cos0 + sum_sin0*sum_sin0;
total1 = sum_cos1 * sum_cos1 + sum_sin1*sum_sin1;

And compare which is largest.

If 'total0' is greater than 'total1' then tone 0 was present.  I think that
is what you described below.  It's just in my computations I find that the
magnitude of the 'totalx' values are consistently larger with one wave
versus the other, and I beleive this is due to the fact that one tone has
only 1 and 1/12 of a period while the other has 1 and 3/4 of a period. But I
am not sure.

Brian

"Peter Haslev" <phaslevsnabel@stofanet.dk> wrote in message
news:40086d39$0$25802$ba624c82@nntp01.dk.telia.net...
> How does your matched filter look. Is it a FIR where the tap values form a > sine wave of the particular tone? > > It is not suffiecient with only one matched filter for each branch (1300
and
> 2100 Hz branch). You can use two FIR filters for each branch (that is 2
FIR
> in parallel for both 1300 and 2100 Hz), where the impulse of the two
filters
> are changed with 90 degrees. You simply just use a rectangular window to > truncate your impulse repsonse (a sine wave) in two different ways. Square > the two output you get from the parallel FIR filters in the 1300 Hz branch > and add them together. Do the same for the 2100 Hz branch and use the two > signals you now have (1 from the 1300 Hz branch and 1 from the 2100 Hz > branch) in the comparison you already mentioned. > > I have used this method and it works well! > > Regards > Peter Haslev > > > "Brian Reinhold" <breinhold@comcast.net> wrote in message > news:xWXNb.80861$I06.345573@attbi_s01... > > Steve, > > > > Maybe I have a bug but I am not catching the tones when I change the
baud
> > rate to 1200 with tones 1300 and 2100 from 100 and tones 1615 and 1785. > I > > use a simple integrate and dump scheme. I multiply the incoming signal > with > > the sine and cosine of each tone and integrate over one baud period. I
do
> > this every sample and compare which integral gives the greatest value. > > > > It sounds like you think that this method should work even in the
presence
> > of noise. If that is the case, I have a bug that is not showing up in
the
> > slow case, so I'd better start looking! > > > > Brian > > "Steve Underwood" <steveu@dis.org> wrote in message > > news:bu80th$ipa$1@home.itg.ti.com... > > > Brian Reinhold wrote: > > > > > > >I think some respondant named 'v' made a remark in response to a post
I
> > made > > > >last week regarding FSK decoding and filtering, but the post has been > > > >removed. The remark concerned the special processes that have to be > done > > > >detecting FSK tones that are very short in the sense that the number
of
> > > >periods per pulse is barely more than one. I would like to get some > more > > > >info! > > > > > > > >I have exactly that problem. A two tone FSK at 1200 baud. Tones 1300
Hz
> > and > > > >2100 Hz. The 1300 Hz signal is just a fraction more than a complete > > period! > > > >Integrate and dump methods don't seem to work very well on this
signal!
> > > > > > > > > > > Sounds like V.23 or Bell 202 (I forget which uses those those exact > > > tones). Nothing very special is required. Many incoherent FSK
techniques
> > > will work OK. You want fairly good temporal resolution of the > > > transitions, as they are completely unpredictable in the general case. > > > However, you only need to know at any moment whether you are more
likely
> > > to be in the 0 or the 1 state - you don't usually care whether the > > > signal is actually a V.23 signal or not. If you sample at 8kHz (usual > > > telecoms rate), or 9.6kHz (often used in analogue interfaced modems)
you
> > > have a number of samples per cycle, and correlation works rather well, > > > even over a single cycle. If you use a low resolution DDS to generate > > > quadrature tones at the 1 and 0 frequencies, and correlate these with > > > the incoming signal, the higher correlation level should be the state > > > you are in. Monitor this sample by sample, and you have adequate > > > resolution of the time of the transitions for most uses. This works
well
> > > with pretty awful SNRs. > > > > > > Regards, > > > Steve > > > > > >
The TI book "Digital Signal Processing Applications with the TMS320 Family"
has in appendix F an article on FSK modems by Phil Evans & Al Lovrich.  It
is probably on their website as an app note.  In summary:

Fin                 (A)      +--------+ (C)   +---------+   (D)  +\
-------------------------->|  mult  |-------->|   LPF  |------->|   \__ (E)
    |                             +--------+          +---------+       +-|
/
    |       +------------+          |
|  +/ Comparator
   +---->|  90 deg  |--->---+   (B)                             0V
            +------------+

You may need to edit this in a better fixed width font to read the pikkie.

Signal B is delayed by fixed 90 degrees at the center frequency

     Fcenter =  (Flow + Fhi) / 2 = 1700 Hz

    Tdelay ~~ 147 uSec for V23.

Assuming a sine wave injected into Fin, you are multiplying 2 sine waves (A)
& (B).  At (C) you get an AC component of 2*Fin, plus a DC component which
is dependant on the relative phase angles of A & B.

If Fin = Fcenter, the DC component is zero.
As Fin is reduced the two waves begin to to come in phase, and a positive DC
component becomes positive.

As Fin is increased, B&C get further out of phase and the DC becomes
negative.  The AC component is easily removed by a lowpass filter.  The
decision on whether you are receiving Fhi or Flo is simply one of deciding
whether (D) is currently positive or negative.

After squaring up to get (D) you can feed it straight into a software or
hardware UART.  It is fascinating to watch signals C & D (fed to spare DACs)
on a CRO as you play with Fin.

The beauty of the system is it is baudless, anything from 0 baud to an upper
limit set by your LPF corner freq & impulse response.  Just change the delay
time to adapt it to different FSK carrier freq standards.

You can improve on the basic scheme.  Hysteresis can reduce noise stutter at
bit transitions (not a prob for hw UARTs).
 For smaller freq swings & lower baud rate (relative to Fcentre) you can set
the delay to a larger odd 90deg multiple (eg 270 deg) to increase the
sensitivity of the DC swing to small changes of Fin.

The total delay should still be kept short relative to a bit period to
prevent blurring of C & D caused by A & B being different frequencies during
bit transitions.

I used this method (back in '92) to demodulate a 18Khz 100 baud carrier on a
56001 DSP (sampling at 10KHz) using the intentionally undersampled alias
image.

Consult the TI website for the maths.  Hope this helps.
Jim Adamthwaite.


Jim Adamthwaite wrote:

> ... In summary: > > Fin (A) +--------+ (C) +---------+ (D) +\ > -------------------------->| mult |-------->| LPF |------->| \__ (E) > | +--------+ +---------+ +-| > / > | +------------+ | > | +/ Comparator > +---->| 90 deg |--->---+ (B) 0V > +------------+ > > You may need to edit this in a better fixed width font to read the pikkie.
Better that you use a fixed-width font. Then I don't need to guess. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"Jerry Avins" <jya@ieee.org> wrote in message
news:400b3824$0$6100$61fed72c@news.rcn.com...
> Jim Adamthwaite wrote: > > > ... In summary: > > > > Fin (A) +--------+ (C) +---------+ (D) +\ > > -------------------------->| mult |-------->| LPF |------->| \__
(E)
> > | +--------+ +---------+
+-|
> > / > > | +------------+ | > > | +/ Comparator > > +---->| 90 deg |--->---+ (B) 0V > > +------------+ > > > > You may need to edit this in a better fixed width font to read the
pikkie.
> > Better that you use a fixed-width font. Then I don't need to guess.
I couldn't understand the figure but I looked at the article as best I could from the TI website and Jim's description and it was pretty interesting. Its a method I had never seen before (even though that's not saying much). It detects the tone by delaying the input signal by 90 degrees with respect to the idealized center frequency (in my casr 1700 Hz) and multiplying the signal by itself. The result is a DC component and a wave with twice the frequency. So you filter out the wave and retain the DC. If the DC is positive you have one tone, if it is negative you have the other tone. THis approach looks like it would be quite effective for those cases where the baud rate is almost equal to the tone frequency, so there is barely more than a single period for a tone. However, I wonder how it would work if there was noise. For HF applications you can guarantee that there is noise and not white noise but signals produced both by electronic equipment throughout the world and natural means. White noise would probably not be a problem, but if a momentary signal were present, I don't know what would happen. Brian
> > Jerry > -- > Engineering is the art of making what you want from things you can get. > &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; >