សិល្បៈ
សម្រស់ និង សុខុមាលភាព
សិប្បកម្ម
វប្បធម៌ និង ប្រវត្តិសាស្ត្រ
ការកម្សាន្ត
បរិស្ថាន
ម្ហូប និង ភេសជ្ជៈ
វិស្វកម្មបញ្ច្រាស
វិទ្យាសាស្ត្រ
កីឡា
បច្ចេកវិទ្យា
ប្រដាប់ដែលស្លៀក
The FSK Modem
Volt

បង្កើតដោយ

Volt

30. សីហា 2026SE
29
0
0
0
0

The FSK Modem

There were computers in 1962 and there were telephone lines, and no way at all to connect them. A UART's mark and space are DC levels, and the telephone network is a chain of transformers and filters that passes roughly 300 to 3400 hertz and nothing outside it. A DC level dies at the first transformer. The Bell 103 dataset put the bits inside the passband. A one is a tone at 1270 hertz, a zero is a tone at 1070, and the receiver simply asks which of the two is louder over each bit period. That is frequency-shift keying, and it is the same idea as the FM broadcast blueprint this one links to, applied to a channel four thousand times narrower. The detail that makes it useful is the second pair of tones. The answering end uses 2025 and 2225 hertz, far enough above the originating pair that a filter separates them completely, so both ends can talk at once over one pair of wires. Three hundred bits per second in each direction, full duplex, over any line good enough to hold a conversation. The word modem is what the box does: MOdulate on the way out, DEModulate on the way in. Everything for the next thirty-five years is the same box getting cleverer about how much it can push through three kilohertz — phase keying, then quadrature amplitude modulation, then trellis coding — until V.34 stopped at 33.6 kbit/s because Shannon said so. FULLY BUILDABLE, and it genuinely works. Generate the tones on a microcontroller, detect them with a pair of Goertzel filters, and send data down an audio cable — or across the room through a loudspeaker and a microphone, which is exactly what an acoustic coupler was.
មធ្យម
4 hours

ការណែនាំ

1

Listen to the channel you have to fit inside

Before building anything, measure what a voice channel actually passes. Feed a swept tone from the function generator into any audio path you can borrow — a phone handset, a headset amplifier, a cheap intercom — and read the output amplitude on the scope from 100 Hz to 5 kHz. Plot it. You will find a passband roughly 300 Hz to 3.4 kHz with steep skirts, and nothing at DC at all. That shape is not an accident or a defect: it is the deliberate result of packing as many conversations as possible onto one trunk, which is the next blueprint. Now put a square wave at 300 Hz through the same path and look at what comes out. The flat tops are gone and the DC has vanished. That is what happens to a UART frame on a telephone line, and it is the whole reason this blueprint exists.

ឧបករណ៍ដែលត្រូវការ៖

Function Generator (10MHz)Function Generator (10MHz)
Digital OscilloscopeDigital Oscilloscope
2

Modulate and demodulate

Flash the sketch on two boards. Couple them with an audio cable and a series capacitor at each end, or point a small speaker at an electret microphone across the desk — the second is an acoustic coupler and is exactly how a 1960s modem worked, because you were not allowed to wire anything of your own to the telephone. Note the two details that matter. Phase is CONTINUOUS across bit boundaries: jumping phase makes a click, and a click is broadband energy that both filters hear. And the framing is blueprint 1's start and stop bits, unchanged — the modem replaces the physical layer and leaves the framing alone, which is the first time in this batch that a layer is swapped without disturbing the one above it. Watch the printed mark/space ratio while you turn the volume down. It falls smoothly, and then the data stops. That is your margin.
bell103_fsk.inocpp
// An FSK modem in software: Bell 103 tones, generated and detected on an ESP32.
//
// Transmit by switching between two sine tables; receive with a pair of Goertzel filters,
// one tuned to mark and one to space, deciding whichever is louder over each bit period.
//
// This genuinely works. Feed the DAC output into another machine's microphone input, or
// join the two boards with an audio cable and a couple of capacitors, and you have a
// 300 baud link over anything that carries voice -- including, if you are feeling
// historical, a loudspeaker and a microphone across the room.
//
// Wiring: GPIO25 (DAC1) -> 1uF -> line out / speaker
//         GPIO34 (ADC1) <- 1uF <- line in / microphone preamp, biased to mid-rail

const int PIN_TX = 25;
const int PIN_RX = 34;

const float FS      = 9600.0;    // sample rate
const float BAUD    = 300.0;
const float F_MARK  = 1270.0;    // originate mark  (logic 1)
const float F_SPACE = 1070.0;    // originate space (logic 0)
const int   N       = (int)(FS / BAUD);   // 32 samples per bit

// ---- Goertzel: one DFT bin, two taps, no arrays
float goertzel(const int16_t *x, int n, float f) {
  float k = 2.0f * cosf(2.0f * PI * f / FS);
  float s1 = 0, s2 = 0;
  for (int i = 0; i < n; i++) {
    float s0 = (float)x[i] + k * s1 - s2;
    s2 = s1; s1 = s0;
  }
  return s1 * s1 + s2 * s2 - k * s1 * s2;
}

void txBit(int bit) {
  float f = bit ? F_MARK : F_SPACE;
  static float phase = 0.0f;                 // CONTINUOUS phase across bits: no clicks,
  for (int i = 0; i < N; i++) {              // and clicks are broadband energy that the
    phase += 2.0f * PI * f / FS;             // far end's filters would hear as both tones
    if (phase > 2.0f * PI) phase -= 2.0f * PI;
    dacWrite(PIN_TX, (int)(127.5f + 127.0f * sinf(phase)));
    delayMicroseconds((unsigned)(1e6 / FS));
  }
}

