Vocademy

Modems

Frequency-Shift Keying (FSK)

Frequency-shift Keying uses two different frequencies to convey digital information over an appropriate medium. For example, the Bell 103 modem, introduced in the early 1960s, used audio frequencies of 1,070 Hz (logical 1) and 1,270 Hz (logical 0), transmitting those tones over a standard telephone line. The modem used these frequencies if it initiated the communication session. The receiving modem transmitted data back to the initiating modem using 2,025 Hz and 2,225 Hz. With the two modems using separate sets of frequencies for transmitting and receiving, data is conveyed in both directions, achieving full duplex communication.

Baud rate vs. bit rate

The baud rate is the rate at which data is sent in bits per second using simple FSK. One baud is the time it takes to send one bit of information using this method. Techniques that pack more bits into the same time frame convey information at bit rates higher than the baud rate. A baud is often also called a symbol; data rates may be more than one bit per symbol.

Phase-Shift Keying (PSK)

Phase-shift keying can be demonstrated by two people waving their arms. Let’s say they are waving their arms once each second. If their arms go up and down together, they are waving their arms in phase. If they are still waving their arms once each second, but one is raising his or her arms while the other is lowering his or her arms, they are waving their arms out of phase.

The tones generated by a modem consist of sine waves. A sine wave consists of a voltage varying over a certain range a given number of times per second, following the trigonometric sine function. Like the above people waving their arms, the voltage “waves” up and down a particular number of times per second.

Phase-shift keying requires the establishment of a reference wave separate from the wave conveying information. This is like the two people waving their arms where one keeps time as a reference, and the other can wave out of phase to convey information. The transmitting device sends a second data wave that may or may not be in phase with the reference wave. To convey digital states, the data wave changes its phase timing with the reference wave. For example, if the waves are in phase, they may represent a digital 1; if not, they may represent a digital 0.

In phase-shift keying, it is not uncommon to have multiple digital states. For example, when the data wave is in phase with the reference wave, it represents one state. If the data wave is exactly opposite to the reference wave (like one person raising his or her arms while the other is lowering his or her arms), it represents another state. However, the two waves can be out of phase but not opposite. If the data wave is halfway between in-phase and opposite, the waves are said to be in quadrature. Four digital states can be represented if the data wave is allowed to be in phase, at opposite phase, or in either of the quadrature points. This conveys information at twice the speed of simple FSK (two bits in the time it takes to send one bit at the equivalent baud rate). This creates a bit rate that is higher than the baud rate.

Of course, multiple frequencies can be used to represent multiple digital states with FSK. However, multiple bits per baud using multiple frequencies entered the industry years after it did with PSK.

When PSK was introduced, it was used in combination with FSK. This may, perhaps, be called frequency phase shift keying (FPSK), but it is not. There is no standard name for combining FSK and PSK.

Amplitude Shift Keying (ASK)

Amplitude shift keying (APSK) uses two or more amplitude levels at a single frequency to convey digital information. APSK is not used in any systems commonly encountered by computer technicians. However, it is mentioned here as a prelude to discussing quadrature amplitude modulation.

Amplitude phase shift keying (APSK)

Amplitude phase shift keying (APSK) uses a combination of amplitudes and phases to increase the bitrate of digital communication over FSK or PSK alone. For example, a signal with two possible amplitudes and eight possible phases has 16 possible states. This scheme is called 16 APSK and carries four bits of data with each state change (four bits per baud or symbol).

Quadrature amplitude modulation (QAM)

Quadrature amplitude modulation (QAM) is a form of amplitude phase shift keying. Modern telephone modems, digital television, WiFi, cable modems, and many other systems use QAM.

The QAM modulator has two inputs. One input carries the I signal and is in phase with the reference wave. The other input carries the Q signal and is 90 degrees out of phase (in quadrature) with the reference wave. Either input can alter its phase by 180 degrees, so the I signal can be either in phase or 180 degrees out of phase with the reference. The Q signal can be either 90 degrees ahead or 90 degrees behind (270 degrees ahead) of the reference.

The amplitudes of the two inputs are varied as necessary to create an output with any desired amplitude and phase compared to the reference signal. For example, if the I signal is in phase, and the Q signal is 90 degrees ahead of the reference wave—and both signals have the same amplitude—the output will be 45 degrees ahead of the reference wave. If the amplitudes are increased equally, the amplitude of the output will increase, but the phase will still be 45 degrees. If the inputs are of unequal amplitude, the output will be somewhere between 0 and 90 degrees. If the I signal is 180 degrees out of phase, and the Q signal is 90 degrees ahead of the reference wave, the output will be somewhere between 90 and 180 degrees. If the I signal is 180 degrees out of phase, and the Q signal is 90 degrees behind the reference wave, the output will be somewhere between 180 degrees and 270 degrees. Finally, if the I signal is in phase, and the Q signal is 90 degrees behind the reference wave, the output will be somewhere between 270 degrees and 360 degrees. The QAM modulator can produce an output of any phase. Any amplitude can be produced with specific upper and lower limits.

