FIR Regression
FIR Regression
Clay S. Turner
W
hile developing a error function’s excessive noise sug- for arbitrary sets of xk values and there
communications gested that a statistical method was is no assumption of equal spacing for
receiver, the needed for the receiver to estimate the xk values.
author encoun- the phase offset error. It was in solv- As it is written, (2) doesn’t appear
tered a problem ing this problem that the author amenable for efficient implementation
that was efficiently solved using a developed the slope filtering scheme in a signal processing application. But
method called slope filtering, which is to manipulate classic linear regres- if we look at it from a DSP viewpoint
a novel application of the standard sion equations into a form designed and apply some adroit logic and manip-
equations of linear regression. This for efficient computation. We now ulations, we can make (2) acceptable
article introduces the slope filtering look at how this manipulation is car- for such use. Since programmable DSP
process and its effective use in applica- ried out and then return to the com- chips themselves are designed to effi-
tions such as communications receiver munications receiver example. ciently calculate vector dot products,
carrier recovery, signal rate of change we seek to manipulate (2) into such a
estimation, and signal transition and LINEAR REGRESSION form. This means we need to somehow
transition-polarity detection. The time-domain slope filtering process decouple the yk samples from the xk
was developed by first borrowing the pro- samples, except for a final dot product
MOTIVATION FOR SLOPE FILTERING cedure of linear regression from the field type of formulation.
The slope filtering technique was of statistics [1], [2]. If we have a set of N So starting with (2), we first change
developed while attempting to design a ordered pairs (x0 , y0 ), (x1 , y1 ), . . . , the index counter for yk from k to i
carrier recovery process for a commu- (xN−1 , yN−1 ) and we fit, via a least and then change the product of sums
nications system that used quadrature squares method, a straight line through in (2) to a double summation. These
(I/Q) modulation. The communi- the data then the regression line is changes result in
cations receiver had the typical prob- ŷ = α + β x̂, where
lem that its local oscillator was not
α = N xi yi − xk yi
frequency locked to that of the i i k
received signal’s original transmitter β= 2
yk x2k − xk xk yk
oscillator. Since both oscillators k k k k N x2k − xk
(transmitter and receiver) have nearly 2 k k
constant frequencies over short time N x2k − xk (3)
intervals, when the instantaneous k k
phase of the received signal was com- (1) where index i, just like k, counts from
zero to N − 1. Next we factor out the yk
Digital Object Identifier 10.1109/MSP.2008.929816 and samples giving us
Authorized licensed use limited to: IEEE Xplore. Downloaded on December 31, 2008 at 12:44 from IEEE Xplore. Restrictions apply.
[dsp TIPS&TRICKS] continued
⎛ ⎞
where its slope represents the frequency giving us the β i coefficients for use in a
⎜ N · xi − xk ⎟ offset and the intercept represents the N-stage tapped-delay line finite-impulse
⎜⎜ k
⎟
⎟
β= ⎜ y. phase offset between the transmitter’s response (FIR) structure to compute our
⎜ 2 ⎟
⎟ i
i ⎝ ⎠ and receiver’s oscillators. desired rate of change β in (5).
N x2k − xk By applying (5) to the error function, If the delay line structure used to
k k
the approximate rate of change of phase implement (5) is designed for filter con-
(4)
is found. And of course the rate of phase volutions instead of correlations, then
change is equal to the frequency; thus we the β i coefficients need to be reversed in
Based on (4), we have our desired expres- can estimate the frequency offset of the order. Since the β i coefficients have neg-
sion receiver. The regression calculation may ative symmetry, a simple negation will be
be used to find the frequency offset by sufficient as shown in Figure 1.
β= β i yi (5) applying it to the phase error function. The units for β in (5) are the units
i Unwrapping the error function’s phase of y per sample interval. So, for exam-
where β i is defined as may be needed to preserve the linearity ple, if y is in volts and we are sampling
of the error function but, since its under- at a 1 kHz rate, then the units of β are
lying structure is linear, unwrapping is volts per millisecond.
N · xi − xk quite easy. If (1) is also manipulated into
k
βi = 2 . (6) a dot product formulation, and it is PROPERTIES OF RATE CHANGE
applied to the error function, the initial OF CHANGE ESTIMATION
N x2k − xk
k k (at the start of the data segment under Equation (8) is remarkable for sever-
analysis) phase error is found. A digital al reasons.
We have converted (2) into the vector quadrature oscillator [3], initialized with ■ It represents the coefficients of an
dot product in (5) where the xk and yk the negatives of the frequency and phase odd symmetric linear-phase FIR filter,
samples are decoupled from each other. offsets, can be used to correct the which means the delay is a constant
Fortunately if all of the xi in (6) are received signal’s frequency and phase of (N − 1)/2 samples. In addition,
known a priori, then the β i coefficients errors by simple modulation. half of the multiplications in (5) may
may be precomputed and stored in mem- be eliminated by using a “folded FIR”
ory. So, if we have a block of data (N sam- APPLICATION: SIGNAL RATE filter structure.
ples), we just use our prestored length-N OF CHANGE ESTIMATION ■ Its result is origin independent!
β i coefficients in a tapped-delay line filter The β i coefficients don’t change as we
structure implementing (5) to find the REAL-TIME RATE OF traverse the data as evidenced by the
slope (rate of change) of the data. This is CHANGE ESTIMATION fact the starting value x0 is not a part
the process we call slope filtering. For applications where continual signal of (8). So in terms of implementing
rate of change estimations are needed, as (5) via a filter, this means the coeffi-
APPLICATION: RECEIVER opposed to the single dot product calcu- cients are time-invariant.
CARRIER RECOVERY lation of (5), when the xi samples are ■ The β i coefficients define a linear
Now that we see how to transform the equally spaced and ordered from low to ramp. This means we are in effect
regression formula into a useful (for high we can write xk = x0 + k where correlating our signal with a ramp to
signal processing tasks) form, we return k = 0, 1, 2, . . . , N − 1 . Hence we are find the slope. This may be viewed as
to its application to the communications looking at a set of N consecutive equi- optimal in the sense of matched fil-
receiver problem. Because the receiver spaced xk samples. Substituting our tering allowing the user to easily
uses an independent frequency reference expression for xk into (6) results in pick an optimal N. That is, if our
for heterodyning, the baseband signal transitions are expected to span M
will have a residual frequency and phase N(x0 + i) − (x0 + k) samples, then we make the β i coeffi-
k
offset when compared to the ideal. We βi = 2 cients M samples in length. And this
need to estimate these errors to be able brings us to the important observa-
N (x0 + k)2 − (x0 + k)
to correct them. k k tion that transitions usually don’t
To find the error function both the exist in isolation, they are preceded
received and ideal signals are represented (7) and followed by generally level sig-
in complex polar form and then the dif- nals. This means that the span of the
ferences in the arguments of their corre- which after significant algebraic simplifi- β i coefficients may be longer than
sponding samples become the samples of cation becomes just the transition width. In fact this
the error function. For relatively short super spanning can increase the
time duration signals, the error function 12 · i − 6(N − 1) SNR of our slope filter’s output! Of
βi = (8)
is well approximated as a linear function N(N 2 − 1) course there are practical limits to
Authorized licensed use limited to: IEEE Xplore. Downloaded on December 31, 2008 at 12:44 from IEEE Xplore. Restrictions apply.
[dsp TIPS&TRICKS] continued
the amount of super spanning, but acceptable. In the case of pulse may be set to the number of samples
having a span 20% or 50% greater detection with matched filtering in comprising the pulse. But if super-
than the transition width is certainly mind, the number of β i coefficients spanning is appropriate, a greater
number of coefficients may yield the
highest SNR.
APPLICATION: SIGNAL
Xn TRANSITION DETECTION
Z −1 Z −1 Z −1
Another useful application of time-
domain slope filtering is signal transi-
tion detection. Figure 2 illustrates this
− β0 − β1 − β2 − β N−1 idea where a series of noisy input sig-
nals with transitions are the red
traces, and the outputs of the slope fil-
ter (delay compensated on the graphs)
Σ are shown as the black traces. In that
figure, the length of the input signal’s
yn
transition is 80 samples. Examples of
super-spanning are shown in Figure
[FIG1] Real-time slope filtering structure. 2(b) and (c).
Why does time-domain slope filter-
ing work so well when compared to
ideal differentiators? By inspecting the
coefficients for each of these cases, we
1
find that the regression method places
N = 21 the strongest weights at the ends of the
data span and conventional differentia-
0 tors weigh heaviest near the middle.
Thus from a “torque” calculation point
−1 of view, conventional differentiators
0 500 1,000 rely strongly on fewer terms (all near
Time Samples
the middle) and therefore the result is
(a) more susceptible to noise. One can also
1
note that the difference is that in time
domain slope filtering a first-order
N = 101 polynomial is fitted to the data, where-
as with a traditional differentiator a
0
low-order trigonometric polynomial is
fitted to the data.
−1 Even if a differentiator is designed
0 500 1,000
Time Samples with the Parks-McClellan (PM) algo-
rithm to closely match the perform-
(b)
ance shown in Figure 2(a), it will
1 generally not fair well when the noise
N = 101 levels are increased. That is because a
trigonometric polynomial fit admits
0 polynomial terms higher than first
order. To see this, recall that the PM
algorithm fits a weighted sum of
−1 sinusoids to the differentiator’s
0 500 1,000
Time Samples desired frequency response. And,
(c) when transformed back to the time
domain, its impulse response will
contain polynomial terms higher than
[FIG2] Time-domain slope filtering examples: (a) span N = 21, (b) N = 101, and
(c) N = 101 with a very noisy input signal. the first power.
Authorized licensed use limited to: IEEE Xplore. Downloaded on December 31, 2008 at 12:44 from IEEE Xplore. Restrictions apply.
APPLICATION: SIGNAL TRANSITION- PolarityN =7 = regression analysis into a form that is
POLARITY DETECTION sgn[−3y0 − 2y1 − y2 + y4 + 2y5 + 3y6 ]. highly compatible with the methods of
Our noise-tolerant time-domain slope digital signal processing and, from
(12)
filtering scheme also comes in handy in them, derived a computationally effi-
applications where one just wishes to cient slope-filtering differentiator, as
know if a signal is increasing or decreas- And for even N, we can rescale (10) by defined in (5) and (6), that is superior
ing, for example when detecting the doubling all its coefficients so they are in its noise tolerance relative to PM
polarity of signal transitions. In this integers. For even N, this formulation designed differentiators. We extended
case, we can multiply (8) by any positive results in the algorithm with a focus on both
number, since we only need the sign transition detection and transition-
(positive or negative) of (5). For a start, Polarityeven N polarity detection in (11) and (13).
just remove (multiply it out) the denom-
N −1
inator of (8). This results in = sgn (2i − (N − 1)) · yi . AUTHOR
i =0 Clay S. Turner (Clay.Turner@ PaceOMatic.
β̂ i = 12i − 6(N − 1) (9) (13) Com) is senior technical director for Pace-
O-Matic, Inc. He has over 30 years experi-
and also divide by 12 to yield For example when N = 6 we have ence in digital signal processing,
mathematical and embedded program-
1
β̃ i = i − (N − 1). (10) PolarityN =6 = ming. When not busy, he likes to photo-
2
sgn[−5y0 − 3y1 − y2 + y3 + 3y4 + 5y5 ]. graph, scuba, backpack, cycle, and go
Now (5) becomes (for polarity detection horseback riding with his wife.
(14)
only)
for ensuring the high quality of the arti- sable assets for any editor running a active volunteers in the Society. I have
cles published in SPM. We are indebted to dynamic publication like SPM. no doubt that, with their collective vision
Professor Ray Liu, in his role of VP- With this issue, the magazine will be and leadership, SPM will continue its
Publications, and Mercy Kowalczyk, SPS transitioning to a new team of capable successful momentum and move to an
executive director and SPM associate edi- hands. Li Deng, current area editor for even higher stature. I now look forward
tor, for their valuable advice. Eric Zavesky feature articles, will be at the helm serv- to joining all of you, the readers, in not
of Columbia University has provided criti- ing as the new editor-in-chief. He will be only enjoying the articles but also more
cal assistance in maintaining the Web joined by Min Wu (incumbent area editor importantly writing articles and provid-
sites and review database. Finally, the for newsletter) and new blood, Antonio ing feedback for SPM. [SP]
senior managing editor of SPM, Geri Ortega, leading the feature articles sec-
Krolin-Taylor of IEEE, together with her tion, Dan Shonfeld leading the special
editing staff, once again demonstrated issues section, and Ghassan AlRegib lead-
the highest level of professionalism, cre- ing the columns/forum section. These
ativity, and work ethic. They are indispen- individuals are respected pioneers and
Authorized licensed use limited to: IEEE Xplore. Downloaded on December 31, 2008 at 12:44 from IEEE Xplore. Restrictions apply.