How an iPhone sends a time signal
Time-signal stations broadcast on longwave, between 40 and 77.5 kHz. An iPhone has no transmitter for that band. MoyiWave sets a radio-controlled watch using only the speaker. This note covers the physics it relies on and what the signal looks like on a scope.
The problem: digital audio stops at 24 kHz
iPhone audio is sampled at 48 kHz. By the sampling theorem, the highest frequency an app can specify directly is half of that, 24 kHz. The lowest of the six stations is at 40 kHz and the highest at 77.5 kHz. All of them are out of reach.
Principle 1: harmonics carry the frequency up
The sampling theorem limits the waveform an app can specify. It does not limit the current that ends up in the speaker coil. After the signal leaves the digital side it goes through an amplifier and drives a load that is not linear. Along the way the current picks up components at integer multiples of the fundamental. These are harmonics.
So the fundamental stays below 24 kHz, and one of its harmonics is placed exactly on the station frequency. The plot below is an illustrative spectrum: the leftmost peak is the fundamental and each peak to its right is a harmonic. Drag any peak sideways, or press a station below, to see which fundamentals put a harmonic on a station frequency.
Higher harmonics are much weaker than the fundamental, but the receiver helps. The antenna and receiver circuit in a radio-controlled watch respond only to a very narrow band around the station frequency. The fundamental and the other harmonics fall outside it. As far as the watch is concerned, only the harmonic on the station frequency exists.
Because the receiver is that narrow, the frequency has to be accurate. The audio clock comes from a crystal oscillator. Its error is small, and it stays inside the receiver band even after being multiplied by the harmonic number.
Making that one harmonic strong enough is where most of the work in MoyiWave went. Left to ordinary distortion, the harmonics a circuit produces are weak. The current version strengthens it with a purpose-designed drive waveform, arrived at through many rounds of measuring on the scope and adjusting; it is the main piece of know-how in the app. The next step is still in development: synthesizing the drive waveform as a Fourier series, with a few frequency components below 24 kHz whose relative amplitudes and phases are chosen on purpose. Through the nonlinearity of the amplifier and the speaker, those components combine into new frequencies and strengthen the harmonic on the station frequency further.
Principle 2: the speaker coil is the transmitter
A speaker contains a coil. Current through the coil creates a magnetic field around it; when the current changes tens of thousands of times a second, so does the field.
The antenna in a radio-controlled watch is also a coil, wound on a ferrite rod. When the magnetic field around it changes, a current is induced in that coil, and that is how the watch picks up the signal.
So between the phone and the watch, two coils close together induce each other. It is the same principle as a transformer, except that the coils are separated by air and the coupling is weak.
A distant station sends its signal as a radio wave; the phone reaches the watch directly through the magnetic field, a few centimetres away. To the watch the two are the same: its antenna sees a signal at the same frequency, carrying the time code.
Principle 3: the time code
Every station sends data by changing the carrier amplitude, one symbol per second, with the duration standing for different values. The six formats all differ; the specs are on the stations page. MoyiWave keys that one harmonic on and off, second by second, in the format of the selected station. The receiver chip looks at the length of the envelope, so on-off keying is enough.
Measurement: JJY40
The figure below shows the signal measured during development, while MoyiWave was sending JJY40.
The upper half is the time axis. The carrier turns on once per second, and how long it stays on is the bit: in JJY, 0.8 s is a 0, 0.5 s is a 1 and 0.2 s is a marker. The four bursts in the figure read 0, marker, 0, 0.
The lower half is the spectrum of the same signal. The tallest peak is the fundamental. Harmonics follow at equal spacing to the right. Three times the fundamental, the third harmonic, lands on 40 kHz, the JJY40 station frequency.
On the time axis, read only where each burst starts and ends. The diamond patterns and ripples inside are display aliasing: at 500 ms per division the scope cannot resolve individual cycles. They are not the shape of the signal.
The 40 kHz peak is far below the fundamental. That is expected, and it leads directly to the limits below.
Limits
The watch has to sit against the speaker. Inductive coupling falls off roughly with the cube of distance. Double the distance and one eighth is left. The harmonic is weak to begin with, so there is very little distance to spare.
Orientation matters. A ferrite-rod antenna is directional. It works best when the field lines run along the rod. Turning the watch changes how much signal it gets.
DCF77 is the hardest. 77.5 kHz is the highest of the six frequencies and the farthest from the audio band. The least energy gets there.