A constellation plot of the available amplitude-phase combinations available using an APSK modulator with two amplitudes and eight phases available.


A constellation plot of the output of a QAM modulator showing the separation available QAM.

Notice that the QAM modulator can create more evenly separated amplitude-phase relationships than APSK. This allows better separation of the states at the receiving end, leading to higher possible bitrates.

Modem Hardware

External modems

The first modems plugged into the serial port. The voltages produced by the port determined the frequencies of the tones generated by the modem. This occasionally causes a problem, especially with USB to serial adaptors. This is because USB operates at +5 volts, and the serial port operates at +12 and -12 volts. USB to serial port adapters typically produce +5 and -5 volts. This is within the RS232 specification but doesn’t work with the earliest modems.

The earliest modems were acoustic modems. An acoustic modem has a speaker and a microphone in a receiver that holds a telephone handset. The user had to dial the number of the remote modem and then place the handset in the receiver, where the sounds propagated through the air. There was no communication between modems other than computer data and the carrier tone that told the modems that they were connected to other modems.

One reason acoustic modems were used was that it was illegal to electrically connect any unauthorized equipment to the telephone system. An acoustic modem connected acoustically to a standard telephone, so nothing was connected to the phone system electrically.

Direct-connect modems became available after connecting third-party equipment to the telephone system became legal. These modems had a serial connection to the computer and a modular jack for the telephone system. Such modems also had tone and pulse[1] dialing systems and thus relieved the user from dialing the phone. The modems accepted commands from the computer to perform various operations, such as pick up, hang up, tone dial, and pulse dial. As modems became more sophisticated and used combinations of FSK and PSK to increase speed, they accepted commands from the computer to set the speed and dialing operations.

Later, modems had a long command set. These are called “AT” commands because the ASCII codes for the letters A and T were sent to the modem to ensure the modem is expected to receive a command. The AT commands were also known as Hayes commands because they first appeared on Hayes-branded modems. Hayes-compatible modems produced by other companies also accepted these commands.

Here are a few of the most important commands.

ATD = Dial

ATD1234567 dials 123-4567 using pulse dialing

ATDT = Dial using tone

ATDT1234567 dials 123-4567 using tone dialing

ATH = Pick-up/Hang-up

ATH0 = Hang up
ATH1 = Pick up

ATZ = Reset

In data-sending mode, if the modem received the ASCII codes for three plus signs in a row (+++) followed by about one second of silence, it would switch to command mode and not send the plus signs to the receiving modem. Sending AT0 put the modem back into data mode.

A modem can be tested to see if it is accepting commands by sending ATH1 and listening to hear the relay that connects the modem to the phone system. Assuming the modem is on com2, this is done by typing “ATH1 >> com2:” at a command prompt. Repeating the command but typing ATH0 hangs up the connection.

Later modems needed to be initialized before operation. Initialization consisted of sending a string of AT commands to the modem. This got the modem set up for the particular needs of the user. For example, AT&F&D2&C1S0=0X4

War Story:

While working as a computer technician for a local charity in the early 1990s, some engineers from Honeywell unexpectedly came to set up a computer network for us (I had no warning they were coming). The network consisted of a 3-Com server (a headless 80386 computer with about 800 kiB of usable RAM, as opposed to the usual 640 kiB, due to the lack of video hardware with a whopping 80 MiB hard drive) and network cards for each workstation. They set everything up while a technician wired the office with ThinNet coaxial cable and outlets. They wired everything up and said they would return to install the software in two weeks. The next day, a telephone technician arrived to install four telephone lines.

Being the impatient sort, I tried to install the software myself even though I had no networking experience whatsoever at the time. The software installation instructions left out a crucial step. Nevertheless, I figured out what that step was and got everything working in a couple of days.

Part of the hardware was a communication card called an AST Sixpack with six serial ports. They also provided four Hayes-compatible modems. My boss told me that the reason for getting the network was to be able to electronically send monthly reports from outlaying offices to the central office—definitely overkill to have a whole network for that, but whatever. So, my next task was to get the modems working and set up the software at all the offices to do the task.

I got the modems and software to facilitate the file transfer setup (I don’t remember what the software was) and tested the system, calling the network modems with my workstation’s internal modem and transferring files.

Everything worked, except the modems would never hang up when they finished the transaction; they would hold the line open indefinitely. I noticed that about a minute after communication ended, the terminal ready (aka data terminal ready) light went off and back on. This indicated that the signal on the terminal-ready wire turned from 1 to 0 and back (toggled). It didn’t fully catch my attention, and I didn’t think much of it until later.

Try as I might, I could not figure out how to get the modems to hang up. I even tried reading the communication software documentation—no joy. I finally swallowed my pride and called tech support at Honeywell. After some back and forth, their technician told me I had to get actual Hayes-branded modems. I said I have Hayes-compatible modems. He emphasized that I needed actual Hayes modems for the system to work. Then he mentioned, in passing, that the Hayes modems would hang up about one minute after communication ended.

