Seeking for help/guidance with teensy4.0 & audiobreakoutboard for Atis decoding.

Status
Not open for further replies.

Danny123

Member
Hi Team,
I was looking into decoding the Atis code but am having a hard time figuring out if this is possible with this setup?
(i guess it should be possible)

the idea is, if this code is recieved > display it on a small oled screen.

this piece of data is been transmitted as soon as one releases its ptt-button of his Vhf-radio, and is used by vessels in the Netherlands. it sounds a bit like a burst of noise, but if one has a radio or software that is cappable of decoding it should look like PA1234 (example)
i also belive the correct name for these type of transmissions is Afsk? and thought that in the HAM-operators world is still beeing used (perhaps on different frequencies)

I also found a site that was very helpfull :
https://www.qsl.net/pa2ohh/13atisrxnl.htm
but beeing still new in the programming world, and this is written in phyton, i coulndt see or act to it, to make anything from it, and to convert it to the teensy.
also i coulndt get the software running to check if it worked.

Maybe there are some Ham-operators here @ the forum that have some tips,

I have a small testrig, reciever is basic : Motorola DM2600 with its audio output to the teensy line-input, Atis-radio is the Icom IC-37, this one is programmed with Atis of coarse :)

so i am not shure were to go from here, signals are comming in, with an fft sketch loaded in the teensy (Examples > Audio > hardwareTesting > Fft)

Thnx in Advance,

Yours
Danny
 
Hi Team,
So a bit of researche time has passed, and am a (tiny) bit further in this quest. but of coarse still a long way to go :)

So ive managed to correctly read fsk signals with the Arduino uno, and reading from its serial monitor.
Kept everithing as standard as possible for this question because i am not sure where to change the settings to read out my own fsk signal, this has different tones than these for testing purposses.

I am using the Softmodem.h from Arm22, and built my own input circuit, also ive found a piece of code that i could save as a web-site, that generates fsk signals (al found when browsing from Arm22, nice to give him some credits for it)

so this works, with a bit of dialing-in with the potentiometer.
But this "testing" signal is what i believe way to fast in reference with my own generated fsk signal.
I would like to decode the Atis signal, that has 2 tones low = 1300, high = 2100, and baud =1200,

but when i set the setting so that all of these files (like ccp and H files) are matched, i can read anything logical out of it. i guess i am overlooking somthing, or somepiece.

Any help is much apriciated.

WEBbrowser-test-fsk-code (paste notepad > save as html)
Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FSK Serial Generator in JavaScript for SoftModem board</title>
<script type="text/javascript">
function $(name) {
	return document.getElementById(name);
}
function chr8() {
	return Array.prototype.map.call(arguments, function(a){
		return String.fromCharCode(a&0xff)
	}).join('');
}
function chr16() {
	return Array.prototype.map.call(arguments, function(a){
		return String.fromCharCode(a&0xff, (a>>8)&0xff)
	}).join('');
}
function chr32() {
	return Array.prototype.map.call(arguments, function(a){
		return String.fromCharCode(a&0xff, (a>>8)&0xff,(a>>16)&0xff, (a>>24)&0xff);
	}).join('');
}
function toUTF8(str) {
	var utf8 = [];
	for (var i = 0; i < str.length; i++) {
		var c = str.charCodeAt(i);
		if (c <= 0x7f)
			utf8.push(c);
		else if (c <= 0x7ff) {
			utf8.push(0xc0 | (c >>> 6));
			utf8.push(0x80 | (c & 0x3f));
		} else if (c <= 0xffff) {
			utf8.push(0xe0 | (c >>> 12));
			utf8.push(0x80 | ((c >>> 6) & 0x3f));
			utf8.push(0x80 | (c & 0x3f));
		} else {
			var j = 4;
			while (c >>> (6*j)) j++;
			utf8.push(((0xff00 >>> j) & 0xff) | (c >>> (6*--j)));
			while (j--) 
				utf8[idx++] = 0x80 | ((c >>> (6*j)) & 0x3f);
		}
	}
	return utf8;
}


