JWX (version) Help

JWX is Copyright © 2011, P. Lutus.

JWX is released under the GPL: http://www.gnu.org/licenses/gpl.html

Please visit http://www.arachnoid.com/JWX for more documentation and to acquire the latest version of JWX.

NOTE: For formatting reasons, users may want to temporarily make the JWX program frame larger to properly read these instructions.

Introduction | Radio Receiver | Installation | Initial Setup | Calibration | Audio Issues | In Depth | Technical | Version History | Resources




Figure 1: JWX in operation
Introduction

Figure 2: Printing a weather chart while underway
during my solo circumnavigation, 1988-1991

For the benefit of those who need marine weather information but are unable to access the Internet, the U.S. National Weather Service provides weather charts by way of shortwave radio. This service, variously called "weatherfax" or "HF radiofax", has worldwide coverage (other countries have similar services) and is ideal for ships at sea or anyone in a remote location. The service transmits daily marine weather summaries and forecasts, including satellite cloud cover images, wave heights, wind velocities and much more.

During my around-the-world solo sail I received weather charts using the setup shown in Figure 2 on this page — a shortwave receiver, a fax demodulator box, a laptop, and a printer to render the charts. By modern standards this arrangement was quite terrible and a frequent waste of paper — the receiver might not be tuned correctly, or a certain oscillator might be out of alignment, or reception wasn't good enough — and my first warning would be a scrambled or unreadable paper chart. Because I was often more than a thousand miles from the nearest patch of dry land, wasting printer paper was especially annoying.

It's many years later and I still venture across oceans (mostly in Alaska territory) and I still need the National Weather Service's weatherfax charts. Over the years I've made some changes, for example I began turning the weather chart data stream into a graphic image instead of sending it to a printer. But until this project I continued to rely on the original fax demodulator box to process the shortwave receiver's signals and turn them into a chart. I also looked into other, newer demodulator hardware, thinking some of the problems might have been solved in the twenty years since the original box was designed. But the newer fax demodulators I tested had all the same problems — difficult setup, inability to stay in alignment, poor performance, no gray scale, and (inevitably) software that only ran under Windows.


Figure 3: JWX locally-generated grayscale test image

Recently, in frustration, I decided to try creating a weatherfax demodulator/receiver entirely in software — no demodulator box, no printer, just a shortwave receiver attached to the computer's sound card. This strategy is only possible because computers are much faster, and sound cards more sophisticated, than they were a few years ago. My project was a complete success, and JWX is the result.

To use JWX, you need:

That's all — nothing else is needed.

Radio Receiver

Not all shortwave radios are created equal, and there are many very bad shortwave radios available. The best choice for fax reception is a stable, digital radio with the ability to tune and display frequencies with a resolution of less than one kilohertz. There are many suitable radios and I don't normally recommend a particular manufacturer's radio, but I can't resist saying if you got your shortwave radio at Radio Shack, chances are it's not suitable, but if the radio is made by Icom, chances are it's more than good enough. There are many receivers between these extremes, and most will produce acceptable results.

A typical reception setup consists of a radio, an external antenna connected to the radio with a coaxial cable (to shield against computer interference), and a computer with a sound card. A portable shortwave radio using its own whip antenna will probably not work if it's near the computer, because the computer's logic circuits create too much radio noise in the frequency band of interest.

Weatherfax transmitting stations use a special FM mode that allows them to transmit what amounts to a TV picture, but at a much slower rate than TV (transmitting a complete weather chart typically requires ten minutes). This slower rate allows reasonable-quality images to be broadcast over thousands of miles even in the presence of interference and fading.

The most up-to-date information about U.S. weatherfax schedules and frequencies is available at the National Weather Service marine weather site, but here is a recent list of U.S. transmission locations and frequencies (Winter 2010-2011):

To receive a weatherfax station, one tunes 1.9 KHz below the station's published frequency and selects upper-sideband mode. For example, to receive the Pt. Reyes 4346 KHz broadcast, tune to 4344.1 KHz.

Installation

As with most of my programs, JWX is released under the GPL.

