Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old January 16th 05, 10:23 PM
 
Posts: n/a
Default PIC operated FSK modem

I'm interested in building a FSK modem around a PIC microcontroller,
and am wondering how most FSK receivers convert the frequency to bits.
I'm open to a unique solution, and I've seen some frequency to voltage
converters that may work, but would like to know what some current
techniques are that may be a lot more reliable and simpler.
Thanks in advance!
Dave

  #2   Report Post  
Old January 16th 05, 10:44 PM
Joel Kolstad
 
Posts: n/a
Default

wrote in message
oups.com...
I'm interested in building a FSK modem around a PIC microcontroller,
and am wondering how most FSK receivers convert the frequency to bits.


The cheap and sleazy route is what you see many people doing on PICs (and
similar) for DTMF detection: To detect a frequency F1, using your ADC's
digital output, multiply the digital word by sin(F1*t) and cos(F1*t).
Square and add the result, so that you have
(ADC_Out*sin(F1*t))^2+(ADC_Out*cos(F1*t))^2. Take the running average of
what you get, and use a threshold detector to decide whether or not that
frequency is prsent.

The 'cheap and sleazy' part of this comes in as follows:

1) Arrange the frequencies to be, e.g., F1 and F2=2*F1. Sample at 8*F1.
Now, all the sine and cosines become +/-1 -- no multiplier needed.
2) Use 'abs' rather than squaring the results -- no multiplier needed.

This isn't particularly robust (it fails rapidly if the input frequencies
are off -- the DTMF guys typically don't have to worry about this because
DTMF generation is very well controlled), but it gets the job done when you
have a relatively high SNR signal and it's very simple and fast to implement
since you've gotten rid of the multiplications.

For more narrowly spaced FSK detection, this still works, although you start
having to build up tables of sin/cosine values -- and perform the
multiplication. If you do have a hardware multiplier around in your
particular PIC, this is perhaps still the way to go. If not, you start
looking at what resources you do have... you can design more 'proper'
digital filters with coefficients of only +/-1 and zero, although sometimes
the implementation ends up being more CPU intensive than just doing software
multiplies.

Using a tool such as Matlab is very handy for trying our various
filtering/detectoin techniques prior to having to sit down and code up the
result in C or assembly for a system running in real time!

---Joel Kolstad


  #3   Report Post  
Old January 16th 05, 11:36 PM
Tim Wescott
 
Posts: n/a
Default

Joel Kolstad wrote:

wrote in message
oups.com...

I'm interested in building a FSK modem around a PIC microcontroller,
and am wondering how most FSK receivers convert the frequency to bits.



The cheap and sleazy route is what you see many people doing on PICs (and
similar) for DTMF detection: To detect a frequency F1, using your ADC's
digital output, multiply the digital word by sin(F1*t) and cos(F1*t).
Square and add the result, so that you have
(ADC_Out*sin(F1*t))^2+(ADC_Out*cos(F1*t))^2. Take the running average of
what you get, and use a threshold detector to decide whether or not that
frequency is prsent.

The 'cheap and sleazy' part of this comes in as follows:

1) Arrange the frequencies to be, e.g., F1 and F2=2*F1. Sample at 8*F1.
Now, all the sine and cosines become +/-1 -- no multiplier needed.
2) Use 'abs' rather than squaring the results -- no multiplier needed.

This isn't particularly robust (it fails rapidly if the input frequencies
are off -- the DTMF guys typically don't have to worry about this because
DTMF generation is very well controlled), but it gets the job done when you
have a relatively high SNR signal and it's very simple and fast to implement
since you've gotten rid of the multiplications.

For more narrowly spaced FSK detection, this still works, although you start
having to build up tables of sin/cosine values -- and perform the
multiplication. If you do have a hardware multiplier around in your
particular PIC, this is perhaps still the way to go. If not, you start
looking at what resources you do have... you can design more 'proper'
digital filters with coefficients of only +/-1 and zero, although sometimes
the implementation ends up being more CPU intensive than just doing software
multiplies.

Using a tool such as Matlab is very handy for trying our various
filtering/detectoin techniques prior to having to sit down and code up the
result in C or assembly for a system running in real time!

---Joel Kolstad


You could also do this by coding up the digital filters using only
shifts. This is not for the faint of heart if you haven't done DSP
before, but it can be done and should get you fairly good results. I'd
recommend prototyping the algorithm on a PC then making sure that you
have enough horsepower in your target processor before you start
building a board.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
  #4   Report Post  
Old January 17th 05, 08:40 AM
Paul Keinanen
 
Posts: n/a
Default

On Sun, 16 Jan 2005 15:36:09 -0800, Tim Wescott
wrote:

You could also do this by coding up the digital filters using only
shifts. This is not for the faint of heart if you haven't done DSP
before, but it can be done and should get you fairly good results.


With FIR filters and 100-200 bytes of RAM, the shifting needs to be
done only once when the sample arrives, by saving each intermediate
value after each shift into a table. When the next sample arrives, the
old sample table (instead of the original sample value only) is
shifted into the next position (tap) of the FIR. This shifting can be
done either by block copying or pointer arithmetics.

Since all taps in the FIR have access to all shifted versions of the
corresponding sample, all that needs to be done, is adding together
those values selected by the coefficient multiplier.

If the tap multipliers are constant and there are sufficiently ROM to
have a separate routine for each tap, the elements selected are known
at compile time, so you do not have to shift and test the multiplier.
Assuming the original sample value is in Shifted[0] and the left
shifted values in Shifted[1..7] and the sample value needs to be
multiplied e.g. by 19 (00010011) the multiply by 19 routine would be
similar to

Mul_19:

Add Shifted[0]
Add Shifted[1]
Add Shifted[4]
return

Thus,even if the processor lacks the multiply instruction, you only
need to make on average 4 additions (for 8 bit multipliers) at each
tap. However, the additions must be 16 bit wide for 8 bit samples and
coefficients.

Paul OH3LWR

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PIC operated FSK modem [email protected] Homebrew 4 January 21st 05 10:38 PM
PIC operated FSK modem [email protected] Homebrew 3 January 17th 05 08:40 AM
computer modem problem larry Digital 2 July 17th 04 07:24 PM
computer modem problem larry Digital 0 July 17th 04 04:01 PM
Hammarlund SP-600 how vernier tuning dials operated ? ik0jjz Boatanchors 2 April 16th 04 01:08 PM


All times are GMT +1. The time now is 08:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 RadioBanter.
The comments are property of their posters.
 

About Us

"It's about Radio"

 

Copyright © 2017