Go Down

Topic: Decoding FSk with SoftModem Arduino (Read 11096 times) previous topic - next topic

HUDIBRAS

I'm not sure this is the right place to start!

Using Arduino Uno 16MHz with SoftModem4, some question showed up.
Softmodem.h
The numbers for baudrate and high/low freq are these just calculated numbers?
------------arduino.h----------------
#define SOFT_MODEM_BAUD_RATE   (1225)

#define SOFT_MODEM_LOW_FREQ    (4900)

#define SOFT_MODEM_HIGH_FREQ   (7350)
#define SOFT_MODEM_MAX_RX_BUFF (32)
-------------------------------------------
Look at 1200 Baud normally is mark 1200hz and space 2200hz.

Cant get it to decode anything, setup with AIN half VCC+300mV DC Try changing baud to 1200 mark to 1200 space to 2200 makes no differens
FFT analyze of the FSK signal I want to decode shows peak at 1200hz and 2400hz (both almost same level) with a small spike at 2000hz (at about half level)

Would a soundsample help I'll attach it

retrolefty

SoftModem4 doesn't resolve to anything involving arduino using google that I could find. I assume it is an arduino library? A link to the library code would be useful.

Lefty


HUDIBRAS

Sorry I had the idea it was user commonly used

To get the librarie

http://code.google.com/p/arms22/downloads/detail?name=SoftModem-004.zip&can=2&q=


HUDIBRAS

Nothing much just iphone sample
#include <SoftModem.h>
//setup as breakoutboard with filter
//FSKOUT Pin 3
//FSKIN Pin 6
//AIN1 Pin 7

SoftModem modem;
int led = 13;
int x;

void setup ()
{
pinMode(led, OUTPUT);
Serial . begin (57600);
modem. begin ();
Serial . println ("Start");


void loop ()
{
while (modem. available ())
  { // iPhone is receiving data from the check
  //Serial . println ("Data in");
  int c = modem. read (); //1byte Lead
  if (isprint(c))
   {
   Serial . print ((char)c); //PC sends
   }
  else
   {
   Serial . print ("("); //Hex printable characters are displayed in
   Serial . print (c, HEX );
   Serial . print (")");
   x++;if (x==50) {Serial.println();//wrapping line
                  x=0;}//max
   }
  }
while ( Serial . available ())
  { //PC to make sure data is received from
  Serial . print ("Data out");
  char c = Serial . read (); //1byte Lead
  modem. write (c); //iPhone send
  Serial.println(c);
  }
}

HUDIBRAS

A shorter one, just got the Android App tonight, some other device to test on.
This one isn't tested yet.

#include <SoftModem.h>
#include <ctype.h>

SoftModem modem;

void setup()
{
  Serial.begin(57600);
  delay(1000);
  modem.begin();
}

void loop()
{
  while(modem.available())
  {
    int c = modem.read();
    Serial.write(c);
  }
  while(Serial.available())
  {
    char c = Serial.read();
    modem.write(c);
  }
}

el_supremo

I can't get it to compile with V1.0

Pete

HUDIBRAS

Strange, and V2? I can't attach a sample 500K is too much


HUDIBRAS

V2 off my code, that actually works.

el_supremo

#10
Jan 10, 2012, 05:27 pm Last Edit: Jan 10, 2012, 05:36 pm by el_supremo Reason: 1
OK post V2 of your code. I'd like to try it.

Pete
P.S. I was talking about V1.0 of the IDE. The library doesn't compile.

HUDIBRAS

Then you can't compile the second post off code either.
Haven't tried V1 off IDE yet, shouldn't be to complex, I'll hear about it later this evening.

HUDIBRAS

What failure do you get, some thing like 'virtual size_t Print::write(uint8_t)' overwritten? caused by void write(uint8_t data);

In mean time I found out that the signal i wanted to decode is rather speciel.
Before any transmission no matter length (any amount of bytes transmitted) it starts with 14mS SPACE (2200hz) followed by data. Pause indicated MARK (1200Hz) most off time.

I have to modify Softmodem.cpp grab the 14mS before decoding takes place.

HUDIBRAS

#13
Jan 17, 2012, 02:41 am Last Edit: Jan 17, 2012, 02:44 am by HUDIBRAS Reason: 1
Here is a sample of fsk timing from OLS

Baz0unga

Hi there,

I am interested in using SoftModem lib to build a FSK demodulator for a particular application.
In this application, the FSK modulation can not be modified and uses 900Hz/1500Hz as tones for a baudrate of 600 bauds.

As i see in the lib documentation, the presets frequencies are quite different and before going further i wonder if anyone using this lib has ever tried or succeeded to use different tones.

Cheers,
Baz.

Go Up