I immediately remembered that the terminal ready light toggled about that time. I thought maybe there is a command that tells the modem to hang up when the terminal ready line toggles. I asked the tech about that, and he said there was no such command. Of course, I was already flipping through the user manual to see if there was such a command—and indeed, there was. AT&D2 would do it. I said, “Thank you very much. I’ll call back if I have any more problems,” and ended the conversation.

I changed the initialization string to include the newly found command and had no further problems with the modems. I later learned that some, but not all, Hayes modems hang up when the terminal ready line goes from 1 to 0 by default, so acquiring actual Hayes modems may or may not have worked.

Welcome to the adventures of talking to tech support.

Internal modems

An internal modem is a modem that plugs into the expansion bus. Originally, internal modems had two separate circuits. These were a serial port that connected directly to the modem and the modem itself. The serial port had no external connection, so only connected to the modem on the card. These were called hardware modems and looked to the computer like an external modem connected to a serial port. Like external modems, they usually required no special drivers.

Software that used a modem could often only communicate with serial ports designated as com1 or com2. Since a mouse was usually connected to com1, the second serial port in the computer was usually disabled, and the modem’s serial port was designated as com2.

Later internal modems that connected to the PCI bus had no associated serial port. These modems required special drivers and used the operating system’s resources to communicate. These were often called WinModems because they only worked with Windows and not DOS.

Troubleshooting

The modem reports no dial tone.

This usually means that the modem isn’t connected to the telephone line or some other computer or person is using the telephone line.

Slow connection

This often means there is noise on the telephone line. The modems have to repeat blocks of data that are garbled by noise.

Early PCI modems sometimes operated slowly if the drivers were out of date.

DSL and Cable Modems

Many people connect to the internet with Digital Subscriber Line (DSL) or cable modems.

Users may have to supply their internet service provider (ISP) with their cable or DSL modem's MAC address. This is discussed in detail in the networking class.

Older cable and DSL modems may have connected to a single computer via the USB port. Modern cable and DSL modems connect to computers or routers via Ethernet.

Both cable and DSL modems use QAM and multiple carrier frequencies. A DSL modem uses frequencies above 4,000 kHz to carry data over the same line as voice communication. Each phone on a line used by a DSL modem must have a filter to reject the DSL frequencies. Otherwise, a terrible hissing sound is heard on the telephone line.

At greater distances from the telephone exchange, higher frequencies are attenuated. This results in slower data rates at greater distances with DSL. Recently, telephone companies have extended fiber optics into their service areas. Some customers have direct fiber connections (Fiber to the Premises—FTTx). Standard voice lines, and thus DSL, often go to an exchange box where the ISP’s DSL modems reside, putting their DSL modems closer to customers.

Cable companies typically reserve the frequency range of two or more television channels for Internet data.

Null modems

A "null modem" is a serial cable that directly connects one computer to another. It’s called a "null modem" instead of a serial cable because it's not a modem; it's a serial cable. Let's move on.

DCE and DTE

In the 1970s, AT&T had a communication system called X.25 (X dot twenty-five). AT&T engineers called the X.25 terminals Data Terminal Equipment (DTE), and the line interfaces were called Data Communication Equipment (DCE). X.25 equipment is long obsolete. However, a computer with a CRT monitor looks somewhat like an X.25 terminal. Likewise, a modem looks like a line interface (but does nothing like a line interface). Therefore, in some literature (especially Wikipedia[2]), a computer (and sometimes a terminal or printer) is called DTE. Likewise, modems (and sometimes switches and routers) are called DCE. If you are new to the industry and want to positively identify yourself as such, be sure to use these terms.

Myths:

A modem converts a digital signal to an analog signal and then sends that signal over analog telephone lines. The modem on the receiving end converts the analog signal back to a digital signal.

You know by now that, by definition, a digital signal has discrete states, usually two states. This is as opposed to an analog signal, which is continuously variable. A modem converts a digital signal, one using two voltage levels, to another digital signal, one using two audio frequencies or a combination of AC voltage levels and phases, etc. The later digital signal is compatible with analog telephone lines and can thus be transmitted over such lines. The receiving modem then converts the audio-based digital signal back to a digital signal using two voltage levels. The audio signal is digital (discrete states) and not continuously variable. At no time is the signal converted to an analog signal subject to all the disadvantages of an analog signal.

A noisy connection will cause "jumbled text."

Once true, but modern modems with error correction just get slower with a noisy connection as they have to send information multiple times to mitigate the errors caused by the noise.



The Secret Life of the Fax Machine


DEFCON 17: Old Skool Brought Back: A 1964 Modem Demo

—————————
1Pulse dialing used a relay to make and break the connection to the telephone system to simulate the operation of a rotary telephone dial.
2Wikipedia editors have a remarkable devotion to three-letter acronyms and initialisms. Keep in mind that the content of Wikipedia in not controlled by those with the greater knowledge but by those with the stronger opinions.
Vocademy