var dataURI, audio;
function generate(str) {
	if (str.length == 0) return;
	var utf8 = toUTF8(str);
	//console.log(utf8);
	
	var sampleRate = 58800;
	var baud = 1225;
	var freqHigh = 7350;
	var freqLow  = 4900;
	var spb = sampleRate/baud; // 24 samples per bit
	var preCarrierBits = Math.ceil(sampleRate*40/1000/spb); // 49 bits
	var postCarrierBits = Math.ceil(sampleRate*5/1000/spb); // 6.125 bits => 7 bits
	var size = (preCarrierBits + postCarrierBits + 10*utf8.length) * spb;

	var data = "RIFF" + chr32(size+36) + "WAVE" +
			"fmt " + chr32(16, 0x00010001, sampleRate, sampleRate, 0x00080001) +
			"data" + chr32(size);
	
	function pushData(freq, samples) {
		for (var i = 0; i < samples; i++) {
			var v = 128 + 127 * Math.sin((2 * Math.PI) * (i / sampleRate) * freq);
			data += chr8(v);
		}
	}
	pushData(freqHigh, preCarrierBits*spb);
	for (var x in utf8) {
		var c = (utf8[x] << 1) | 0x200;
		for (var i = 0; i < 10; i++, c >>>= 1)
			pushData((c&1) ? freqHigh : freqLow, spb);
	}
	pushData(freqHigh, postCarrierBits*spb);
	
	if (size+44 != data.length) alert("wrong size: " + size+44 + " != " + data.length);
	
	dataURI = "data:audio/wav;base64," + escape(btoa(data));
	audio = new Audio(dataURI);
	audio.play();
	
	$('jmp').disabled = false;
}
</script>
</head>

<body>

<h1>FSK Serial Generator in JavaScript for SoftModem board</h1>

<p>You can send data to the SoftModem breakout board for Arduino using JavaScript in this page.<br>
This works in data-uri audio and HTML5 ready browsers (Firefox, Safari, Opera).</p>

<p><b>About SoftModem: </b>
<a href="http://code.google.com/p/arms22/wiki/SoftModemBreakoutBoard">http://code.google.com/p/arms22/wiki/SoftModemBreakoutBoard</a></p>


<form onsubmit="generate($('data').value); return false;">
Text: <input type="text" id="data" size="40" value="Hello!">
<input type="submit" value="Generate and Send">
<input type="button" value="Jump to Audio data" id="jmp" disabled="true" onclick="location.href=dataURI">
</form>
</body>

</html>


The code For the arduino :
Code:
#include <SoftModem.h>

SoftModem modem = SoftModem();

// Aanpassingen gedaan in deze naar serial 9600, ook aangepast in softmodem.h lib zelf

void setup() {
  Serial.begin(115200);
  Serial.println("Booting");
  delay(100);
  modem.begin();
}

void loop() {  
  while(modem.available()){
    int c = modem.read();
    if(isprint(c)){
      Serial.print((char)c);
    }
    else{
      Serial.print("(");
      Serial.print(c,HEX);
      Serial.println(")");      
    }
  }
  if(Serial.available()){
    modem.write(0xff);
    while(Serial.available()){
      char c = Serial.read();
      modem.write(c);
    }
  }
}


The Gidhub site with aditional information on how to set this up, and the Library :
https://github.com/arms22/SoftModem


Didnt found a way to paste my audio file in here, so a short description :
This is a piece of data thats been transmitted as soon as the radio-user releases its ptt-button or ends his call,
i found a bit of information here : http://www.wavecom.ch/content/ext/DecoderOnlineHelp/default.htm#!worddocuments/atis.htm

as i am vased in the netherlands, i would love to decode this bit of data and see if i could make it visible on this platform of arduino.
Any tips or advice is welcome , it looks that i cant tweak the Softmodem to this frequencies.

Yours
Danny
 
Status
Not open for further replies.
Back
Top