DevTools Logo

Morse Spectrogram Decoder

Morse Spectrogram Decoder

Encode, visualize, synthesize, and decode Morse code locally

Morse encoder

Morse output

... --- ...

About

A deterministic client-side Morse utility supporting A–Z, numbers, punctuation, ITU WPM timing, 600 Hz sine synthesis, and a simple amplitude-threshold decoder.

Examples

SOS round-trip

Input
morseToText(textToMorse("SOS").morse)
Output
"SOS" ("... --- ..." in between)

Encoding then decoding returns the original letters through the code table.

WPM timing at 20 WPM

Input
calculateTiming("... --- ...", 20).ditSeconds
Output
0.06

1.2 / 20 gives a 60 ms dit; the full SOS spans about 1.62 seconds.

About this tool

Morse Spectrogram Decoder encodes text with textToMorse (alias encodeMorse): A–Z, 0–9, and punctuation map through MORSE_CODE, letters join with spaces, words with /, and unsupported characters are skipped with an Unsupported character warning.

Timing follows the ITU formula in calculateTiming(morse, wpm): ditSeconds equals 1.2 / wpm, dahs last 3 dits, intra-letter gaps 1 dit, letter gaps 3 dits, and word gaps 7 dits — every segment records kind, symbol, duration, and start offset with totalSeconds for the full message.

Audio round-trips stay in the browser: synthesizeMorse builds 8 kHz sine samples (configurable frequency, amplitude, WPM) with silence in the gaps, and decodeToneSequence re-derives morse from block energy before morseToText (alias decodeMorse) restores the text.

How to use this tool

  1. Encode text

    Pass plain text to textToMorse — read morse plus any unsupported-character warnings.

  2. Plan timing

    Call calculateTiming with the morse string and WPM to get dit length, segments, and total seconds.

  3. Synthesize audio

    Use synthesizeMorse with wpm, frequency, and sampleRate for Float32 samples plus timing metadata.

  4. Decode back

    Feed samples to decodeToneSequence (same WPM) or morse strings to morseToText for the text.

Use cases

Learning Morse timing

Visualize dit/dah/gap ratios at different WPM speeds before keying practice.

Generating practice audio

Synthesize deterministic sine tones for SOS drills and decoder tests.

Checking decoder output

Round-trip synthesized samples through the energy detector to verify settings.

Common mistakes

Mistake:Ignoring the warnings array on encode.

Fix:Characters like € have no code and are dropped — check warnings for each Unsupported character entry.

Mistake:Decoding with a different WPM than synthesis.

Fix:Dit thresholds scale with 1.2 / wpm, so pass the same WPM to synthesizeMorse and decodeToneSequence.

Frequently asked questions

What does this tool do?

It encodes text with textToMorse, times it with calculateTiming, synthesizes sine audio with synthesizeMorse, and decodes back with decodeToneSequence or morseToText.

What is the dit length at my speed?

ditSeconds is 1.2 / wpm — 0.06 s at 20 WPM — with dah 3 dits, letter gaps 3 dits, and word gaps 7 dits.

Is my message uploaded or stored?

No. Code-table lookup, timing math, synthesis, and energy detection run entirely in your browser.

Why did characters vanish, or decoding fail?

Unsupported characters are skipped with a warnings entry, and decodeToneSequence needs the same WPM used for synthesis to threshold dits correctly.

References & standards