This is the second version of this program. The first version was written in Python (WeatherReader), and was completely satisfactory, except I quickly discovered it wasn't going to be practical to create a Windows version (I run Linux, and Windows is always a second priority). So I rewrote the program in Java to assure platform portability.

Here are the JWX download options:

NOTE: To function as it should, JWX requires a current Java runtime engine:

Here is a typical sequence in a JWX setup:

To read the JWX program help file online (which is more or less the center part of this page), click here. Some information automatically included by the program is missing from the online copy.

Initial Setup
Calibration

Figure 4: Uncalibrated JWX reception example

In most ways, radiofax reception is a simple matter of decoding tones and constructing an image, but there is one exception — the radiofax protocol requires a very high degree of time synchronization between sender and receiver. To receive charts that are not diagonally out of alignment requires a clock synchronization accuracy of about one part in a million, much better accuracy than computer clocks tend to have.

JWX has a method to correct for clock errors, and it includes a simple calibration procedure to synchronize your computer's clock with a radiofax transmitter. To adjust your computer's timing, follow this procedure:

Audio Issues

While developing JWX I became aware that modern computer sound systems are not as simple as they could be. In the original design I opened default input and output sound channels, hoping the operating system would figure out what to do, but this turned out to be naïve. Current JWX versions have sound channel selectors for both input and output (located to the right of the green machine state display).

If the user is very lucky, choosing the first available input and output sound channels will provide satisfactory performance. But this won't always be true, and JWX locates and provides all available input and output channels for maximum flexibility.

In Depth

Automatic Reception

Once the above-described calibration procedure is complete, you can simply let JWX run unattended and collect weather charts — just click the "Receive" button. To be sure that JWX is ready to receive charts, check that there is a label at the lower center of the JWX display saying   Receive | WAITSIG   or   Receive | WAITSTB   and the incoming audio level is acceptable.

Unsynchronized Charts


Figure 6: Unsynchronized chart

As mentioned earlier, if you tune in a radiofax broadcast that is underway and you want to receive a partial chart, simply click the "Lock" button to force JWX to begin reception without synchronization. This will probably produce a chart as shown in Figure 6 — a perfectly good chart, but not synchronized. To correct such a chart, simply point your mouse cursor at the location of the green dot in Figure 6 and press the left mouse button. This will resynchronize the chart, either as it is received or later.

Remember these points:


Figure 7: JWX locally-generated
grayscale test pattern

Grayscale

A typical radiofax decoder only produces monochrome charts, but weatherfax services now transmit satellite cloud-cover images and other charts that are better received by a decoder able to resolve shades of gray. Because JWX supports grayscale and because this improves the quality of almost all received charts, it's recommended to leave grayscale mode enabled in most circumstances.

Data Conversion Rate

Weak-Signal Problems and Solutions


Figure 8: On-air JWX satellite cloud cover image
Shortwave radio reception varies greatly in quality, and there will be times when received signals are marginal. JWX has been designed to accommodate varying signal levels and noisy conditions, but there are some adjustments and practices that can increase the probability of successful chart reception:

Using an Audio Recorder

When sailing where weatherfax signals are weak, I sometimes turn off the computer (to reduce interference) and use a small solid-state audio recorder to record a series of weather chart transmissions in advance. After all the charts are recorded, I turn on the computer and play the recording into the computer instead of directly connecting the receiver. This greatly reduces interference created by the computer itself.

Technical

Figure 9: Radiofax FM Signal Diagram

Radiofax Protocol

Radiofax transmission uses a mode formally described as Frequency-Shift Keying (FSK or F3C), but the grayscale capability implies something more like frequency modulation (FM), in which any intermediate level may be included in the data stream.

The nominal deviation from a radiofax station's assigned carrier frequency is ± 400 Hz as shown in Figure 9. For a receiver tuned 1.9 KHz below the assigned carrier frequency, the black level is 1500 Hz, gray 1900 Hz and white 2300 Hz. Grayscale data can produce any level intermediate between the black and white extremes.

There are two special modulation frequencies — 300 Hz for 5 seconds marks the start of a fax broadcast, and 450 Hz for 5 seconds marks the end.

