9M2PJU WebTimeSignal: Universal Browser-Based Radio Clock Synchronizer for Casio, Citizen, Seiko, and Atomic Timepieces
TL;DR: 9M2PJU WebTimeSignal is a free, open-source web application that turns any smartphone, tablet, or computer into a multi-standard low-frequency (LF) radio time transmitter. By synthesizing high-slew-rate square waves through the HTML5 Web Audio API, connected headphone coils radiate precise 3rd and 5th harmonics to calibrate radio-controlled watches without physical radio towers. Version 2.0 introduces multi-protocol support (JJY 40/60 kHz, WWVB, DCF77, MSF, and BPC), anti-phase differential stereo drive for double coil induction, non-linear WaveShaper harmonic overdrive, background Web Worker lookahead scheduling, and sub-millisecond atomic NTP synchronization via Cloudflare Edge PTP/GPS references.
What Is 9M2PJU WebTimeSignal?
9M2PJU WebTimeSignal is a universal, open-source browser application that emulates global low-frequency (LF) time signal stations (JJY, WWVB, DCF77, MSF, and BPC) through consumer headphone coils using Web Audio harmonic modulation and hardware-referenced edge atomic synchronization.
+-----------------------------------------------------------------------------------------+
| HOST DEVICE (Browser) |
| [ Cloudflare PTP/GPS Edge ] --> [ RFC 5905 NTP Filter ] --> [ Protocol Frame Encoder ] |
| | |
| [ Destination ] <-- [ WaveShaper Overdrive ] <-- [ Differential Drive (+-180 deg) ] <--+
+-------------------------------------------+---------------------------------------------+
| Audio Output (100% Volume)
v
[ Earphone Coil Loops ]
| ~~~~ Weak LF Magnetic Flux (40-77.5 kHz)
v
[ Radio-Controlled Timepiece ]
(Internal Ferrite Rod Antenna)
Millions of wristwatches, alarm clocks, and wall clocks worldwide rely on terrestrial longwave time broadcasts to maintain split-second atomic precision. Timepieces from brands such as Casio (Wave Ceptor and G-Shock Multi-Band 6), Citizen (Eco-Drive Radio-Controlled), Seiko (Radio Wave Control), Junghans, Braun, and Rhythm feature internal ferrite bar antennas tuned to regional atomic transmitters:
- JJY (Japan): 40 kHz (Mount Otakadoya, Fukushima) and 60 kHz (Mount Hagane, Saga/Fukuoka)
- WWVB (United States): 60 kHz (Fort Collins, Colorado, operated by NIST)
- DCF77 (Germany / Mainland Europe): 77.5 kHz (Mainflingen, operated by PTB)
- MSF (United Kingdom): 60 kHz (Anthorn, Cumbria, operated by NPL)
- BPC (China): 68.5 kHz (Shangqiu, Henan, operated by NTSC)
Why Radio Clocks Fail Indoors and Abroad
While longwave signals travel hundreds of kilometers through groundwave and skywave propagation, real-world reception frequently fails. Modern reinforced concrete structures, steel framing, and low-emissivity insulated glass create severe RF attenuation, turning rooms into unintended Faraday cages. Urban environments add high levels of electromagnetic interference (EMI) from switching power supplies, LED drivers, monitors, and wireless chargers.
Furthermore, horology enthusiasts and collectors who import Japanese Domestic Market (JDM) or European timepieces into regions outside transmitter footprints (such as Southeast Asia, Australia, or South America) find their radio functions dormant. Without nightly radio synchronization, these watches fall back to uncorrected quartz mode, drifting by several seconds each month.
9M2PJU WebTimeSignal (GitHub Repository) eliminates the need for expensive dedicated RF signal generators, specialized microcontroller hardware, or Raspberry Pi transmitters. It delivers an instant, zero-install calibration tool accessible from any modern web browser on Android, iOS, Windows, macOS, or Linux.
Physics of Harmonic Transmission: Bypassing the Sound Card Nyquist Limit
Standard consumer computer sound cards and smartphone audio digital-to-analog converters (DACs) operate at sample rates of 44.1 kHz or 48 kHz. According to the Nyquist-Shannon sampling theorem, an audio DAC running at 48 kHz cannot generate fundamental analog sine waves higher than 24 kHz. Producing a fundamental 40 kHz, 60 kHz, 68.5 kHz, or 77.5 kHz sine wave directly through an audio jack is impossible with standard consumer hardware.
WebTimeSignal overcomes this hardware constraint through odd harmonic radiation derived from high-slew-rate square waves.
Mathematical Proof of Harmonic Energy
A periodic square wave of fundamental frequency f0 and amplitude A can be represented mathematically by its infinite Fourier series containing only odd integer multiples of the fundamental:
x(t) = (4A / π) × ∑k=1,3,5,… (1/k) × sin(2πkf0t) = (4A / π) × [sin(2πf0t) + (1/3)sin(6πf0t) + (1/5)sin(10πf0t) + (1/7)sin(14πf0t) + …]
By tuning the base audio fundamental frequency f0, its 3rd harmonic (3f0) or 5th harmonic (5f0) falls precisely onto the carrier frequency required by the target time station:
| Target Standard | Carrier Frequency | Base Fundamental (f0) | Harmonic Order | Harmonic Derivation |
|---|---|---|---|---|
| JJY 40 kHz (Japan) | 40.000 kHz | 13.3333 kHz | 3rd Harmonic | 13.3333 kHz × 3 = 40.000 kHz |
| JJY 60 kHz (Japan) | 60.000 kHz | 20.0000 kHz | 3rd Harmonic | 20.0000 kHz × 3 = 60.000 kHz |
| WWVB 60 kHz (USA) | 60.000 kHz | 20.0000 kHz | 3rd Harmonic | 20.0000 kHz × 3 = 60.000 kHz |
| MSF 60 kHz (UK) | 60.000 kHz | 20.0000 kHz | 3rd Harmonic | 20.0000 kHz × 3 = 60.000 kHz |
| DCF77 77.5 kHz (Germany) | 77.500 kHz | 15.5000 kHz | 5th Harmonic | 15.5000 kHz × 5 = 77.500 kHz |
| BPC 68.5 kHz (China) | 68.500 kHz | 13.7000 kHz | 5th Harmonic | 13.7000 kHz × 5 = 68.500 kHz |
+---------------------+ +-----------------------+ +----------------------+
| Web Audio Engine | | DAC & Headphone Amp | | Earphone Voice Coil |
| Square Wave (f0) | --> | 100% Volume Output | --> | Radiates f0, 3f0, |
| (e.g., 13.333 kHz) | | (Steep Transitions) | | 5f0 Harmonic Spurs |
+---------------------+ +-----------------------+ +----------------------+
|
v
+----------------------+
| Watch Ferrite Core |
| Narrowband Receiver |
| (Tuned to 40.000 kHz)|
+----------------------+
When this square-wave signal flows through the copper voice coil of an ordinary earphone or headphone, the coil behaves as a small magnetic loop antenna. While the base fundamental frequency (such as 13.333 kHz or 20.0 kHz) sits near the upper threshold of human hearing, the earphone coil radiates electromagnetic energy at the harmonic frequencies. The high-Q tuned ferrite bar antenna inside the radio watch acts as a sharp bandpass filter, ignoring the audible fundamental and capturing the LF harmonic carrier.
RF and Audio Engineering Innovations in WebTimeSignal v2.0
Early proof-of-concept web tools suffered from weak magnetic coupling, clock drift, and audio glitches when browser tabs were backgrounded. WebTimeSignal v2.0 incorporates several dedicated RF and digital audio engineering techniques to maximize signal integrity and receiver locking speed.
1. Anti-Phase Differential Stereo Drive (+180 Degree Polarity Inversion)
Standard stereo audio playback drives both the Left and Right channels in-phase against a shared ground return pin. WebTimeSignal incorporates an Anti-Phase Differential Engine:
- Left Channel: +1.0 × Waveform(t)
- Right Channel: -1.0 × Waveform(t) (180 degree phase inverted)
Left Channel (+) : ──/\──/\──/\──/\── (+V)
Right Channel (-) : ──\/──\/──\/──\/── (-V)
Differential Potential Across Coils: V_diff = (+V) - (-V) = 2V (+6 dB Voltage Gain)
When an earphone cable is wrapped around a watch, the total electromagnetic potential difference across the dual transducer coils is:
Vdiff(t) = VL(t) – VR(t) = V(t) – (-V(t)) = 2V(t)
This achieves a 2x peak-to-peak voltage swing (+6 dB power gain) compared to single-ended mono signals. According to Biot-Savart’s law, magnetic flux density is directly proportional to current (B ∝ N × I). Doubling the effective drive voltage doubles the instantaneous current, strengthening the near-field magnetic flux and doubling the physical coupling range to the watch antenna.
2. WaveShaper Harmonic Overdrive
To prevent digital aliasing, modern web browsers internally smooth square wave transitions using band-limiting tables. WebTimeSignal forces high-energy harmonic generation by routing the synthesized signal through a custom non-linear WaveShaperNode with a sharp sigmoid clipping curve:
f(x) = ((3 + k) × x × 20°) / (π + k × |x|)
This non-linear transfer function sharpens the voltage slew rate (dV/dt) during polarity flips, pumping substantial RF energy into the 3rd and 5th harmonic sidebands where the watch receiver operates.
3. Background Lookahead Scheduler and Web Worker Heartbeat
Web browsers routinely throttle setTimeout and setInterval timers down to once per second when tabs are minimized or the screen dims to conserve battery. Such throttling disrupts time signal pulse widths, causing watches to reject frames due to parity or bit timing errors.
WebTimeSignal overcomes this limitation with a two-tier scheduling engine:
- Dedicated Web Worker Heartbeat (
worker-timer.js): Web Workers run on separate OS background threads exempt from browser throttling. The worker fires a steady 25-millisecond heartbeat pulse. - AudioContext Lookahead Scheduling: On every heartbeat tick, the scheduler examines the next 1.5-second time window and schedules square-wave bursts directly into the hardware-clocked
AudioContexttimeline (ctx.currentTime). - Microsecond Click-Free Envelope Shaping: Every pulse applies a 2-millisecond exponential ramp at start and end. This prevents audio DAC popping artifacts while maintaining steep pulse transitions.
- Screen Wake Lock API: Automatically acquires a screen wake lock on supported devices to keep mobile screens active throughout the multi-minute transmission cycle.
High-Precision Multi-Source Atomic NTP Synchronization
A time transmitter must broadcast the exact second without local clock errors. If a computer clock is off by even 500 milliseconds, the watch will calibrate to the incorrect time or fail to decode minute markers.
WebTimeSignal integrates an RFC 5905 Clock Filter and Multi-Source Atomic Aggregation Engine:
+-----------------------------------------------------------------------------------------+
| STRATUM 0 / 1 PHYSICAL REFERENCE |
| [ NIST Cesium Fountain ] [ NICT Atomic Clocks ] [ PTB Primary Clocks ] [ GNSS Satellites ] |
+-----------------------------------------------------------------------------------------+
|
v
+-----------------------------------------------------------------------------------------+
| CLOUDFLARE GLOBAL ANYCAST EDGE LAYER (PTP / NTS) |
| [ Edge Worker /api/time ] [ Global NTS /cdn-cgi/trace ] [ Anycast DNS 1.1.1.1 / 1.0.0.1 ] |
+-----------------------------------------------------------------------------------------+
|
v
+-----------------------------------------------------------------------------------------+
| BROWSER ATOMIC NTP ENGINE (ntp-sync.js) |
| 1. Multi-Burst Probing (8-12 Interleaved Network Samples) |
| 2. Monotonic Microsecond Timestamping (performance.now()) |
| 3. Round-Trip Time (RTT) Sorting & Top 50% Outlier Rejection |
| 4. Median Offset & RMS Jitter (+-sigma) Calculation |
| 5. Continuous Crystal Drift Compensation (5-Minute Background Cycle) |
+-----------------------------------------------------------------------------------------+
Atomic Synchronization Pipeline
- Dedicated Edge Atomic Endpoint (
/api/time): Powered by Cloudflare Pages Functions running on edge nodes synchronized directly to hardware PTP (Precision Time Protocol) and GPS stratum-1 master clocks. - Multi-Burst Interleaved Sampling: Probes
/api/time,cloudflare.com/cdn-cgi/trace,1.1.1.1, and1.0.0.1in rapid succession, capturing 8 to 12 timing samples. - Monotonic Latency Measurement: Employs
performance.now()to compute exact network Round-Trip Time (RTT) independent of local operating system clock adjustments. - RFC 5905 Delay Minimum Sorting: Sorts all samples by latency and discards the upper 50% high-jitter/bufferbloat samples.
- Statistical Jitter Estimation: Calculates the median clock offset and standard deviation (RMS jitter), displaying real-time metrics (typically < 20 ms RTT latency and ±0.5 ms jitter) on the UI.
- Quartz Thermal Drift Tracking: Re-syncs every 5 minutes in the background to compensate for local computer quartz oscillator drift.
Supported Time Signal Broadcast Standards
WebTimeSignal v2.0 implements full frame encoders for the five major global longwave atomic time standards.
JJY : [0.2s Marker] [0.5s Bit 1] [0.8s Bit 0]
WWVB : [0.8s Marker] [0.5s Bit 1] [0.2s Bit 0]
DCF77 : [0.1s Bit 0] [0.2s Bit 1] [Missing Pulse at Second 59 = Sync]
MSF : [0.5s Marker] [0.2s Bit 1] [0.1s Bit 0]
BPC : 20-Second Sub-Frames [0.1s: 00 | 0.2s: 01 | 0.3s: 10 | 0.4s: 11]
Complete JJY 60-Second Frame Allocation (Seconds 00 to 59)
The Japanese JJY standard transmits a 60-second amplitude-modulated frame. Pulse widths represent symbols: Marker M/P (200 ms tone), Binary 1 (500 ms tone), and Binary 0 (800 ms tone).
| Second | Field | Encoding and Bit Weights |
|---|---|---|
| 00 | M | Minute Reference Marker (200 ms tone) |
| 01 – 08 | Minute | BCD Minute: 40, 20, 10, 0 (fixed), 8, 4, 2, 1 |
| 09 | P1 | Position Marker 1 (200 ms tone) |
| 10 – 18 | Hour | BCD Hour: 0, 0, 20, 10, 0 (fixed), 8, 4, 2, 1 |
| 19 | P2 | Position Marker 2 (200 ms tone) |
| 20 – 28 | Day of Year (High/Mid) | BCD Day count from Jan 1: 0, 0, 200, 100, 0, 80, 40, 20, 10 |
| 29 | P3 | Position Marker 3 (200 ms tone) |
| 30 – 33 | Day of Year (Low) | BCD Day count units: 8, 4, 2, 1 |
| 34 – 35 | Reserved | Fixed binary zero (00) |
| 36 | PA1 | Parity for Hour (even parity across hour bits) |
| 37 | PA2 | Parity for Minute (even parity across minute bits) |
| 38 | SU1 | Summer Time / Daylight Saving indicator 1 |
| 39 | P4 | Position Marker 4 (200 ms tone) |
| 40 | SU2 | Summer Time active state (1 = DST active, 0 = Standard) |
| 41 – 48 | Year | BCD Year: 80, 40, 20, 10 (tens) + 8, 4, 2, 1 (units) |
| 49 | P5 | Position Marker 5 (200 ms tone) |
| 50 – 52 | Day of Week | Binary Day of Week: 4, 2, 1 (0 = Sunday … 6 = Saturday) |
| 53 – 54 | Leap Second (LS1, LS2) | 00 = Normal, 11 = Positive leap second (+1s) |
| 55 – 58 | Reserved | Fixed binary zero (0000) |
| 59 | P0 | Position Marker 0 / End-of-Frame Marker (200 ms tone) |
Summary of Other Supported Standards
- WWVB (USA, 60 kHz): Uses Pulse Width Modulation with 0.8s frame markers, 0.5s binary ones, and 0.2s binary zeros. Transmits UTC time, day of year, year, UT1 correction, leap year, and daylight saving status flags.
- DCF77 (Germany, 77.5 kHz): Transmits CET/CEST civil time. Second 0 is a start marker, seconds 1 to 14 contain civil warning and meteorological data, second 15 is call-bit, second 20 is start of time code, seconds 21 to 58 encode minute, hour, day, day-of-week, month, year, and parity bits. Second 59 has no modulation, serving as the minute synchronizer.
- MSF (UK, 60 kHz): Transmits fast BCD time code. Second 00 is a 500 ms minute identifier. Seconds 01 to 59 encode duty-cycle modulated BCD year, month, day, day of week, hour, minute, and parity bits.
- BPC (China, 68.5 kHz): Operates on a 20-second repeat cycle. Each second transmits one of four distinct states: 0.1s (
00), 0.2s (01), 0.3s (10), or 0.4s (11), carrying BCD hour, minute, weekday, and morning/afternoon flags.
Hardware Compatibility Guide
WebTimeSignal works with any watch, alarm clock, or wall clock equipped with an internal low-frequency radio receiver and ferrite antenna.
| Manufacturer | Compatible Product Families and Movements | Supported Station Protocols |
|---|---|---|
| Casio | G-Shock Multi-Band 6 & Multi-Band 5 (GW-M5610, GW-9400 Rangeman, Mudmaster, Frogman, MT-G, MR-G) Wave Ceptor (WV-58, WV-59, WVA-M630, WVA-M640, WVA-M650) Oceanus, Pro Trek, Edifice, Lineage (LCW series) |
JJY40 / JJY60 (Japan)WWVB (USA)DCF77 (Europe)MSF (UK)BPC (China) |
| Citizen | Eco-Drive Radio-Controlled, Attesa, Promaster Sky/Land, Exceed Perfex Multi 3000 calibers (Cal. H800, H804, H145, E660, CB0011, etc.) Domestic Japanese timepieces (Cal. H415, H416, 8RZ152) |
JJY40 / JJY60 (Japan)WWVB / DCF77 (Global models) |
| Seiko | Radio Wave Control (電波修正クロック) Brightz, Dolce & Exceline, Spirit Smart Seiko Digital & Analogue Radio Wall/Desk Clocks (SQ, DL, KX series) |
JJY40 / JJY60 (Japan)WWVB (USA)DCF77 (Europe) |
| Junghans | Max Bill Mega, Meister Mega, Radio-Controlled Mega 1000 / Force | DCF77 (Europe)JJY40WWVB |
| Braun / TFA / Oregon | Braun Digital & Analogue Radio Clocks (BNC008, BC09-DCF) TFA Dostmann, Oregon Scientific, AcuRite, La Crosse Technology Atomic Wall Clocks |
DCF77 (Europe)WWVB (North America)MSF (UK) |
| Rhythm / Mag / Maruman | Rhythm Radio Wall & Alarm Clocks (電波掛時計 / 電波目覚まし時計) MAG (ノア精密), Maruman, Casio IQ/TQ Wall Clocks |
JJY40 / JJY60 |
Incompatible Watch Technologies
Note: The following timepiece types do not use longwave radio signals and cannot be calibrated using this tool:
- GPS Satellite Watches: Citizen Satellite Wave (F150/F900/F950) and Seiko Astron GPS Solar in satellite mode (these listen to 1.575 GHz microwave GPS signals).
- Bluetooth-Only Watches: Watches that synchronize exclusively through proprietary smartphone Bluetooth apps without built-in radio receivers.
- Standard Quartz and Mechanical Watches: Watches without built-in radio synchronization circuitry.
Comparison: WebTimeSignal vs Alternative Synchronization Methods
| Feature / Metric | 9M2PJU WebTimeSignal v2.0 | Original Web JJY | ESP32 / RPi Emulators | Real Terrestrial Towers |
|---|---|---|---|---|
| Cost | $0.00 (Free) | $0.00 (Free) | $15 – $60 (Hardware) | Billions (Government) |
| Installation | Zero Install (Browser / PWA) | Zero Install (Browser) | Flashing firmware / Linux | None |
| Supported Standards | JJY (40/60), WWVB, DCF77, MSF, BPC | JJY 40 kHz only | Typically 1 or 2 | Fixed regional standard |
| Time Source | Cloudflare Edge PTP/GPS NTP | Local system clock | Local NTP or GPS module | Cesium Atomic Standard |
| Audio Drive Output | Anti-Phase Differential (+6 dB) | Single-ended mono/stereo | Direct GPIO square wave | High-power RF (10-50 kW) |
| Harmonic Overdrive | WaveShaper Sigmoid Curve | None (Raw oscillator) | None | N/A |
| Background Tab Safe | Yes (Web Worker Timer) | No (Browser throttles) | Yes (Dedicated MCU) | N/A |
| Visual Frame Inspector | 60-cell real-time BCD inspector | None | Serial console text | N/A |
| Offline Support | Yes (PWA Service Worker) | No | Yes | N/A |
Step-by-Step Guide: Synchronizing Your Radio Watch
+----------------------------------+
| Radio-Controlled Clock |
| +--------------------+ |
| | 12:34:56 [RC] | |
| +--------------------+ |
+----------------------------------+
| | | | | |
| | | | | | <-- 2 to 4 loops of
+----+-----+----+-----+----+ earphone cable
| |
+--------+-------+
|
[3.5mm Jack]
|
+-------------------+
| Host Audio Output |
+-------------------+
1. Open the Web App
Open https://time.hamradio.my on your mobile phone, laptop, or desktop computer. Verify the top status pill confirms: “Synced with atomic internet time (Cloudflare NTP)”. If needed, click “Sync NTP (Atomic Time)” to force a fresh multi-burst probe.
2. Connect Your Earphones
Plug standard wired earphones, headphones, or a 3.5mm auxiliary cable into your device’s headphone jack (or a USB-C / Lightning DAC adapter).
3. Wrap Cable Around the Timepiece
Wrap the earphone cable 2 to 4 times around the watch case or clock body.
- On Casio G-Shock and Wave Ceptor wristwatches, the internal ferrite bar antenna is located near the 12 o’clock position (top edge of the case). Place the earphone earbuds directly against the top bezel or case back.
- On radio wall clocks and desk clocks, the antenna is usually oriented horizontally along the top edge of the housing.
4. Set Volume to Maximum
Adjust your device master audio volume to 100%.
5. Select Protocol & Test Carrier
- In the Time Signal Standard dropdown, select the protocol matching your timepiece (e.g., JJY 40 kHz for Japan Domestic Market watches, WWVB 60 kHz for US models, or DCF77 77.5 kHz for European clocks).
- Ensure both Anti-Phase Differential Stereo Drive and WaveShaper Harmonic Overdrive checkboxes are enabled.
- Click “Test 1s Carrier Tone” to verify audio output.
6. Start Transmission & Trigger Watch Sync
- Click “Start Transmission”. The oscilloscope canvas and 60-second real-time frame inspector will illuminate.
- Trigger manual radio reception on your timepiece by pressing and holding its manual sync button (often labeled
RC,RECEIVE,WAVE, or buttonDon Casio watches) for 2 to 3 seconds until the display indicates receive mode (RCVD,WAVE, or flashing signal strengthL1/L2/L3).
7. Maintain Stillness During Calibration
Keep the setup completely stationary for 2 to 5 minutes. Radio timepieces require 2 to 3 consecutive error-free 60-second frames to verify checksum parity before adjusting their hands or digital displays. Once the watch confirms sync, click “Stop Transmission”.
Safety and Hearing Protection Warning
CAUTION: DO NOT WEAR EARPHONES IN OR NEAR YOUR EARS WHILE TRANSMITTING.
9M2PJU WebTimeSignal outputs high-amplitude, high-frequency square waves (12 kHz to 20 kHz) at 100% master volume. Listening directly through headphones or earbuds can cause immediate acoustic trauma, permanent hearing damage, severe tinnitus, or pain. Keep audio hardware positioned solely on the timepiece housing, safely away from ears, children, and pets.
Codebase Architecture and Automated Testing
9M2PJU WebTimeSignal is engineered in vanilla ES6 JavaScript with zero external runtime dependencies, ensuring high execution speed, small bundle footprint, and full offline functionality.
9M2PJU-WebTimeSignal/
├── index.html # Responsive UI with Open Graph & Schema.org JSON-LD
├── manifest.webmanifest # PWA Manifest for standalone home screen install
├── sw.js # Service Worker for 100% offline caching
├── css/app.css # Dark/Light theme styles, 60-cell inspector grid
├── js/
│ ├── app.js # Application controller and UI orchestrator
│ ├── i18n.js # Multilingual support (English, Malay, Japanese)
│ ├── audio-engine.js # Web Audio engine with Differential Drive & Lookahead
│ ├── ntp-sync.js # RFC 5905 Atomic NTP synchronization engine
│ ├── worker-timer.js # Background Web Worker heartbeat timer
│ └── encoders/
│ ├── base-encoder.js # Common BCD, Day-of-Year, and parity math
│ ├── jjy.js # JJY 40/60 kHz encoder (Japan)
│ ├── wwvb.js # WWVB 60 kHz encoder (USA / NIST)
│ ├── dcf77.js # DCF77 77.5 kHz encoder (Germany / PTB)
│ ├── msf.js # MSF 60 kHz encoder (UK / Anthorn)
│ └── bpc.js # BPC 68.5 kHz encoder (China / Shangqiu)
├── functions/api/time.js # Cloudflare Edge Worker for atomic PTP/GPS time
└── tests/ # Automated unit test suite (Node.js + in-browser)
Automated Unit Test Suite
The project includes an automated test suite validating date algorithms, BCD conversions, frame structures, and parity calculations:
BaseEncoder.isLeapYear: Accurately identifies leap years including century exceptions (1900 vs 2000).BaseEncoder.getDayOfYear: Validates 1-based Day of Year calculations across leap and non-leap years.BaseEncoder.calcEvenParity/calcOddParity: Validates parity bit generation.JJYEncoder: Verifies 60-element frame layouts, marker placements (M,P1throughP5,P0), parity bits (PA1,PA2), and daylight saving transitions.WWVBEncoder,DCF77Encoder,MSFEncoder,BPCEncoder: Validates specific pulse durations, start bits, missing second-59 markers, and sub-frame cycle structures.
Tests can be executed via the command line with npm test or interactively in any web browser at https://time.hamradio.my/tests/.
Standalone Frequently Asked Questions (FAQ)
1. How does WebTimeSignal transmit radio waves using ordinary headphones?
Standard square audio waves contain odd harmonic frequencies. By playing a 13.333 kHz or 15.5 kHz square wave at maximum volume, the earphone copper voice coil radiates weak electromagnetic fields at the 3rd (40 kHz) or 5th (77.5 kHz) harmonic, which the watch antenna receives.
2. Why do I need to set the device volume to 100%?
Harmonic electromagnetic radiation from an unshielded headphone coil is naturally weak. Setting the audio volume to 100% maximizes coil current and magnetic flux density, ensuring the signal is strong enough for the watch’s internal ferrite receiver to detect.
3. Can WebTimeSignal calibrate GPS or Bluetooth watches?
No. WebTimeSignal only works with timepieces containing low-frequency (40 kHz to 77.5 kHz) radio receivers. GPS watches use 1.575 GHz microwave satellite signals, and Bluetooth-only watches require direct smartphone app communication.
4. How accurate is the time broadcast by WebTimeSignal?
WebTimeSignal synchronizes against Cloudflare edge servers tied to hardware PTP and GPS atomic clocks via an RFC 5905 clock filter. It measures network round-trip time and jitter, typically maintaining synchronization accuracy within a few milliseconds.
5. Why does synchronization take between two and five minutes?
Radio-controlled timepieces require two to three consecutive, error-free 60-second frames to decode timecodes, verify parity checksums, and confirm signal consistency before stepping quartz hands or updating digital displays.
Sources and Further Reading
- 9M2PJU WebTimeSignal Live Production Tool: https://time.hamradio.my
- 9M2PJU WebTimeSignal GitHub Repository: https://github.com/9M2PJU/9M2PJU-WebTimeSignal
- National Institute of Information and Communications Technology (NICT) – JJY Standard: http://jjy.nict.go.jp/
- NIST Time and Frequency Division – WWVB Radio Station: https://www.nist.gov/pml/time-and-frequency-division/time-distribution/radio-station-wwvb
- Physikalisch-Technische Bundesanstalt (PTB) – DCF77 Time Signal: https://www.ptb.de/cms/en/ptb/fachabteilungen/abt4/fb-44/ag-442/dissemination-of-legal-time/dcf77.html
- National Physical Laboratory (NPL) – MSF 60 kHz Time Signal: https://www.npl.co.uk/msf-signal
- National Time Service Center (NTSC), Chinese Academy of Sciences – BPC Broadcast: http://www.ntsc.cas.cn/
- W3C Web Audio API Specification: https://www.w3.org/TR/webaudio/
- IETF RFC 5905 – Network Time Protocol Version 4: https://datatracker.ietf.org/doc/html/rfc5905
- shogo82148 Web JJY Repository: https://github.com/shogo82148/web-jjy
73 de 9M2PJU



Post Comment