information theory - Is Morse Code binary, ternary or quinary? - Computer Science Stack Exchange Is Morse Code binary, ternary or quinary? up vote 18 down vote favorite 6 I am reading the book: " Code: The Hidden Language of Computer Hardware and Software " and in Chapter 2 author says: Morse code is said to be a binary (literally meaning two by two) code because the components of the code consists of only two things - a dot and a dash. Wikipedia on the other hand says: Strictly speaking it is not binary, as there are five fundamental elements (see quinary). However, this does not mean Morse code cannot be represented as a binary code. In an abstract sense, this is the function that telegraph operators perform when transmitting messages (see quinary). But then again, another Wikipedia page includes Morse Code in 'List of binary codes.' I am very confused because I would think Morse Code actually is ternary. You have 3 different types of 'possibilities': a silence, a short beep or a long beep. It is impossible to represent Morse Code in 'stirct binary' isn't it?

By 'strict binary' I mean, think of stream of binary: 1010111101010.. How am I supposed to represent a silence, a short beep and / or a long beep? Only way I can think of is 'word size' a computer implements. If I (and the CPU / the interpreter of the code) know that it will be reading 8 bits every time, then I can represent Morse Code. I can simply represent a short beep with a 1 or a long beep with a 0 and the silences will be implicitly represented by the word length.(Let's say 8 bits..) So again, I have this 3rd variable/the 3rd asset in my hand: the word size. My thinking is like this: I can reserve the first 3 bits for how many bits to be read, and last 5 bits for the Morse code in a 8bit word. Like 00110000 will mean 'A'. And I am still in 'binary' BUT I need the word size which makes it ternary isn't it? The first 3 bits say: Read only 1 bit from the following 5 bits.

Instead of binary, if we use trinary, we can show morse code like: 101021110102110222 etc.. where 1 is: dit 0 is: dah and 2 is silence. By using 222 we can code the long silence, so if you have a signal like *- *--- *- you can show it like: 102100022210, but it is not directly possible using only with 1's and 0's UNLESS you come up with something like a 'fixed' word size as I mentioned, but well this is interpreting, not saving the Morse Code as it is in binary. Imagine something like a piano, you have only the piano buttons. You want to leave a message in Morse Code for someone and you can paint buttons to black. There is no way you can leave a clear message, isn't it? You need at least one more color so you can put the silences (the ones between characters and words. This is what I mean by trenary. I am not asking if you can represent Morse Code in 57-ary or anything else.

I have e-mailed the author (Charles Petzold) about this; he says that he demonstrates in Chapter 9 of "Code" that Morse Code can be interpreted as a binary code. Where am I wrong with my thinking? Is what I am reading in the book, that the Morse Code being a Binary a fact or not? Is it somehow debatable? Why is Morse Code is told be quinary in one Wikipedia page, and it is also listed in List of Binary Codes page? Edit: I have e-mailed the author and got a reply: -----Original Message----- Sent: Tuesday, March 3, 2015 3:16 PM To: cp@charlespetzold.com Subject: Is Morse Code really binary? Sir, could you take a look at my question here: Is Morse Code binary, ternary or quinary? quinary ? Regards, Koray Tugay Subject: RE: Is Morse Code really binary? Date: 3 Mar 2015 23:04:35 EET Towards the end of Chapter 9 in "Code" I demonstrate that Morse Code can be interpreted as a binary code.

-----Original Message----- Sent: Tuesday, March 3, 2015 3:16 PM To: cp@charlespetzold.com Subject: Is Morse Code really binary? Sir, could you take a look at my question here: Is Morse Code binary, ternary or quinary? quinary ? Regards, Koray Tugay I am not hiding his e-mail as it is really easy to find on the web anyway. Please move any further conversation to chat.stackexchange.com/rooms/21638/… – Wandering Logic Mar 4 '15 at 16:15 Comments are not for extended discussion; this conversation has been moved to chat . – Raphael♦ Mar 5 '15 at 8:16 I fixed the links I accidentally deleted (whoops); please refrain from any more rolling back to worse revisions. – Raphael♦ Mar 5 '15 at 9:05 1 @WanderingLogic The correct, most effective and noise-free approach is to silently flag the question for comment cleanup and suggest comments be moved to chat in the flag, not to publicly play comment police and attempt to create a chat room to combine all comments on all answers with no context.

Your links also now just confuse the matter since Raphael has posted correct links. – Jason C Mar 5 '15 at 9:49 1 @J.-E.Pin Well, I did not give a formal definition because I took for granted that people answering the question would know that, and I did have a reference or two to wikipedia to set the context. Even if wikipedia can be far from perfect, this should be able to take the role of definitions, as often done here. It took me some time to realize that it was the problem, actually apparently widespread. I was myself in the process of rewriting it all at length, with explicit definitions, quotes, references and formal explanations with injective homomorphisms. Should I finish? – babou Mar 7 '15 at 20:28 up vote 12 down vote accepted +150 Morse code is a prefix ternary code (for encoding 58 characters) on top of a prefix binary code encoding the three symbols. This was a much shorter answer when accepted. However, considering the considerable misunderstandings between users, and following a request from the OP, I wrote this much longer answer. The first "nutshell" section gives you the gist of it.

Contents Conclusion In a (big) nutshell When asking "Is Morse Code binary, ternary or quinary?" there is no comparing possible answers unless one fixes some criteria for an acceptable answer. Indeed, without proper criteria, one can contrive explanations for nearly any kind of structure. The criteria I have chosen are the following: it should reflect the three-tiered description of Morse-code with the dot/dash representation in the second tier; it should fit the presentation and mathematical tools developed for the theoretical analysis of codes, as much as possible; it should be as simple as possible; it should clearly make apparent the properties of the Morse code. This is intended to preclude arbitrary hacking, that ignores basic concepts of code theory as scientifically studied, and which may have some appeal by giving an illusion of systematic analysis, though addressed too informally to be conclusive. This site is supposed to be about computer science, not programming. We should use a minimum of established science and accepted concepts to answer a technical question. A quick analysis of the standard shows that all symbols used in Morse code are ultimately coded in binary, since it is transmitted as a string of units of equal length, whith a signal that can be on or off for each unit.

This indicates that Morse messages are ultimately coded in a logical alphabet $\Sigma_1=\{0,1\}$. But that says nothing of the internal structure of the code. The information to be encoded is a string on an alphabet of 58 symbols (according to the standard) including 57 characters and a space. This corresponds to an alphabet $\Sigma_3=\{A,B,\dots,Z,0,1,\dots,9,?,=,\dots,\times,@,[\;]\}\;$, the last symbl being the space. However, the standard specifies that there is an intermediate alphabet $\Sigma_2$, based on dot and dash and possibly other symbols.

It is quite clear that strings in $\Sigma_3^*$ are to be coded as strings in $\Sigma_2^*$, and that strings in $\Sigma_2^*$ are to be coded as strings in $\Sigma_1^*$ So, given that there is no choice for $\Sigma_1$ and $\Sigma_3$, the question must be understood as: "What number of symbols should we consider in the intermediate alphabet $\Sigma_2$ so as to best axplain the structure and the properties of the whole Morse code," which also entails specifying the two encodings between the three levels.

Given the fact that the Morse code is a prefix homomorphic (variable length) code that precludes any ambiguity when decoding a signal, we can explain simply this essential property with a ternary alphabet $\Sigma_2=${dot, dash, sep}, and two coding scheme $C_{3\to 2}$ from $\Sigma_3$ to $\Sigma_2$, and $C_{2\to 1}$ from $\Sigma_2$ to $\Sigma_1$, which are both homomorphic and prefix, thus both unambiguous codes, and thus able to be composed to give an unambiguous prefix encoding of the 58 symbols into binary.

Hence Morse code is composed of a prefix ternary code expressed in the alphabet $\{$ dot, dash, sep $\}$**, with these three symbols themselves encoded in binary** with the following codewords: dot $\to 10$, dash $\to 1110$, and sep $\to 00$ Note that what is known as the space between consecutive dot or dash is actually included in the representation of dot and dash, as this is the usual mathematical representation for such types of codes, which are usually defined as string homomorphisms from source symbols to codewords expressed with target symbols, as I just did. This departs a little from some of the presentation given in the standard, which aims more at specifying intuitively the code for users, rather than at analysing it for its structural properties. But the encoding is the same in both cases. Even without the precise timings of the standard, a decoder of the analog signal could still translate it into the ternary alphabet we suggest, so that the above understanding of the ternary code would still be valid.

Codes: basic points This answer is based on the Standard ITU-R M.1677-1 , dated October 2009 (thanks to Jason C for the reference). I shall use the terminology dot and dash, rather than dit and dah, as it is the terminology used by this standard. Before we start discussing the Morse code, we need to agree on what a code is. The difficult discussions on this question obviously requires it. Fundamentally, information needs to be represented in order to be transmitted or otherwise processed. A code is a system to translate information from one system of representation into another. This is a very general definition. We must be careful not to confuse the concept of a representation, and that of a code from one representation (the source) to another (the target). A representation can take many forms, such as variable electric voltage, colored dots on paper, string of characters, numerals, binary strings of 0's and 1's, etc. It is important to distinguish between analog and formal (or logical, or abstract) representation. An analog/physical representation is a drawing, a varying voltage level, a shape (for a letter).

A logical/formal/abstract representation is a mathematical representation with abstract graphs, strings of symbols, or other mathematical entities. Though some information may originally be analog, we usually convert it to a logical representation so as to be able to define precisely its processing by mathematical means, or by people. Conversely, we dealing with logical representation using physical devices, such as computer or transmitters, we need to give an analog form to the logical representation. For the purpose of this analysis, the only analog form we consider is that used for transmission, as described in the standard. But even then, we will consider that the first step is to interpret this analog representation as a direct implementation of an identically structured logical representation, on which we build our analysis of what kind of code Morse code may be. Code theory is a mathematical body of knowledge based on the analysis of logical representations. However we shall come back on the analog/logical transition in the discussion at the end. Codes: definitions Our logical view is that the code is used to translate sources strings on an source alphabet $S$ to a target alphabet $T$.

It is often the case that both alphabets are identical, usually binary, when the purpose is to add some extra property to the representation of information, such as making it more resistant to errors (error detection and correction), or making the representation smaller by removing redundancy (lossless code compression) and possibly with carefully controled loss of some information (lossy compression). However, the purpose of Morse code is to provide only a way to represent strings on a large alphabet, into strings based on a much smaller alphabet (actually binary), using an intermediate alphabet almost binary (dots and dashes) to better adapted to human perception and manipulative abilities. This is achieved by what is called variable-length code : Using terms from formal language theory, the precise mathematical definition is as follows: Let $S$ and $T$ be two finite sets, called the source and target alphabets, respectively. A code $C: S \to T^*$ is a total function mapping each symbol from $S$ to a sequence of symbols over $T$, and the extension of $C$ to a homomorphism of $S^*$ into $T^*$, which naturally maps each sequence of source symbols to a sequence of target symbols, is referred to as its extension.

We call codeword the image $C(s)\in T^*$ of a symbol $s\in S$. A variable-length code $C$ is uniquely decodable if the corresponding homomorphism of $S^*$ into $T^*$ is injective . That means that any string in $T^*$ can be the image of at most one string in $S^*$. We also say that the code is unambiguous, meaning that any string can be unambiguously decoded, if at all. A variable-length code is a prefix code if no codeword is the prefix of another. It is also alled instantaneous code, or context-free code. The reason for these names is that, when reading a target string that begins with a codeword $w$ of a prefix code, you recognize the end of the codeword as soon as you read its last symbol, without having to know/read the next symbol. As a consequence, prefix codes are unambiguous and very easy to decode fast. It is easily shown that unique decodability and the prefix property are closed under composition of codes. Note that the definition as a homomorphism implies that there is no special separation between codewords.

It is their structure, such as the prefix property, that allows identifying them unambiguously. Indeed, if there were such separation symbols, they would have to be part of the target alphabet, since they would be necessary to decode string from the target alphabet. Then it would be quite simple to revert to the theoretical model of variable-length code by appending the separator to the preceding code word. If that were to raise contextual difficulty (due for example to multiple separators), that would only be a hint that the code is more complex than apparent. This is a good reason to stick to the theoretical model described above. The Morse code The Morse code is described in the standard at three levels: 3 . it is intended to provide an encoding of natural language text, using 57 characters (27 letters, 10 digits, 20 synbols and ponctuations) and an inter-word space to cut the character string into words. The inter-word space is used like a special character, that can be mixed with the others, which I shall note SEP. 2 .

all of these characters are to be encoded as successions of dash and dot, using an inter-letter space, which I shall note sep, to separate the dash and dot of one letter from those of the next letter. 1 . The dash and dot, as well as sep are to be encoded as signal or absence of signal (called spacing) with length precisely defined in terms of some accepted unit. In particular, the dash and dot encoding a letter must be separated by an inter-element space, that I shall note σ. This already calls for a few conclusions. The message to be transmitted and received in analog form is a successions of length units (space length or time length), such that a signal is on of off for the whole duration of each unit as specified in the Annex 1, Part I, section 2 of the standard : 2 Spacing and length of the signals 2.1 A dash is equal to three dots. 2.2 The space between the signals forming the same letter is equal to one dot. 2.3 The space between two letters is equal to three dots. 2.4 The space between two words is equal to seven dots.

This is clearly an analog encoding in what is known as a bit stream, which can be logically represented in binary notation by a string of 0 ans 1, standing for the analog off and on. In order to abstract away issues related to analog representation, we can thus consider that Morse code messages are transmitted as bit strings, that we shall note with 0 and 1. Hence the the above excerpt from the standard can be expressed logically as: 0 . A dot is represented by 1. 1 . A dash is represented by 111. 2 . An inter-element space σ is represented by 0. 3 . An inter-letter space sep is represented by 000. 4 . An inter-word space SEP is represented by 0000000. So we could see Morse code as using 5 code words in binary to encode these 5 symbols. Except for the fact that this is not quite how the system is described, there is some more to it, and it is not the most convenient way it can be thought of, from a naive or a mathematical point of view. Note also that this description is intended for laymen, not code theory specialists.

For that reason it describes more the visible appearance than the internal structure that justifies it. It has no reason to preclude other descriptions that are compatible with this one, though mathematically more structured, to emphasize the properties of the code. But first, we should note that the complete description of the code involves 3 levels of representation, immediately recognizable: 3 . The text, composed of a string of characters, including SEP. 2 . The encoding of a letter string as a string of dot, dash and sep. 1 . The encoding of a level 2 string of these three symbols as a binary string. We may possibly discuss as to what symbols is encoded in what, but it is an essential aspect of Morse code that it has these three levels of representation, with characters at the top, dots and dashes in the middle, and bits 0 and 1 at the bottom. This implies that there are necessarily two codes, one from level 3 to level 2, and the other from level 2 to level 1. Analysing the three levels of representation In order to have a consistent analysis of this 3-tiers coding system, we should first analyse what kind of information is relevant at each level. 1 .

The bit string, by definition, and by necessity of its analog representation, is composed only of 0 and 1. 3 . At the text level, we need and alphabet of 58 symbols, including the 57 characters and the inter-word space SEP. All 58 of them have to have ultimately a binary encoding. But, though the Morse code standard specifies these 57+1 characters, it does not specifies how they should be used to encode information. That is the role of English and other natural languages. The Morse code provides other system with an alphabet of 58 symbols, on which they could build some 58-ary code, but Morse code is not itself a 58-ary code. 2 . At the dot and dash level, all we need is these two symbols in order to code the 57 characters, i.e. provide a codeword for each as a string of dot and dash, together with some separator sep to mark when one letter finished, and another start. We also need some means of encoding the inter-word space SEP. We might try to provide for it directly at leavel 1, but this would mess-up the otherwise tier-structured organization of the code.

Indeed, the description of the standard might rightly be criticized for doing just that. But the authors may have thought that their presentation would be simpler to grasp for the average user. Also it follows a traditional description of Morse code, that predates this kind of mathematical analysis. This calls for several remarks: at level 3, the letter level, the inter-letter space sep is no longer meaningful. This is quite normal, since it has no more meaning in the universe of letters than the space separating two written characters on paper. It is necessary at level 2 to recognize codewords representing the letters, but that is all. similarly at level 2, the inter-element space σ is no longer meaningful. It has no meaning in the world of dot and dash, but is only necessary at level 1 to identify the binary code words representing dot, dash. But at level 1, it is not distinguishable from the bit 0. So the inter-element space σ is no longer anything special. It is just one use of 0.

However, as explained previously, if the code $\Sigma_2^*\to\Sigma_1^*$ is to be analyzed using knowledge of variable length codes, separators should be appended into the codewords they follow, so as to define the code as a simple string homomorphism. This implies the following partial specification of the code: dot$\to$`10` and `dash`$\to$1110 The level 2 alphabet $\Sigma_2$ needs at least one other symbol, the inter-letter space noted sep, which should be 000 according to the letter of the standard. However, the definition of the variable length code as a homomorphism required appending the inter-element space 0 to each codeword for dot and dash. Hence we must have only 00 as codeword for sep, so that toghether with the ending 0 from the preceeding dot or dash, it makes 3 0 as required by the standard. This always work since there is no provision in the standard for having two inter-letter separators following each other.

This is enough to encode the alphabet $\Sigma_2=${dot, dash, sep} with a homomorphic code $C_{2\to 1} : \Sigma_2\to\Sigma_1^*$ defined as follow: dot$\to$10 dash$\to$1110 sep$\to$00 And we have the good surprise to discover that no codeword is a prefix of another. Hence we have a prefix code, which is unambiguous and easy to decode. We can now proceed similarly to define the code $C_{3\to 2}: \Sigma_3\to\Sigma_2^*$. The standard uses strings of dot and dash as codewords for the characters in $\Sigma_3$, in the way given by the tables of the standard for example dot dot dash dot to represent the letter $f$. Again, these codewords are separated by inter-letter spaces. In order to define the code as a homomorphism, we must include the separator in the codewords, so that the definition of the homomorphism becomes rather: $f\to$ dot dot dash dot sep This applies to each of the 57 characters in the alphabet $\Sigma_3$.

But again we also need the word separator SEP, which, according to the standard, is 0000000. We first note that already 3 bits 0 are provided by the code, 2 by the sep that ends the last letter of the word, and 1 by the 0 bit that end the last dot or dash of the encoding of that last letter. Hence SEP must ultimately be coded as the remaining 0000. But to respect the tiered approach, SEP should be encoded in some codeword from $\Sigma_2^*$. Since sep is binary encoded as 00, it follow that SEP can be encoded as sep sep. Hence we can encode the alphabet $\Sigma_3=\{A,B,\dots,Z,0,1,\dots,9,?,=,\dots,\times,@,$ SEP$\}$, with a homomorphic code $C_{3\to 2} : \Sigma_3\to\Sigma_2^*$ defined as follows: $A \to$ dot dash sep $B \to$ dash dot dot dot sep ... $Z \to$ dash dash dot dot sep ... $7 \to$ dash dash dot dot dot sep ...

SEP $\to$ sep sep (for the word separator) And we have the further surprise to see that no codeword is a prefix of another. Hence the code $C_{3\to 2}$ is a prefix code too. Since the prefix property is closed under composition of codes, the Morse code $C_{Morse}= C_{2\to 1}\circ C_{3\to 2}$ is a prefix code. We can thus conclude that the Morse code can be understood, and easily analyzed, as the composition of a prefix binary encoding of a 3 symbols alphabet {dot, dash, sep} into a binary alphabet, and a prefix encoding of a 58 symbol alphabet (57 characters and one space) into the 3 letters alphabet. The composition itself is a prefix encoding of the 58 symbols into a binary representation. Remarks on this analysis. It is always difficult to establish that a presentation of a structure is the best one can come up with. It seems however that the above analysis meets the criteria set up at the beginning of this answer: closeness to the 3-tiered definition, formally presented according to current coding theory, simplicity, and evidencing the main properties of the code.

Note that there is little point in looking for error correction properties. The Morse code may not even detect a single bit error as it may simply change two dot into one dash. However, it causes only local errors. Regarding compression, the ternary encoding was designed to approximately reduce the number of dots and dashes, in an approximative kind of Huffman coding . But the two composed codes could easily be made denser. Regarding the size of alphabets, there is no choice for the binary and the 58 symbols alphabet. The intermediate alphabet could contains more symbols, but what would be the purpose? However, some people would be inclined to recognize the space DET at level 2, thus making the alphabet quaternary, then using it directly at level 3, encoded as itself in level 2. This would meet the standard definition, for DET encoded in binary as 0000. But it would prevent the analysis of the binary encoding $C_{2\to 1}$ as a prefix code, making it harder to show that $C_{Morse}$ is a prefix code, hence unambiguous. Indeed, such a choice would make the binary string 0000 ambiguous, decodable as either SEP or as sep sep.

The ambiguity would have to be resolved with a contextual rule that sep cannot follow itself, making the formalization more complex. The importance of analog to logical transition. This analysis relies heavily on the fact that the decomposition of the on/off signal into units of equal lengths indicates clearly an analog representation of a binary string. Furthermore, the lengths in units are exactly right for the above analysis, which seems unlikely to have happened by chance (though it is possible). However, from a (too cursory) look at the original patent 1647 , it does not seem to have been that precise, with sentences such as (on top of page 2): The sign of a distinct numeral, or of a compound numeral when used in a sentence of words or of numerals, consists of a distance or space of separation between the characters of greater extent than the distance used in separating the characters that compose any such distinct or compound numeral. People who were later sending by hand or receiving by ear were also unlikely to be that precise either. Indeed, their fist , i.e. their timing, was often recognizable. This view is also supported by the fact that spacing lengths are not always respected , particularly when learning Morse code.

These situations correspond to an analog view of the code as short signal (dot), medium signal (dash), and short, medium and long pause. Direct transposition into a logical alphabet would naturally give a quinary alphabet, into which the 58 symbols have to be coded. This of course is no longer a 3-tiered presentation of the Morse code. However, in order to make sense (and possibly avoid ambiguity), this alphabet should be used with the constraint that two signal symbols (dot or dash) cannot follow each other, and that pause symbols cannot follow each other either. Analysis of the code and its properties would be made more complex, and the natural way to simplify it would be to do what was done: introduce proper timings to turn it into the composition of two codes, leading to the fairly simple analysis given above (remember that it includes showing the code is prefix). Furthermore, it is not strictly necessary to follow exact timings in the analog representation. Since the decoder of the analog translation can distinguish short, medium and long pauses, by whatever means, it should just mimic what was done in the binary case. Hence short and medium signal (necessarily followed by a pause) are recognized as logical dot or dash.

Short pauses are forgotten, as only serving to mark the end of dot or dash. Medium pauses are recognized as sep, and long pauses are recognized as two sep in succession. Hence the analog signal is represented in a ternary alphabet, which can be used as before to encode the 58 symbols alphabet. Our initial analysis can be used even when timings are not strictly respected. Alternatively, the signal-pause alternance could be used to turn this quinary alphabet into a ternary one, keeping only the three durations as symbols of the alphabet, and using contextual analysis to determine whether a given duration is signal or pause. But this is again a bit complex to analyze. This just shows that there are many ways to look at things, but they are not necessarily convenient, and may not all lend themselves easily to analysis with the mathematical tools that have been developed to analyze codes. More references to the patents can be found on the Internet. Conclusion Given the precise timings of the standard, a good answer seems to be to consider Morse code as the composition of a ternary prefix encoding (of 58 characters) into a 3 symbols alphabet, composed with a binary prefix encoding of these three symbol.

Without the precise timing of the standard, the binary level can no longer be considered. Then the analog to logical decoding naturally takes place at the level of the intermediate alphabet of dot and dash. However, the analog to logical decoder can stil decode to the previous 3 symbols alphabet, thus preserving the applicability of our analysis. up vote 27 down vote This answer isn't as long as it looks; this site just puts a lot of spacing between list items! Update: Actually it's getting pretty long... Morse Code isn't "officially" binary, ternary, quaternary, quinary, or even 57-ary (if I count correctly). Arguing about which one it is without context is not productive. It is up to you to define which of those five it is based on your application and the encoding requirements for your specific situation. To that end, there are pros and cons to each symbol set size, which you should consider for your situation before making a decision. For the basis, M.1677 , the international Morse Code standard, section 2, defines timings as: 2 Spacing and length of the signals 2.1 A dash is equal to three dots.

2.2 The space between the signals forming the same letter is equal to one dot. 2.3 The space between two letters is equal to three dots. 2.4 The space between two words is equal to seven dots. Note that that defines timings only, e.g. a dash does not mean the same thing as three dots, it is simply the same length. The base unit of time is a dot. Binary We can choose binary if we'd like. It is possible to represent Morse Code with "strict binary", as you call it -- that author's approach was to assign the digits to "dot" and "dash". That approach does not work and I do not think the author has a firm grasp of Morse code. But there is a different approach that works. If we choose binary, we essentially represent whether the signal is high or low with each symbol occupying a single dot-lengthed time slice. Note that this is also the approach described on the List of Binary Codes page you cited. Other binary codings can be chosen as well (e.g. Bob Jarvis' answer ) at the expense of increases in difficulty decoding back to audible Morse Code (Bob's encoding cannot be decoded statelessly, for example, the tradeoff is it provides shorter encoded sequences).

Symbols: The phrase "is a": 3031303032304 Pros (compared to quaternary): Can be decoded statelessly. The only symbol set size that unambiguously, directly and concisely represents the five objects mentioned in section 2 of the standard: "dot" (to which all timings are relative to), "dash", "space between the signals", "space between two letters", "space between two words". Cons (compared to quaternary): Higher possibility for invalid encodings. Increased encoding lengths without adding extra information (tradeoff is decoding ease). Not as easy to decode as the binary choice, in that each symbol is a different length in time and this association must be maintained somewhere. 57-ary: Cons: Largest symbol set Difficult to decode into Morse Code; necessary to maintain tables of Morse Code output sequences for each symbol and necessary to detect word boundaries and adjacent letters to determine where to insert various rests. Impossible to expand beyond the Morse Code specification without adding new symbols (tradeoff for being immune to invalid encodings).

Signal and letter separators are implicit.‡ Termination For storage as a symbol stream on a device, if you need to do that, it's worth noting that M.1677 defines message and transmission termination sequences. From Part II: 5 Every telegram shall be terminated with a cross signal (. – . – .) 6 The end of the transmission shall be indicated by the cross signal (. – . – .) followed by the invitation to transmit signal K (– . –) 7 The end of work shall be indicated by the station that transmitted the last telegram. The correct indication is the end of work signal (. . . – . –) Unfortunately, the standard is silent on the ability to distinguish e.g. the string "+K" from the sequence (end-of-telegram, invitation-to-transmit). However, end-of-work is unique. If you are storing morse code, then, you will have to make a choice as to how you want to indicate the end of a stored sequence.

If you are storing an entire conversation, for example, and are using the binary symbol set, you could reasonably consider end-of-work to be the end of sequence indicator, represented as the unique bit sequence 101010111010111. You need to consider the type of data you are storing (e.g. message fragments, entire messages, entire conversations) as well as the facilities offered to you by your storage medium (e.g. ability to prefix with message length) before deciding. I suppose you could go so far as to define your own end of sequence indicator. In any case these are all matters of underlying storage and have too many possibilities to list here. The choice is really up to you based on whatever is appropriate for your situation. † Cannot be decoded statelessly: These encodings require some state to be maintained in order to decode into audible Morse Code. They all require "If preceding symbol was a dot/dash and current symbol is a dot/dash then insert signal separator".

While you could try and "cheat" and automatically append a signal separator to all symbols while reducing word separator to 5 rests and letter separator to 1, M.1677 afaict does not explicitly prohibit consecutive word separators, which breaks this kludge. ‡ Signal separators are implicit: This is directly related to the above note but more semantically oriented. These encodings have implicit signal separators in their notation. That is "zzz" is intuitively three separate z's, the boundaries are "piggybacked" on whatever it is that separates symbols in the encoding itself. Consider the description "three dots in a row"; intuitively we take this to mean three separate dots, but if separators weren't implied this could be taken to be indistinguishable from a dash. Only the Wikipedia-style binary and quinary (or ternary with the explicit signal separator option) representations remove all ambiguity and "shortcuts" here, which can be of great value depending on the situation. It is for this reason that there is a strong argument for the quinary choice. TL;DR: As you can see, there are advantages and disadvantages to each, and it's up to you to decide how you want to treat it based on your requirements.

There is no right answer. You could attempt to argue that one is more appropriate than the other in general, but these arguments would boil down to pedantic preferences, as without context, there is no correct answer. Now, all that said, in my own opinion, the quinary choice is the representation that feels the most "right" to me for Morse Code itself (originally I had favored quaternary). It is the only choice that provides all of the following: Context-free symbols (a symbol on its own contains all information about its meaning without examining adjacent symbols). Representation of all primitives defined in M.1667. Separators (signal, letter, word) are not implied by notation or underlying encoding (this is important, if I wrote { dot, dot, dash }, those ,'s are significant and easy to overlook). However, there are strong arguments for all. The arguments related to encoding are also applicable to the treatment of Morse itself. There is no 100% concrete answer, but it can certainly make a good topic for debate with your friends at the bar. . . . – .

– up vote 5 down vote Despite my initial thoughts on this, it turns out this question can be formalized in a way that admits a fairly precise answer (modulo a couple of definition issues). The answer turns out to be 3 or 4, i.e. ternary or quaternary. The crowd-pleaser "everything goes from 2 to 57" answer is correct only in the sense that if someone asks you for a characterization of abelian groups, you tell him they are sets. Let's start by looking at the physical encoding for Morse code. That's actually B ASK , i.e. binary amplitude-shift keying, which is just an elaborate way o saying there two physical (electrical/optical etc.) amplitude levels for us to encode our message. So, the immediate question is: doesn't this mean that answer is that Morse code is binary? Well, it's binary only in a rather non-informative way, in the sense that the binary on/off signal sent over the wire doesn't correspond directly to either lines or dots.

At this vague level of correspondence, we could even send the ASCII code (with the direct, obvious bit encoding) and call it "Morse" and/or "binary"; the same would apply to any Huffman code (instead of ASCII). So how can we make the correspondence more precise and at the same time formalize our question? Coding theory comes to help. Let $M$ be the set of "morsable" symbols, roughly 66 symbols if I understand the Morse code universe correctly; this includes the 26 Latin letters, the 0-9 digits, and a bunch of ancillaries like some punctuations, "prosigns" etc. It's actually not terribly important what these are. A code is an injective mapping $c:M\to T^*$ where $T$ (not $T^*$) is a set of codewords. To be physically representable in our underlying BASK hardware, we require that $T\subset \{0,1\}^*$, i.e.

our codewords need to be a strings of bits; note that this entails $c$'s values are strings of codewords, so strings of strings of bits, but ultimately linearized as just strings of bits. To be a faithful characterization of Morse code, we need $T$ to contain some direct equivalents of lines and dots, in the sense that there must be a bijection between these codewords and the dots and lines representing Morse code on paper. $T$ is also required to be [almost] a uniquely decipherable code, meaning that any factoring of an element of $T^*$ in terms of elements/codewords of $T$ [ideally] must be unique. (Note that some authors, e.g. Berstel , don't even call $T$ a code unless it is uniquely decipherable, but others, e.g. Steve Roman have a different terminology where any mapping is a code, but those that are uniquely decipherable are just said so and abbreviated UD codes. Here I'll just the latter terminology.

You'll also see a bit later why I said "ideally".) Since $c$ is only required to be an injection and not a surjection, we can populate $T$ with arbitrary "junk" beyond what's needed to get a UD code, as long as the strings generated by this junk aren't the preimage of anything morsable. For example, a string of exactly 42 dots doesn't correspond to anything in any variant of Morse code I saw. So when when we ask if the Morse code binary, ternary, quaternary, quinary etc., the question should is asking for the minimal cardinality of $T$ with the above two properties, i.e.: it is [almost] an UD code and we have an obvious bijection between the paper-based "line" and "dot" to some elements of $T$. There a two ways to proceed in constructing $T$, either top-down by observing that you need a separator between the paper-based, line-dot representation of Morse letters in order to get a UD code, or bottom-up since in the ITU international Morse code we're given the time-lengths of the lines, dots, and various pauses.

I'll use the latter approach here because there are numerous ways to get some $T$ otherwise, i.e. you can pick fairly arbitrary time-lengths, e.g. the defunct American Morse code used shorter lines than the ITU version. Start let's with the ITU signal-length-derived representation which has five basic codewords, generated from the unit-length "on" signal (1) and "off" signal (0): just-dot (1), just-line (111), unit-space (0), letter-space (000), and word-space [assumed seven 0's in the International Morse but can vary in practice]. Immediately note that the unit-space can only appear followed by a 1 only right after just-dot and just-line; and this $0$-termination of just-dot and just-line (which is a comma code; more on this later) is actually required otherwise you couldn't even tell apart lines from dots. This gives you the obvious reduction to four codewords with: dit = just-dot unit-space = 10 and dah = just-line unit-space = 1110. So that's the quaternary Morse code: dit, dah, letter-space, word-space.

The next observation is that the word-space can be approximated (or even assumed to be) two letter-spaces, i.e. six zeros. So how that's how you get the ternary codeword set; As references for this line of reasoning see e.g. [1] [2] . There is also a technical reason to prefer the ternary codewords: $T = \{10 , 1110, 000\}$ is a uniquely decipherable code, in fact it is a prefix code. However $\{10 , 1110, 000, 0^7\}$ (or the version with just six zeros) is no longer uniquely decipherable because $0^{10}=0^30^7=0^70^3$ so there's a non-unique factorization. While this is theoretically a problem, it is of no practical concern because the human "metronome" has difficulty measuring very long silences anyway, so basically any silence longer than a certain length is assumed (by a human) to be a word-space of sorts. Also note that if you stick $0$ in that set too (i.e.

take "quinary" view), it gets "even more wrong", in the sense that even $000$ no longer has unique factorization (as itself is a code word too). Furthermore, $0$ is not in the preimage of any Morse symbol, so it is junk in $T$, much like you can add $1^{42}0$ to $T$; in fact adding the latter is less troublesome as unlike adding $0$ it won't make the code lose the UD property. The reduction/abstraction from dit, dah, letter-space as binary codewords to three abstract symbols (trits) is useful for showing quickly that the (ternary) Morse code is UD; that's immediately obvious because letter-space acts as a comma, i.e. the ternary Morse code is a comma code. (Note that other authors define "comma code" in a more restrictive sense where all symbols other than the comma are the same one; I'm using it here in the wider sense given in D.H.

Smith's "Post-modern algebra" , which just means using a unique terminating symbol for ever codeword.) Also note that the comma0code technique is used at two levels in the Morse code; the just-line and just-dot are terminated by the "short comma" unit-space=$0$ to make them distinguishable from each other. Once you abstract that construction to the two different (dit and dah) trits, all the Morse code letters are also comma-coded by terminating them with $000$ which the third trit. You can also use the trit approach calculate entropy assuming a dah and dit and letter-space are "equivalent" as trits [3] , in the sense that—for example—'e' takes 2 trits and 'y' takes 5 trits. The abstract trit approach is not so useful if you care about how expensive each symbol is to actually transmit in the real BASK Morse encoding on a line. For the latter, you need to get down to the real bit lengths of the 3 (or 4) symbols, which are seen as just as transitions in an automaton.

For instance the letter 'e' takes 5 bits to encode (as dit letter-space) while 'y' takes 17 bits (three dahs, one dit and a letter-space). This line of thinking goes back to Shannon (see pp. 3-4). More details can be found in Blahut's "Information Theory and Coding" , e.g. he calculates "an average of 9.296 units of signaling time per source output letter" for Morse code using the (unconditional) probabilities of letter occurrences in English. For a slightly different exposition (by a zoologist!) you could look at J.P. Hailman's ; he gets a different average (10.2) because he assumes slightly different probabilities for English letters, but otherwise his analysis is conceptually the same. To summarize this: you can take several views of the Morse code, but some are more fruitful than others in saying anything interesting about it. I'm not aware of any analyses using the "quinary" view and in order for this model to not be reducible to four symbols you'd have to make some assumptions about the occurrence the unit-space that don't hold in actual Morse, e.g.

that you could have two but not necessarily three adjacent unit-spaces (which is invalid Morse). The ternary view buys you a quick analysis of the unique decodability. The most deep/fruitful view is the one which sees the 3 or 4 symbols as actually represented by unequal amounts of bits as they are in the real Morse code (|dit|=2, |dah|=4, |letter-space|=3 and |word-space|=6 or 7); it's still insightful at this low-level to consider the ternary/quaternary symbols as transitions in an automaton. As to why Wikipedia sucks on this... well on some topics it just does. Their main article on is not really something I'd recommend reading either. I can't say much about the (Petzold) book you've mentioned other than it doesn't appear written by an expert in information theory. Petzold is correct only in the sense that if Morse-coded messages consisted of only one letter you could reasonably say they are in some binary code; if you want to send words though, you need a letter separator, otherwise the code would be horribly not UD, to the point of impracticality.

It's a bit late here for me to revise the entire post, but @babou makes a valid point below that apparently Shannon, Blahut and others have misinterpreted the (current) ITU standard (assuming it hasn't changed since their time) in the following technicality: the unit space is added between dits and dahs of the same letter, but only the letter-space is added between letters. This reading of the standard seems to check out based on a fairly recent practitioner's book . So we need to borrow one 0 from letter-space into each dit and dah when they are in terminal positions of a letter, leaving only two 0's for the letter-space, i.e. $T=\{10, 1110, 00\}$. That also means that (for example) the size of 'e' is only 4 bits, not 5. up vote -1 down vote Originally Morse code was intended to be written marks on a strip of paper, but telegraph operators soon became able to "read" the clicks of the equipment. This version of Morse (American or "land" Morse) had three "mark" elements, the dot, the dash, and the long dash.

The use of International Morse during the last century, via radio transmission, was usually encoded by hand (on a telegraph key) and decoded by ear, by listening to the pattern of beeps produced by the receiver. Skilled operators could receive better than unskilled ones, and some people could produce code that was easier to understand than that of others. A good transmitting operator was said to have a "good fist." An inept operator was called a LID. (For the origin of "lid" -- which I believe comes from a common error in American Morse of sending LID for DD, daaahh, dit dit, dah dit dit instead of dah dit dit, dah dit dit -- see this reference: .) Thus it follows that the "encoding" of Morse into a binary format depends upon purpose, and thus whether the quality of "good fist" versus "poor fist" is to be retained. Is a string of on-and-off switching to be matched to a clock and "corrected" for difficulties in phase or duration of each portion of the signal? Or is it instead to be sampled at a rate sufficient to retain random or confusing variations, presumably for later inspection or delight?

Morse code Main Page | See live article | Alphabetical index Morse code Morse code is a system of representing letters, numbers and punctuation marks by means of a code signal sent intermittently. It was developed by Alfred Vail while he was helping Samuel Morse with Morse's invention of the telegraph ( 1835 ). Morse code is an early form of digital communication, however unlike modern binary digital codes that use just two states (commonly represented as 1 and 0), it uses five - dot, dash, short gap (between each letter), medium gap (between words) and long gap (between sentences). Table of contents 8 Morse Code translators History of Morse Morse's original code consisted of combinations of dots and dashes that represented numbers. Each number represented a word. This required looking up the number in a book to find the word it represented. A telegraph key was then used to tap out the sequence of dots and dashes, and pauses that represented the number. Although Morse invented the telegraph , he lacked technical expertise. He entered an agreement with Alfred Vail who built more practical equipment. Vail developed a system in which each letter or symbol is sent individually, using combinations of dots, dashes, and pauses.

Morse and Vail agreed that Vail's method of representing individual symbols would be included in Morse's patent. This system, known American Morse code, was the version that was used to transmit the first telegraph message. The code may transmitted as an audio tone, a steady radio signal switched on and off (known as continuous wave, or CW), an electrical pulse down a telegraph wire, or as a mechanical or visual signal (e.g. a flashing light). In general, any code representing written symbols as variable length signals can be called a Morse code, but the term is used specifically for the two kinds of Morse code used for the English alphabet and associated symbols. American Morse Code was used in the wired telegraph systems that made up the first long-distance electronic communication system. International Morse Code, which uses only dots and dashes (eliminating the pause), is used today. Telegraph companies charged based on the length of the message sent. Elaborate commercial codes were developed that encoded complete phrases in five-letter groups that were sent as single words. Examples: BYOXO ("Are you trying to crawl out of it?"), LIOUY ("Why do you not answer my question?"), and AYYLU ("Not clearly coded, repeat more clearly.").

The letters of these five-letter code words were sent individually using Morse code. In networking terminology we would say the commercial code is layered on top of Morse code. Still in use in Amateur Radio are the Q code and Z code; they were and are used by the operators themselves for service information like link quality, frequency changes, and telegram numbering. On January 8 , 1838 Alfred Vail demonstrated a telegraph code using dots and dashes which was the forerunner of Morse code. When considered as a standard for information encoding, Morse code had a successful lifespan that has not yet been surpassed by any other encoding scheme. Morse code was used as an international standard for maritime communication until 1999 . When the French navy ceased using Morse code in 1997 , the final message transmitted was "Calling all. This is our last cry before our eternal silence." American Morse Code Virtually extinct, American Morse Code uses a slightly different structure of dots and dashes and uniquely spaces also to represent numbers, letters, and special characters. This style of morse code was developed for land operators working over telegraph wire rather than via radio signals.

This older, alternate style of code was developed to accommodate the way in which operators listened to morse code sent to them. Rather than hearing tones from a speaker or headphones as we do now using International Morse Code, in these earliest days of telegraphy one would hear clicks from a mechanical sounding device, or often from the sending key which was switched to receive in slave mode when not transmitting. Most often these operators worked for the railroad or later for Western Union and the like. Thomas Alva Edison was such an operator in his teenage years, as were countless youths of his time. Modern International Morse Code International Morse code is still in use today, although it has become almost exclusively the province of amateur radio operators. Until 2003 the International Telecommunications Union (ITU) mandated Morse code proficiency as part of the amateur radio licensing procedure throughout the world. In some countries, certain parts of the amateur radio bands are still reserved for transmission of Morse code signals only. Since Morse relies on only a steady ( unmodulated ) radio signal, it requires less complex equipment than other forms of radio communication, and it can be used in very high noise / low signal environments.

It also requires very little bandwidth and facilitates communication between amateur radio operators who do not share a common mother tongue and would have great difficulty in communicating using voice modes. It is also very popular among QRP operators . In the United States until 1991 , a demonstration of the ability to send and receive Morse code at 5 words per minute (WPM) was required to receive an FCC amateur radio license permitting use of the HF bands . Until 1999 proficiency at the 20 WPM level was required to receive the highest level of amateur license (Extra Class); on December 13 , 1999, the FCC reduced the Extra Class requirement 13 WPM. The World Radiocommunication Conference of 2003 (WRC-03) made optional the international Morse code requirement for amateur radio licensing. Although the requirement remains on the books in the US, Canada , and elsewhere, some countries are working to eliminate the requirement entirely. Amateur and military radio operators skilled in Morse code can often understand ("copy") code in their heads at rates in excess of 40 WPM.

Although the traditional telegraph key is still used by many amateurs, the use of semi- and fully-automatic electronic keyers is prevalent today. Computer software is also frequently employed to produce and decode Morse code RF signals. Timing and representation There are two "symbols" used to represent letters, called dots and dashes or dits and dahs. The length of the dit determines the speed at which the message is sent, and is used as the timing reference. Here is an illustration of the timing conventions. Its intent is to show exact timing - it would normally be written something like this: -- --- *-* *** * / -*-* --- -** * M O R S E (space) C O D E where - represents dah and * represents dit. Here's the exact conventional timing for the same message (= represents signal on, . represents signal off, each for the length of a dit): .

CW Continuous wave CX Conditions DE From DX Distance (sometimes refers to long distance contact) ES And FB Fine business (Analogous to "OK") FCC Federal Communications Commission FER For FREQ Frequency GA Good afternoon or Go ahead (depending on context) GE Good evening GM Good morning GND Ground (ground potential) GUD Good HI Laughter HR Here HV Have LID Poor operator MILS Milliamperes NIL Nothing NR Number OB Old boy OC Old chap OM Old man (any male amateur radio operator is an OM) OO Official Observer OP Operator OT Old timer OTC Old timers club OOTC Old old timers club PSE Please PWR Power QCWA Quarter Century Wireless Association R I acknowledge or decimal point (depending on context) RCVR Receiver RPT Repeat or report (depending on context) RST Signal report format (Readability-Signal Strength-Tone) RTTY Radioteletype RX Receive SAE Self addressed envelope SASE Self addressed, stamped envelope SED Said SEZ Says SIG Signal SIGS Signals SKED Schedule SN Soon SOS international distress call SRI Sorry STN Station TEMP Temperature TMW Tomorrow TNX Thanks TU Thank you TX Transmit U You UR Your or you're (depending on context) URS Yours VY Very WDS

 Words WKD Worked WL Will WUD Would WX Weather XMTR Transmitter XYL Wife YL Young lady (used of any female) 73 Best regards 88 Love and kisses See also: Q code Conversation with Morse code The skill to have sensible conversations with Morse is more than knowing just the alphabet.

To make communication efficient, there are many internationally agreed patterns of communication. A sample cw conversation between station 1 (s1) and station 2 (s2) s1: CQ CQ CQ de s1 K Calling anyone (CQ), this is (de) s1, listening (K) s2: s1 de s2 K Calling s1, this is s2, listening (Now we have a connection) s1: Make a Morse Code Name or Word Necklace! ~ The Beading Gem's Journal By Pearl Blay on Monday, March 05, 2012 5 Comments There are different ways to make a name or word necklace. You could use metal letter beads or if you are good with wire, wire names. But there is another way - make a morse code necklace. "Debra" necklace photographed with my Modahaus Steady Stand Shown above is one I made with golden glass pearls for the dots and coiled colored copper wire sections representing the dashes. Each letter is contained in each wire wrapped section. The front of the necklace spells DEBRA as it is a gift for my very good friend, Debbie.

It will be a humble addition to her gorgeous but imperfect cartouche pendant from Egypt. It was inspired by Erin's tutorial over at Thanks, I Made It who used metal round beads and long metal tube beads for the dots and dashes for the above necklace. Knots were added to separate the letters. It was based on an Anthropologie design which really appealed to her as she loves coded writing. Below is the morse code alphabet. If you use it, you can see how our necklaces spelled the names! The modern morse code is different from the original 1840's code created for the electric telegraph designed by artist Samuel F. B. Morse, physicist Joseph Henry, and Alfred Vail. The chart below shows the historical comparison and progression from the original American code to the modified German (Gerke) one used in Europe to the internationally recognized version today. The morse code is noted for its coding efficiency. The most frequently used letter in the English language is "E" so it is represented in the shortest form - just a single dot.

Introduction to Morse Code - CodeProject Introduction to Morse Code Kimahari , 15 Apr 2013 CPOL 4.00 (2 votes) Download demo project - 21.3 KB Introduction Morse code is a method of transmitting string information into a series of dots[.] and dashes[-] encrypting a message between two entities and so making communication possible between two parties. And we are going to have the fun task of doing just that. I will be using a simple console application to represent the use of Morse code. Using Morse At first we will need to define a dictionary to be able to communicate. Find the Morse code value of the letter we want to type and instantiate a dictionary Element and the reason for doing so is that we will not have to use all of the redundant if statements or case statements thus increasing our calculation speeds. namespace Morse_Code { public class TheLib { private Dictionary<String, String> m_TheLibrary = new Dictionary<string, string>(); public Dictionary<String, String> TheLibrary { get { return m_TheLibrary; } set { m_TheLibrary = value; } } } } This will keep track of all our data. Well now we have to add some data into our little library.

Let's create a load method to do the adding of all our Morse values for our characters. protected void LoadMorse() { #region Alphabet A-Z TheLibrary.Add("A", ".-"); TheLibrary.Add("B", "-..."); TheLibrary.Add("C", "-.-."); TheLibrary.Add("D", "-.."); #endregion } This will enable us to add some values into our library and using the library will be just as easy to do, just by calling on the library and sending our characters. Let's create a method that will return the Morse encrypted string value.

public String Sentance_To_Morse(String Sentence) { //A single Space will identify inter character spaces in our words //A Triple Space will identify inter word spaces in our sentence String returnString = ""; //We will start by deconstructing our sentence into a String List //to hold our words in the sentence List<string> Words = Sentence.Split(' ').ToList<string>();//Convert the array to a list //then we will loop through our words to start //creating the Morse value for each letter in the list foreach (String Word in Words) { for (int letter = 0; letter < Word.Length; letter++) { //to upper is used to check if the value is in our library if (TheLibrary.ContainsKey(Word[letter].ToString().ToUpper())) { returnString += TheLibrary[Word[letter].ToString().ToUpper()];//Gets the morse value for our letter }//Makes Sure That the character is in our library else { Console.WriteLine("The Character {0} is not recognized in the Morse Library", letter.ToString().ToUpper()); }//tell the user there was a mistake returnString += " ";//add inter character space } returnString = returnString.Trim(' '); //remove the single space from the back to add //inter word space other wise we will

 have four spaces returnString += " "; } return returnString.Trim(' ');//to remove all unnecessary spaces } If we call on this method and send through the sentence "SOS SOS".

We will get the value of "... --- ... ... --- ..." What if we got a series of dots and dashes and wanted to convert it back to a sentence? Let's create a method to do the conversion.

public String Morse_To_Sentance(String Morse) { String returnString = ""; //we will split the Code received into word segments remember the triple space //well now we will just replace that with a comma and split the Code on the comma Morse = Morse.Replace(" ", ","); string[] MorceWords = Morse.Split(','); foreach (String word in MorceWords) { if (word != "") { //remember the inter character spaces we assigned //now we will split the word into its charaters String[] MorseCodeLetters = word.Split(' '); foreach (string MorseCodeLetter in MorseCodeLetters) { if (TheLibrary.ContainsValue(MorseCodeLetter)) //there is no get key by value in a dictionary thus we need to get the key manualy foreach (KeyValuePair<String, String> MorseItem in TheLibrary) { if (MorseItem.Value == MorseCodeLetter) returnString += MorseItem.Key; } } } returnString += " ";//add inter word space } return returnString.Trim(' ');//to remove all unnecessary spaces } And that will be all we need for our little converter. Hope this was a great example of a Morse code converter.

Now let's use the class we created: static void Main(string[] args) { TheLib m_lib = new TheLib(); Console.Write("Type the Sentence you would like to encrypt to Morse ::"); string MorseSentance = m_lib.Sentance_To_Morse(Console.ReadLine()); Console.WriteLine("Your sentence has been encrypted to {0}", MorseSentance); Console.WriteLine(m_lib.Morse_To_Sentance(MorseSentance)); Console.Read(); } Points of Interest Morse code was originally represented by sounds, beeps, and the methods bellow will play the Morse code to simulate a communication. Just add them to the library TheLib class and call on the method. I used it three times as a long method. Well all it says basically is that a dash is three times as long as a dit and an inter character is as long as a dit.

protected void CreateDAH(int time) { Console.Beep(1100, time); } protected void CreateDIT(int time) { Console.Beep(1100, time); } public void playMessage(String message) { message.ToList<char>().ForEach((c) => { if (c == '.') CreateDIT(200); else if (c == '-') CreateDAH(600); else Thread.Sleep(200); }); } License This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL) Share Why Was Morse Code Invented? | Wonderopolis Wonder of the Day #233 Why Was Morse Code Invented? Why was Morse code invented? Who invented Morse code? Listen Way back in 1836, Samuel F. B. Morse, along with Joseph Henry and Alfred Vail, invented an electrical telegraph system. Before telephones were invented, it could send messages over long distances by using pulses of electricity to signal a machine to make marks on a moving paper tape. A code was necessary to help translate the marks on the paper tape into readable text messages. Morse developed the first version of this code .

His version included only numbers. Vail soon expanded it to include letters and a few special characters, such as punctuation marks. The code — known as Morse code — assigned each number, letter or special character a unique sequence of short and long signals called "dots" and "dashes." In Morse code transmission , the short dot signal is the basic time measurement. A long dash signal is equal to three dots. Each dot or dash is followed by a short silence that's equal to a dot. If you wonder how they decided which combination of signals was assigned to each letter, they studied how often each letter in the English language was used. The most used letters were given the shorter sequences of dots and dashes. For example, the most commonly used letter in the English language — E — is represented by a single dot. The original telegraph machines made a clicking noise as they marked the moving paper tape. The paper tape eventually became unnecessary. Telegraph operators soon learned that they could translate the clicks directly into dots and dashes. Later, operators were trained in Morse code by studying it as a language that was heard rather than read from a page.

Although Morse originally referred to code signals as dots and dashes, operators began to vocalize dots as “dits" and dashes as “dahs" to mimic the sound of Morse code receivers. Today, it's possible to transmit messages in Morse code in any way that dots and dashes can be communicated. This includes sounds and lights, as well as printed dots and dashes. Morse code was critical for communication during World War II. It was also used as an international standard for communication at sea until 1999, when it was replaced by the Global Maritime Distress Safety System. The new system takes advantage of advances in technology, such as satellite communication. Today, Morse code remains popular with amateur radio operators around the world. It is also commonly used for emergency signals. It can be sent in a variety of ways with improvised devices that can be switched easily on and off, such as flashlights. The international Morse code distress signal ( · · · — — — · · · ) was first used by the German government in 1905 and became the standard distress signal around the world just a few years later. The repeated pattern of three dots followed by three dashes was easy to remember and chosen for its simplicity.

In Morse code , three dots form the letter S and three dashes form the letter O, so SOS became a shorthand way to remember the sequence of the code . Later, SOS was associated with certain phrases, such as “save our ship" and “save our souls." These were just easy ways to remember SOS, though. The letters themselves have no such inherent meaning. Wonder Words (17) Take the Wonder Word Challenge Wonder What's Next? Can you hear that? It’s tap, tap, tapping at the door. What is it? Why, tomorrow’s Wonder of the Day, of course! Try It Out Ready to decipher some dits and dahs? We've used Morse code to encode a special message for all our Wonder Friends. Here it is: .-- .... .- - / .- .-. . / -.-- --- ..- / .-- --- -. -.. . .-. .. -. --. / .- -... --- ..- -? Print out a Morse code key and use it to decipher our special message. Note: The / is used to separate the words of the message. When you're finished, create your own special message and use your key to encode it using Morse code.

Give your message and the key to someone else and challenge him or her to decode it! If you enjoy communicating with your friends and family using Morse code, try this online Morse Code Translator to encode and decode even longer messages. If you want, you can even email a secret message to Wonderopolis HQ using Morse code! White River Valley Museum pause between words 7 units of time The speed of transmitting Morse code is measured in WPM (words per minute). The word "Paris" is used as the standard length of a word. To transmit the word "Paris" requires 50 units of time. If you transmitted the word "Paris" 5 times, you would be transmitting at 5 WPM. An experienced Morse code operator can transmit and receive information at 20-30 WPM. Samuel Morse Samuel Finley Breese Morse, (1791-1872), was a famous American inventor and painter. Morse graduated from Yale in 1810 and went on to study painting in England. In 1815, he took up portrait painting and was quite successful in this field. Morse helped to found the National Academy of Design and served as its first president.

In 1827, Morse became interested in electricity. In 1832, he began a 12-year period perfecting his version of an electric telegraph, for which he subsequently received the first patent for this type of device. Samuel F. B. Morse (1791 - 1872) In 1844, Morse demonstrated to Congress the practicality of the telegraph by transmitting the famous message "What hath God wrought" over a wire from Washington to Baltimore. He later experimented with submarine cable telegraphy. Samuel Morse Telegraph Receiver Morse Code Translator Morse Code Translator Download Send your message to a friend Send a message in Morse code by email, Facebook or any other network ( here is an example ). If they know Morse code you can hide the text. Hide the message text (?) Copy the link below or share it on a social network: Advanced Controls Use prosigns (?) Text to Morse Just type letters, numbers and punctuation into the top box and press the "Translate" button. The program will place the Morse code in the bottom box, inserting a "?" if the character cannot be translated.

If you want to translate prosigns, enter them as "<CT>" for instance and tick the "Use prosigns" checkbox in the advanced controls. This is not a great tool for learning Morse code as looking at the dots and dashes does not help. Instead, try the Morse Trainer . Morse to Text You can type Morse code into the top box using "." for a dot and "-" or "_" for a dash. Letters are separated by spaces and words by "/" or "|". When you hit the "Translate" button the program will translate it into plain text. If it cannot translate a letter it will place a "?" in the output. Sound The "play", "stop" buttons control the sound playback. There are also advanced options to control the pitch and speed. The "Farnsworth speed" is useful when learning Morse code as it can be set lower than the other speed in order to stretch out the spaces between characters and words whilst keeping the Morse characters fast. Notes To produce the sounds, in the latest versions of Chrome, Firefox, Safari and Edge the translator uses the Web Audio API and require Javascript to be enabled.

Internet Explorer does not support the Web Audio API and so Flash must be installed and enabled (Flash often has security issues though so is best avoided). You may find that in Internet Explorer the sound quality is better in the older Java translator (but you must have Java enabled which brings with it potential security issues). The download button will download the audio as a wav file but it does not work in Internet Explorer. In Safari you must hold the Option key when clicking the download button and give the file a name ending in ".wav". If you would like to see a list of all the Morse code characters please go to my Morse Code page. If you have any questions about Morse code or the translator, please read my FAQ first. This software makes use of XAudioJS , Foundation and jQuery . I am a father and foster carer a principal research engineer at the IT Innovation Centre a Woodcraft Folk district coordinator a salsa teacher and in my spare time I write and maintain this web site © Copyright Stephen C. Phillips, 2015

Question: In the version of the Morse Code used in Great Britain, what letter of the alphabet is represented by a single dot?
Answer: E