Projects Log

projects, diy

Search:

« PreviousNext »

Useless Dichotomic Morse to Human converter

17 August 2007

I'm using the binary decision tree approach to convert Morse Code to "Human"

Here's a part of the tree (not complete)
Binary Tree

Lets decipher "— · —":
First mark is a dash -> next level and right node
Second mark is a dot -> next level and left node
Third mark is a dash -> next level and right node
"— · —" = K

use strict;

my $index;
while(<>)
{
chomp;
for(split / +/)
{
$index=0;
for(split //)
{

{
$index=($index+1)*2-1;
}

{
$index=($index+1)*2;
}
else
{
print " ";
$index=0;
}
}
print @morse_table[$index-1] if $index>0;
$index=0;
}
print $/;
}

Download this code: morse.pls

Archived in easy, perl, useless | Trackback | del.icio.us | Top Of Page

2 Responses to “Useless Dichotomic Morse to Human converter”

  1. Alan Says:

    Interesting. Is there still anything that uses Morse Code to transmit anything? It would be cool to transmit email messages to a reader using audible Morse Code and have your code "listen" to it and decode it.

  2. Kevin DEHLINGER Says:

    As far as i know Morse isn't very used anymore.
    I'm planing to build a hardware Morse transceiver (with a microphone and a speaker, and connected to a computer), but i don't know when i'm going to be able to start that. (a lot of projects to finish)