commit e6eda009c810fbb3c279e937f1fddf989739fe69
parent fb617a891e2a2c0a8193182f625fc77a23646145
Author: Eamon Caddigan <eamon.caddigan@gmail.com>
Date: Mon, 25 Dec 2023 16:08:32 -0800
December Adventure, day 25
Diffstat:
1 file changed, 76 insertions(+), 0 deletions(-)
diff --git a/content/december-adventure/2023-25/index.md b/content/december-adventure/2023-25/index.md
@@ -0,0 +1,76 @@
+---
+title: "2023, Day 25"
+date: 2023-12-25T16:07:25-08:00
+draft: false
+katex: true
+---
+
+As I [already mentioned]({{< ref "2023-12" >}}), Morse Code encodes
+characters with signal duration: a message is composed of "dits" (short
+elements), "dahs" (long elements), and the pauses between them. Currently, I
+am dealing with these pauses.
+
+There are three kinds of pauses to think about: the pause between the dits
+and dahs that comprise a single character (the inter-element pause), the
+pause between characters in a word, and the pause between those words.
+
+The relationship between these units has been standardized; taking a dit as
+one unit:
+
+* A dah is three units
+* The pause between elements is one unit
+* The pause between characters is three units
+* The pause between words is seven units
+
+Since I'm working on a program to help learn Morse Code, it makes sense to
+start by presenting messages and a slower rate, eventually working up to the
+20 words per minute (WPM) speed that I'd like to reach[^20wpm]. But simply
+slowing down the entire transmission---longer dits, longer dahs, and longer
+pauses---leads to a well-recognized problem: at higher transmission speeds,
+people perceive Morse characters by pattern and not by counting dits and
+dahs, and slowing everything down prevents people from learning how to do
+this.
+
+[Farnsworth Timing](http://www.arrl.org/files/file/Technology/x9004008.pdf)
+addresses this. The timing of the dits, dahs, and inter-element pauses in a
+character are determined by a "character speed" (usually 18 WPM when
+practicing), and the pause between characters and words is adjusted to achieve
+a specified "transmission speed".
+
+These values are derived in the paper I linked above, but I'm copying them
+here for reference. For the following speeds (in words per minute):
+
+* _c_: character speed
+* _s_: transmission speed
+
+Then the following durations (in seconds) are given as:
+
+* One "unit" (for dits, dahs, and inter-element pauses)
+
+$$ u = \frac{1.2}{c} $$
+
+* Pause between characters
+
+$$ t_{c} = \frac{3}{19} \left( \frac{60}{s} - \frac{37.2}{c} \right) $$
+
+* Pause between words
+
+$$ t_{w} = \frac{7}{19} \left( \frac{60}{s} - \frac{37.2}{c} \right) $$
+
+## Implementing this in uxn
+
+Before the [changes to the audio device]({{< ref "2023-18" >}}), the only
+way to start and stop playback in uxn was through the screen device, which
+supports a temporal resolution of 1/60 s (~16.7 ms). After plugging a
+reasonable range of speeds into the above formulas, it seems like this would
+actually be sufficiently accurate for Morse Code playback. I believe that
+the new audio device's `duration` port supports resolutions of approximately
+5.8 ms (256 samples / 44100 Hz), but it's trickier to play silences.
+
+I haven't decided whether to use the screen or audio device to handle
+playback. I'm pretty sure the next step is to try coding this up.
+
+[^20wpm]: This was the speed that was once required for the Amateur Extra
+ Class license, the most advanced ham radio license in the US. The FCC
+ has done away with the Morse Code requirement, but this feels like a
+ good speed to target.