V.34 Fax Training in a High Noise Environment

Suppose for the moment that you've been given the task of constructing a V.34 fax demodulator from various pre-built demodulation routines you happen to have laying around. Further suppose that instead of a clean signal, you're expected to deal with a rather nasty/noisy signal, and that you don't get to pick the 'easy' settings (such as four point train) that might make it simpler to produce. Where do you start?

(If it were me, I would simply buy one from the guys over at VoCAL. Fax demodulation is hard, and it'll take a long time to do better than they do.)

This is more difficult than it sounds, because the half duplex mode used by V.34 fax has very fast setup times. V.34 is also a very complex, very advanced modulation scheme. Fortunately, the part discussed below is one of the simpler aspects.

There are usually four adaptive components you will need to deal with:

Since the phase loop adjusts the equalizer output which is used to update the equalizer, these two active components are dependent on each other. They are also configured in a feedback configuration, and need to be carefully managed to prevent instability.

The AGC and baud timing should be brought up first, as they have no dependencies and can often be jammed to reasonable values very early in the startup sequence.

And now, a rough guide through the various phases. Some of these may or may not work well for you depending on your situation.

1) - Detect the S sequences at the start of the training period. Use these to preset your agc and baud timing recovery as best you can. Start running baud timing recovery and agc. Note that if it's not possible to get good enough timing recovery or agc convergence at this point, you may need to delay the start of the next step below until a few symbols of PP have passed.

2) - At the start of PP, preset your equalizer and start feeding data into it. PP is a periodic signal with 48 symbols, 12 points arranged in a circle. Your equalizer should be preset, probably with a single real tap, such that the output (combined with your previously jammed agc) is statistically near the amplitude of perfect PP points.

3) - After your equalizer is full, start the equalizer and collect its output in a buffer. Make sure you don't start the equalizer until after the entire delay buffer is full of valid PP symbols. At this time you should also jam the equalizer phase loop to zero.

4) - Collect the output of the equalizer for 48 symbols. This is a full set of the periodic PP signal. After you have all 48 symbols, cross correlate the equalizer output with the reference PP signal to get both exact timing and the equalizer phase loop offset. Jam the phase loop and equalizer update with this information.

5) - Start up the equalizer update, training on PP. You have six full frames of PP to train on; the first one you used to fill up your equalizer. The second one you used to derive fairly exact timing for the phase loop and your training data. The remainder of PP will be used to train the equalizer and optionally the phase loop. Note that your phase loop should still be jammed at this point.

A note on equalizer training: the noisier your signal, the slower you need to train. You should be training as fast as you can without going unstable, but keep in mind that as the noise floor rises it becomes much easier for the equalizer to diverge and much harder to get a good train.

An additional note is that it may be worthwhile to only train the center quarter of your equalizer during PP. Typically, most of the large equalizer taps lie near the center, within a small range. V.34 requires a large equalizer (40+ taps) for the densely packed high-rate constellations, but for quick brute force training (on a 12 point circle no less) you may be able to get substantially faster convergence using only a quarter of your taps.

It may also be possible to improve the initial equalizer convergence by using a more computationally expensive training approach, such as an RLS or affine algorithm. A second order affine update is often trivial to implement and can decrease convergence time if used carefully. Typically these approaches are not required, as careful design can give acceptable convergence with a simple LMS style algorithm.

6) - The remainder of PP should be used for equalizer training. Because we're expecting a very noisy signal, it's important that the phase loop pll be disabled at this point. It's hard enough for the equalizer to train already; adding the extra variation of an unlocked phase loop into the system will make things substantially worse.

7) - After PP comes the four or 16 point square constellations. If you've been using a partial equalizer update, you should probably begin using a full update around this point.

The four point constellation is about as close to trivial to train as can be had; the remainder of this discussion will be regarding training on 16 point constellations, which is substantially more difficult in a high noise environment. By the time you are finished with PP, you should have enough of a train that you can at least make out a rough square (or perhaps even the individual points) in the 16 point constellation.

Note - one of the problems with the 16 point constellation is that the points are so much closer together that the threshold for oscillation between an active phase loop and the equalizer update is much lower than for a four point constellation.

It should be safe to start/unjam the phase loop at this point, but only if the update is set to be -very- slow. You want to use this time to try to acquire the second order drift term, but if the pll moves around too quickly it can very easily damage the delicate state of the equalizer. Keep in mind that the equalizer will be doing its best to compensate for phase loop drift by retraining its coefficients.

An issue that can arise with both the phase loop and equalizer updates being enabled is a type of 'local minimum' situation. For a 16 point constellation with zero phase drift, there is naturally a global minimum on a proper train. There is also a local minimum consisting of a high rotation rate combined with a circular pattern that has a high density in the center that decreases outward. The high density area in the center is created by the inner four points of the 16 point constellation. The 4 point constellation does not have this local minimum, as there are no center points. Technically, the 4 point constellation is very similar to the PP signal, as all points lie on a circle.

One way to eliminate this local minimum is simply to ignore training attempts on the center four points. The training rate is reduced by a corresponding amount (around 25%), but this may be tolerable if the noise and phase loop drift are sufficiently high. Other more extreme measures might be to only train on half of the constellation, for example the upper and lower two lines of four points each.

Once you have fairly good convergence on the constellation, it's safe to bring up the gain on the phase loop to guarantee that it has locked properly.

Typically the equalizer training constant and the phase loop gain decreases from this point forward, to whatever value is typical of steady state. For low noise environments, you want the equalizer training constant to be relatively high so as to maximize convergence with what little error you may have. For high noise environments, you need to have a relatively small training constant to allow the noise to be statistically smoothed out of the equalizer coefficients. Unfortunately, the smaller training constant means a longer convergence time, on top of the already long convergence time due to the large amount of noise present.

The above only addresses the initial training phase, which is relatively long compared to the resynchronization training which occurs during data phase. In a lot of ways, resynchronization is easier, as the active components are known to be well trained and only need to acquire the proper timing and initial values.

Something to keep in mind during resynchronization is that every single symbol matters. If you want a good resync that's reliable, you have to get every symbol as close as you can, especially on transitions between various phases of the startup signals. You have 12 symbols of S-bar, 288 symbols of PP, and 120 symbols of B1 to work with, then you're in data mode. That's very little time for a modulation that may be pushing to within 3 db of Shannon. This kind of exacting, every-symbol-matters detail is less important on the initial train sequence, which can be several seconds long.

To write Dentin a letter, send mail to: soda@xirr.com
Looking for my resume?
Alter Aeon main page
Connect to Alter Aeon