Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fastrgv authored Aug 1, 2021
1 parent e7d7e08 commit 96ce283
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ Type "7z x filename" to extract the archive.




# Morse Audio to Text Translator Using Ada: MATTA


**ver 1.0.1 -- 29feb2020**
* Added txt2wav
* Improved coding
* Initial version.
**ver 1.0.2 -- 03aug2021**

* The commandline parameter estimated WPM may now be [optionally] omitted if the morse code message is long enough to get meaningful timing statistics.

## Note: Please ignore the "Source code" zip & tar.gz files. (They are auto-generated by GitHub). Click on the large 7z file under releases to download all source & binaries (Windows,Mac & Linux). Then, type "7z x filename" to extract the archive.

**ver 1.0.0 -- 29feb2020**

* Initial version.


### GitHub Note: Please ignore the "Source code" zip & tar.gz files. (They are auto-generated by GitHub). Click on the large 7z file under releases to download all source & binaries (Windows,Mac & Linux). Then, type "7z x filename" to extract the archive.


## Description
Expand All @@ -35,8 +39,6 @@ The input wav file must be monaural, with a 16-bit signed integer encoding, and

Now includes an inverse commandline app, txt2wav that creates a morse code WAV file from English text.

The proper command to extract the archive and maintain the directory structure is "7z x filename".

--------------------------------------------------------
## Usage Examples

Expand All @@ -46,56 +48,51 @@ The user command requires the WAV file name, and integer-WPM estimate as input:

English text is then printed out to the screen.

Note that the precompiled executables use suffixes that indicates the system:
### Addendum1: WPM-estimate-parameter may now be optionally omitted IF the message is long enough to analyze.

.) _osx (MacOSX)
EG. wav2txt 40wpmAZ.wav

.) _gnu (linux)
### Addendum2: it is very cheap to try various WPM-estimates. Most messages are between 10 and 40 wpm.

### Addendum3: the Windows executable will work on your linux box if wine is installed.

Note that the precompiled executables use suffixes that indicates the system:
.) _osx (MacOSX)
.) _gnu (linux)
.) .exe (MsWin)

For example, let's say you use a Mac and have a friend with a Windows computer.

* txt2wav_osx creates a WAV file from given text on OSX;
* wav2txt.exe deciphers the WAV file on Windows.
* txt2wav_osx creates a WAV file from text on OSX.

* wav2txt.exe deciphers the WAV file on Windows.

--------------------------------------------------------------------------
The new inverse app takes a commandline string, which must be quoted to include spaces thusly:

txt2wav "the quick brown fox"

and creates an output WAV file, named "new20wpm.wav", with the morse code equivalent. This output file can be renamed and manipulated using sox.
and creates an output WAV file, named "new20wpm.wav", with the morse code equivalent. This output file can be renamed and manipulated using "sox", as follows.

To slow it down try:

sox new20wpm.wav new10wpm.wav speed 0.5

This also lowers the tone (from 500 to 250 Hz) so to restore the tone try:

This lowers the tone (from 500 to 250 Hz) so to restore the tone try:
sox new10wpm.wav hi10wpm.wav pitch +250

Too loud? Try

sox -v 0.8 hi10wpm.wav quiet10wpm.wav

Note that txt2wav is a cheap & dirty tool to create minimal test input files for wav2txt. The WAV headers might be illegal since they are blatantly copied from an existing WAV file. Nevertheless, "sox" and "soxi" seem to accept them. And if you are going to manipulate them with sox, the output of sox is probably legal.

========================================================
## How wav2txt Works:

A clean morse code sound file contains tonal beeps separated by periods of silence. After normalization, the sound wave peak amplitude is one, while the periods of silence have near zero peaks. The simple approach used here seeks to detect those changes in peak amplitude that signal dots, dashes, and spaces.

The (ideal) international morse code relative timings are defined as:

.) length of a dot = 1

.) length of a dash = 3

.) space after dot or dash = 1

.) space after a letter = 3

.) space after a word = 7

wav2txt is not perfect, but computer-generated sound files can be reliably decoded.
Expand All @@ -104,12 +101,17 @@ See also the inline code comments.

Final note: many good apps can easily be found to generate morse code sound files from text. One simple one is included (txt2wav) merely for the sake of completeness.

## Unresolved Question:

Can the requirement of an estimated WPM be dropped, somehow?


--------------------------
## Legal Mumbo Jumbo:
## License:

Covered by the GNU GPL v3 as indicated in the sources:

Copyright (C) 2020 <fastrgv@gmail.com>
Copyright (C) 2021 <fastrgv@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -123,3 +125,4 @@ Covered by the GNU GPL v3 as indicated in the sources:

You may read the full text of the GNU General Public License
at <http://www.gnu.org/licenses/>.

0 comments on commit 96ce283

Please sign in to comment.