Because of the importance of weatherfax to international shipping and general boating, and because of the wide adoption of digital radios, there have been a number of changes to the protocol over the years, and there are some variations in detail from country to country.

This table shows the stages and timings in the broadcast of a radio fax:


Name Description Time Comment
Tune White level (2300 Hz) to allow receiver tuning 60 seconds This seems to have been abandoned or curtailed in many places because modern digital radios don't require manual tuning.
Start Tone 300 Hz start tone 5 seconds This tone marks the beginning of the fax sequence.
Synchronization 40 lines consisting of 25 milliseconds of white level and 475 milliseconds of black level. 20 seconds This sequence allows the receiver to acquire horizontal synchronization. Some non-U.S. locales use 60 lines/30 seconds.
Image data Each line consists of 25 milliseconds of white level and 475 milliseconds of image data. Two lines per second, with a duration determined by image size. Some charts are rotated 90° to allow a wider format than the default orientation allows. JWX can reorient these charts after reception.
Stop 450 Hz stop tone 5 seconds This marks the end of the fax transmission.
Tail Black level (1500 Hz) 10 seconds This feature is not always present.

JWX State Machine

JWX tracks the incoming fax signal using a state machine that approximately corresponds to the temporal sequence of the fax signal itself. JWX shows the present state of its state machine at the lower center of the display, like this:   Receive | WAITSIG  . Here are the JWX state machine states and explanations:


Name Description Time Comment
WAITSIG Wait for an audio signal Indefinite Initial state when no input signal is present.
WAITSTB Wait for beginning of 300 Hz start tone Indefinite Audio is present, monitoring for start tone.
WAITSTE Wait for end of 300 Hz start tone 5 seconds Start tone is present, wait for end of tone.
WAITLS1 Wait for local line beginning Less than 1/2 second Local synchronization with line rate.
SYNC Horizontal synchronization interval 20 seconds (U.S.) Acquire correction value to horizontally synchronize with transmitter.
WAITLS2 Wait for local line beginning Less than 1/2 second Adjust local line beginning to correspond to correction value acquired during SYNC.
PROC Process image lines, monitor for 450 Hz end tone Duration of image Acquire image scan lines and assemble into graphic image, listen for 450 Hz end tone.
END End of sequence Brief Halt reception, save assembled image to disk, return to WAITSIG state.

Start/Stop Tone Detection


Figure 10: JWX start tone response

A classic weakness in conventional radiofax receivers is reliable detection of the 300 Hz start and 450 Hz stop tones. Often a receiver will fail to detect a start tone and miss a chart, or will fail to detect a stop tone and continue receiving after the chart is complete. Efforts to solve these problems often result in detection of nonexistent start or stop tones.

In conventional electronic receiver designs (i.e. "hardware radios") it is extraordinarily difficult to create a tone detector that is sufficiently selective and stable without adding unacceptable cost and complexity to the design. But in software radios like JWX, such problems are easily solved by adding a few lines of code.

To detect the fax start and stop tones, JWX uses a special kind of DFT (Discrete Fourier Transform) meant to detect just one frequency with very high selectivity. Called the "Goertzel Algorithm", this method is ideal for fax tone detection — it is simple and can be made very selective, meaning it isn't likely to confuse image data or noise, and a legitimate tone.

In tests using on-air signals, and with some adjustment of the tone-detection threshold setting described above, this detection method has more than proved itself, often successfully detecting start and stop tones in the presence of so much radio noise and interference that the received chart was itself barely readable.

Clock Calibration

The value in the JWX clock calibration window corresponds to an absolute clock error in this way:

v = 1 - a/b
Where:

This equation can be used to directly produce a correction number for known clock error rates without requiring the clock calibration procedure.

Version History
Resources

Here are some JWX-related resource locations specific to your system:

Resource
Location
JWX Home Page http://arachnoid.com/JWX
JWX version (version)
User home directory (user home directory)
JWX data directory location (data path)
JWX chart directory location (chart path)
JWX configuration file location (configuration path)
Currently running JWX application location (application path)