void txByte(uint8_t b) {
  txBit(0);                                  // start bit -- blueprint 1's framing, on tones
  for (int i = 0; i < 8; i++) txBit((b >> i) & 1);
  txBit(1);                                  // stop bit
}

int rxBit(int16_t *buf) {
  for (int i = 0; i < N; i++) {
    buf[i] = (int16_t)(analogRead(PIN_RX) - 2048);   // remove the mid-rail bias
    delayMicroseconds((unsigned)(1e6 / FS));
  }
  return goertzel(buf, N, F_MARK) > goertzel(buf, N, F_SPACE) ? 1 : 0;
}

void setup() {
  Serial.begin(115200);
  delay(300);
  analogReadResolution(12);
  analogSetPinAttenuation(PIN_RX, ADC_11db);

  static int16_t buf[64];

  Serial.println("# Bell 103 FSK, 300 baud");
  Serial.printf("# mark %.0f Hz, space %.0f Hz, %d samples per bit\n", F_MARK, F_SPACE, N);
  Serial.println("# transmitting 'YOUBLOB' continuously; also reporting the two filter outputs");

  const char *msg = "YOUBLOB";
  while (true) {
    for (const char *p = msg; *p; p++) txByte(*p);
    txBit(1); txBit(1);                      // idle at mark between messages

    // Report what the detector sees, so you can watch the margin rather than guess at it.
    rxBit(buf);
    float m = goertzel(buf, N, F_MARK), s = goertzel(buf, N, F_SPACE);
    Serial.printf("mark=%.0f space=%.0f ratio=%.2f\n", m, s, (m > s ? m / (s + 1) : s / (m + 1)));
    delay(200);
  }
}

void loop() {}

សម្ភារៈសម្រាប់ជំហាននេះ៖

Electret MicrophoneElectret Microphone1 ដុំ
Capacitor KitCapacitor Kit1 ដុំ
Resistor KitResistor Kit1 ដុំ

ឧបករណ៍ដែលត្រូវការ៖

ESP32 Development BoardESP32 Development Board
Speaker (Lab)Speaker (Lab)
Digital OscilloscopeDigital Oscilloscope
Breadboard - ClassicBreadboard - Classic
Jumper Wire SetJumper Wire Set
3

Tones, detection and Shannon's ceiling

កំពុងផ្ទុកសៀវភៅ Jupyter…

ឧបករណ៍ដែលត្រូវការ៖

Desktop ComputerDesktop Computer
4

Compendium: what a modem is really negotiating

WHY FULL DUPLEX NEEDED FOUR TONES. Both ends want to transmit at once on one pair. Bell 103 solves it by frequency division: the originating end lives at 1070/1270 and the answering end at 2025/2225, with 755 Hz of clear space between the bands. Later standards ran out of room for that and switched to echo cancellation — transmit and receive in the SAME band, and subtract a model of your own signal from what comes back. That is the reason V.32 and later needed a digital signal processor and Bell 103 needed four filters. AGAINST THE BROADCAST FM BLUEPRINT. Wideband FM spends 150 kHz of spectrum to buy noise immunity, because the broadcaster has spectrum and wants quality. A modem has three kilohertz that it cannot widen at any price, so every advance had to come from packing more bits into each symbol instead. Same modulation family, opposite constraint, and it is the constraint that shapes the engineering. WHAT THIS LAYER ACTUALLY PROMISED. Not reliability — a modem hands up whatever it decoded, errors included, which is why the CRC of the previous blueprint sits above it and why every file-transfer protocol of the era carried its own checksum. The modem's only promise is that bits go in one end and come out the other. Every blueprint after this one is built on how thin that promise is.

សម្ភារៈ

3
  • Electret Microphoneកម្រៃ 10%
    1 ដុំ
    $1.21
  • 1 ដុំ
    កន្លែងទុក
  • Resistor Kit — E12កម្រៃ 10%
    1 ដុំ
    Magento Legacy Storeships internationally
    ចាប់ពី$5.79

ឧបករណ៍ចាំបាច់

7
  • កន្លែងទុក
  • Digital Oscilloscopeកម្រៃ 10%
    Magento Legacy Storeships internationally
    កន្លែងទុក
  • កន្លែងទុក
  • កន្លែងទុក
  • Breadboard - Classicកម្រៃ 10%
    $9.67
  • កន្លែងទុក
  • កន្លែងទុក
សរុបប៉ាន់ស្មាន
អ្វីដែលអ្នកផលិតបានទិញ។ សម្ភារៈដែលបង្ហាញដោយគ្មានតម្លៃ គឺទិញនៅកន្លែងដែលអ្នករកបាន។
$1.21

CC0 សាធារណៈ

ប្លង់នេះត្រូវបានចេញផ្សាយក្រោម CC0។ អ្នកមានសិទ្ធិចម្លង កែប្រែ ចែកចាយ និងប្រើប្រាស់ដោយមិនចាំបាច់សុំអនុញ្ញាត។

គាំទ្រអ្នកបង្កើតដោយទិញផលិតផលតាមរយៈប្លង់របស់ពួកគេ ដែលពួកគេទទួលបាន កម្រៃជើងសារអ្នកបង្កើត កំណត់ដោយអ្នកលក់ ឬបង្កើតកំណែថ្មីនៃប្លង់នេះ ហើយបញ្ចូលជាការតភ្ជាប់ក្នុងប្លង់របស់អ្នកដើម្បីចែករំលែកចំណូល។

ការពិភាក្សា

(0)

ចូល ដើម្បីចូលរួមពិភាក្សា

កំពុងផ្ទុកមតិ...