Content uploaded by Kees Schouhamer Immink

Author content

All content in this area was uploaded by Kees Schouhamer Immink on Apr 11, 2019

Content may be subject to copyright.

1

Minimum Pearson Distance Detection for

Multi-Level Channels with Gain and/or Offset

Mismatch

Kees A. Schouhamer Immink, Fellow, IEEE, and Jos H. Weber, Senior Member, IEEE

Abstract -The performance of certain transmission

and storage channels, such as optical data storage and

Non-Volatile Memory (Flash), is seriously hampered by the

phenomena of unknown offset (drift) or gain. We will show

that Minimum Pearson Distance (MPD) detection, unlike

conventional Minimum Euclidean Distance detection, is

immune to offset and/or gain mismatch. MPD detection

is used in conjunction with T-constrained codes that

consist of q-ary codewords, where in each codeword T

reference symbols appear at least once. We will analyze

the redundancy of the new q-ary coding technique, and

compute the error performance of MPD detection in the

presence of additive noise. Implementation issues of MPD

detection will be discussed, and results of simulations will

be given.

Key words: Constant composition code, permutation

code, rank modulation, ﬂash memory, digital optical data

storage, recording, Non-Volatile Memory, NVM, mismatch,

adaptive equalisation, fading, Pearson distance, Euclidean

distance, fading.

I. INTRODUCTION

We consider a communication codebook, S, of chosen q-

ary codewords x= (x1, x2, . . . , xn)over the q-ary alphabet

Q={0,1, . . . , q −1},q≥2, where n, the length of x,

is a positive integer. Usually it is assumed that the primary

impairment of a sent codeword xis additive Gaussian noise,

but here, however, it is assumed that the received word r=

a(x+ν)+b,ri∈R, is scaled by an unknown factor, called

gain,a̸= 1,a > 0, offsetted by an unknown (dc-)offset

b̸= 0 (both quantities unknown to both sender and receiver),

where aand b∈R, and corrupted by additive noise ν=

(ν1, . . . , νn),νi∈R. We use the shorthand notation x+

b=(x1+b, x2+b, . . . , xn+b). The unknown channel

gain and offset mismatch may lead to a devastating loss in

performance, as shown, for example, in [1].

There are many examples of channels with offset and

gain mismatch. In optical data storage, both the gain and

Kees A. Schouhamer Immink is with Turing Machines Inc, Willemskade

15b-d, 3016 DK Rotterdam, The Netherlands. E-mail: immink@turing-

machines.com.

Jos Weber is with Delft University of Technology, Delft, The Nether-

lands. E-mail: j.h.weber@tudelft.nl.

offset depend on the reﬂective index of the disc surface and

the dimensions of the written features [2]. Fingerprints on

optical discs may result in rapid gain and offset variations

of the retrieved signal. In baseband transmission channels,

offset may arise as baseline wander, which is caused by

the attenuation of the low frequencies of the channel (a.c.

coupling) [3]. In wireless communication channels, path loss

will result in unknown gain, fading, of the channel. Reading

errors in solid-state (Flash) memories may originate from

cell drift in aging devices [4].

In optical disc data storage devices and non-volatile

memories, constrained codes, speciﬁcally dc-free or bal-

anced codes, have been used and/or proposed to counter

the effects of offset and gain mismatch [1]. Jiang et al. [4]

addressed a q-ary balanced coding technique, called rank

modulation, for circumventing the difﬁculties with ﬂash

memories having aging offset levels. Zhou et al. [5], Sala et

al. [6], and Immink [7] investigated the usage of balanced

codes for enabling ‘dynamic’ reading thresholds in non-

volatile memories.

Codewords taken from a q-ary balanced code can be

retrieved by a minimum Euclidean distance detector, where

the detection process of q-ary balanced codewords is in-

trinsically resistant to any offset and/or gain mismatch.

Unfortunately, the redundancy price of q-ary balanced codes

is unattractively high for small values of n[8].

We propose the Pearson distance as an alternative to the

Euclidean distance, since it is, as will be shown, intrinsically

resistant to offset and gain mismatch. It will be shown

that the Pearson distance measure can only be applied to

codebooks with special properties, and constrained coding

is therefore required. To that end, we propose q-ary T-

constrained codes, where T,0< T ≤q,preferred

or reference symbols must appear at least once in every

codeword [7]. The redundancy of T-constrained codes is

much lower than that of prior art q-ary balanced codes,

which makes Minimum Pearson Distance detection in con-

junction with T-constrained codes an attractive alternative

for practical applications.

We start in Section II with a discussion of the prior

art Minimum Euclidean Distance (MED) detection of q-

ary balanced codewords. In Section III, we will describe

Minimum Pearson Distance (MPD) detection in conjunction

with T-constrained codewords, and we will show that the

detection performance is independent of gain and offset.

2

Conventional minimum Euclidean distance detection offers

optimum (maximum likelihood) error performance for the

‘ideal’ noisy channel, so Minimum Pearson Distance detec-

tion in the presence of additive noise will, by necessity, show

a somewhat lessened noise immunity. In Section IV, we

will analyze the error performance of MPD detection in the

presence of additive Gaussian noise. Implementation issues

of MPD detection are discussed in Section V. In Section VI,

we will describe our conclusions.

II. PR IO R ART

Before we take a look at the characteristics of the

proposed technology, we will discuss prior-art detection

schemes that are based on the classical Euclidean distance

metric. The codeword x∈Sis sent and received as

r=x+ν, where νis additive Gaussian noise ν=

(ν1, . . . , νn). For each codeword ˆ

xin the codebook Sthe

receiver computes the (squared) Euclidean distance

δ′(r,ˆ

x) =

n

i=1

(ri−ˆxi)2(1)

between the received signal vector rand the codeword

ˆ

x. After exhaustively computing all distances, the receiver

decides that the codeword, xo, with minimum Euclidean

distance to the received vector, r, is the codeword sent, or

in succinct form

xo= arg min

ˆ

x∈S

δ′(r,ˆ

x).(2)

For a mismatch channel, we simply ﬁnd

δ′(r,ˆ

x) =

n

i=1

(ri−ˆxi)2=

n

i=1

(ax′

i+b−ˆxi)2

or

δ′(r,ˆ

x) = −2ax′

iˆxi

+(ax′

i+b)2−2bˆxi+ˆx2

i,(3)

where x′=x+ν. Mismatch may lead to a warping of

the Euclidean distance measure, which will lead to a loss in

noise margin or even to a complete loss of the codeword.

Figure 1 shows results of computations and simulations of

the word error rate (WER) of a communication system us-

ing minimum Euclidean distance detection with parameters

q= 4 and n= 8 a) without mismatch, and b) with a

gain, a= 1.07, and offset, b= 0.07, mismatch. We may

notice that the error performance is seriously affected by the

mismatch. The third curve shows the error performance of

a new detection scheme proposed in Section III that offers

intrinsic resistance to gain and/or offset mismatch at the cost

of a reduced noise margin.

In the prior art, coding techniques and alternative de-

tection methods have been sought to offer solace to the

aforementioned loss of performance caused by channel

mismatch. For example, it has been known in the art [8] that

15 15.5 16 16.5 17 17.5 18 18.5 19

10−5

10−4

10−3

10−2

10−1

100

WER

SNR (dB)

no mismatch

new detector

a=1.07, b=0.07

Fig. 1. Word error rate (WER) for q= 4,n= 8 a) without channel

mismatch, b) with channel mismatch a= 1.07 and b= 0.07, both

using minimum Euclidean distance detection, and as a comparison

c) for a new detection scheme that is immune to channel mismatch

using minimum Pearson distance detection (see Section III).

balanced codes in conjunction with minimum Euclidean dis-

tance detection offer intrinsic resistance to gain and/or offset

mismatch. By deﬁnition, all codewords xin a balanced code

have the property that the symbol sum

n

i=1

xi=a1

and symbol energy

n

i=1

x2

i=a2,

are prescribed, where a1and a2are two positive integers

selected by the code designer. Then, we simply ﬁnd

δ′(r,ˆ

x) = −2ax′

iˆxi+(ax′

i+b)2−2ba1+a2.(4)

The metric consists of one (ﬁrst) term, −2ax′

iˆxi, depen-

dent of ˆ

xand three terms independent of ˆ

x. Clearly, it does

not matter for the outcome of the detection process (2) or

detection performance if we scale (by a positive constant) or

translate the metric function with a constant independent of

the variable ˆ

x. A scaled or translated version of the metric

is equivalent to the original version of the metric. Metric

equivalence will be denoted by the ≡sign. From (4), it

is clear that in case all codewords satisfy the symbol sum

and energy constraints that (1) can be rewritten as (note we

presumed a > 0)

δ′(r,ˆ

x)≡ −

n

i=1

x′

iˆxi.(5)

Thus Euclidean distance detection of balanced codes is

intrinsically resistant to channel mismatch as (5) is inde-

pendent of the actual channel gain and offset. The sole

disadvantage of the method, which makes it unattractive for

practice, is the high redundancy of balanced codes [8].

3

In the next section, we will introduce the Minimum

Pearson Distance detector, and we will show that it is an

attractive alternative to the Euclidean distance for the signal

detection in the presence of both channel mismatch and

additive noise as it also offers intrinsic resistance to channel

mismatch.

III. MINIMUM PEA RS ON DI STAN CE D ET EC TI ON O F

T-CO NS TR AI NE D CO DE S

We will show that the Minimum Pearson Distance detec-

tor can only operate unambiguously in case the codebook,

S, used satisﬁes speciﬁc constraints, and thus constrained

codes are required. To that end, we will introduce a

class of codes, called T-constrained codes, that satisfy

the requirements of unambiguous detection using the new

Pearson-distance-based detector [7]. First we will start with

a presentation of the Minimum Pearson Distance detection

method. Thereafter, we will discuss the various requirements

to be imposed on the constrained code.

A. Minimum Pearson distance detection

It is assumed that an arbitrary codeword x∈Sis sent,

and that the received word, r, is given by r=a(x+ν)+b.

The Pearson distance, δ2(r,ˆ

x), between rand ˆ

xis deﬁned

by

δ2(r,ˆ

x) = 1 −ρr,ˆ

x,(6)

where

ρr,ˆ

x=n

i=1(ri−r)(ˆxi−ˆx)

σrσˆx

(7)

is the well-known (Pearson) correlation coefﬁcient, and

where we deﬁne two quantities, namely the average symbol

value of ˆ

x

ˆx=1

n

n

i=1

ˆxi,(8)

and the (unnormalized) symbol value variance of ˆ

x

σ2

ˆx=

n

i=1

(ˆxi−ˆx)2,(9)

where it is assumed that both codewords xand ˆ

xare taken

from a judiciously chosen codebook S, whose properties

will be explained in the next subsection. The variance, σ2

r,

and average, r, of the received vector are deﬁned in the same

way. The term 1−ρr,ˆ

xis often named the Pearson distance

between the vectors rand ˆ

x. As the Pearson correlation

coefﬁcient falls in the interval [-1, 1], the Pearson distance

lies in the interval [0, 2].

The detector operates in the same vein as the conventional

Euclidean distance detector: the detector computes for all

codewords ˆ

x∈Sthe Pearson distance between rand ˆ

x.

The receiver decides that the codeword, xo, with minimum

Pearson distance to the received vector, r, is the codeword

sent, or in succinct form

xo= arg min

ˆ

x∈S

δ2(r,ˆ

x).(10)

0 5 10 15 20 25

0

5

10

15

20

25

Euclidean distance

Pearson distance

Fig. 2. Scatter diagram of Euclidean distance, δ′(x,ˆ

x), (1) versus

Pearson distance, δ2(x,ˆ

x), (13) for n= 6 and q= 3.

A key property of the Pearson distance, 1−ρr,ˆ

x, is that it

is invariant to changes in translation or scale (up to a sign)

in the two vectors rand ˆ

x. That is,

ρr,ˆ

x=ρc1+c2r,ˆ

x,(11)

where c1and c2>0are constants. Clearly, the above

property ensures that the detection outcome based on the

Pearson distance (10) is intrinsically resistant to offset and

gain mismatch.

After some manipulation of (6), we may write down two

equivalents of the Pearson distance measure, namely

δ2(r,ˆ

x)≡ − 1

σˆx

n

i=1

ri(ˆxi−ˆx)(12)

and

δ2(r,ˆ

x)≡

n

i=1 ri−ˆxi−ˆx

σˆx2

.(13)

The equivalence of (12) with (6) is straightforward. Eq. (13)

can be rewritten as

n

i=1

r2

i−2

σˆx

n

i=1

ri(ˆxi−ˆx) +

n

i=1 ˆxi−ˆx

σˆx2

.

Using (9) and after deleting the ﬁrst and third term, we

arrive at the equivalence of (12) with (13), and thus of the

equivalence of (13) with (6). Eq. (13) shows an interesting

relationship with respect to the conventional Euclidean

distance (1), where the vector ˆ

xis translated by ˆxand scaled

by σˆx.

In Figure 2, we have plotted an illustrative scatter diagram

of the Euclidean distance δ′(x,ˆ

x), (1), versus the Pearson

distance δ2(x,ˆ

x), (13), for n= 6 and q= 3 for almost (see

later) all possible vectors xand ˆ

x. We notice quite some

difference between the alternative distance measures. The

Pearson distance measure is highly attractive for mismatch

channels, but we must clear a few hurdles before we

can fruitfully apply it in practice. It is immediate, see

4

(7), that the Pearson distance is undeﬁned for codewords

xwith σx= 0. In addition, as mentioned above, we

have ρr,ˆ

x=ρc1+c2r,ˆ

x, so that a Pearson-distance-based

detector cannot distinguish between the sent codewords x

and c1+c2x. We remedy this ﬂaw by using constrained

codes: in case x∈S, all words c1+c2x, where c1is any

real number and c2is any positive real number, are excluded

from S. In addition, the qwords x= (a, . . . , a),a∈ Q,

with σx= 0 must be barred from S.T-constrained codes,

to be discussed below, satisfy all these requirements.

B. Description of T-constrained codes

T-constrained codes, presented in [7] for enabling simple

dynamic threshold detection of q-ary codewords, consist

of q-ary n-length codewords, where T,0< T ≤q,

preferred or reference symbols must appear at least once in

a codeword. A set of T-constrained codewords is denoted

by ST. Of speciﬁc interest in this paper are two sets of T-

constrained codes denoted by S1and S2. The set S1has

codewords where the symbol ‘0’ appears at least once, and

the set S2contains codewords where both the symbols ‘0’

and ‘q−1’ appear at least once. The size of |S1|and |S2|,

respectively, equal [7]

|S1|=qn−(q−1)n, q > 1.(14)

and

|S2|=qn−2(q−1)n+ (q−2)n, q > 1.(15)

For the binary case, q= 2, we simply ﬁnd that

|S1|= 2n−1

(the all-‘1’ word is deleted), and

|S2|= 2n−2

(both the all-‘1’ and all-‘0’ words are deleted).

Very efﬁcient implementations of high-rate T-constrained

codes can be constructed with the nibble replacement

method described in [9]. The code is based on an algorithm

that recursively removes w > 0disallowed n-symbol q-ary

words in a string of L n-symbol codewords while only one

q-ary redundant symbol is added. The code rate of the nibble

replacement equals 1−1/(nL), where

L≤(q−1)qn−1

w.(16)

A conventional n-symbol block code can be constructed

with a rate 1−1/n, while the nibble replacement code

makes it possible to construct a code with rate 1−1/(nL).

For example, for a binary T= 1 code, n= 10,w= 1,

the code rate is (at most) 5119/5120, while for a T= 2

code with the same parameters, w= 2, the code rate is (at

most) 2559/2560. The rate of a conventional code would

be 9/10, that is almost 10% more redundant.

The T-constraints imposed imply the following properties

of the codewords.

Property A: If x∈S1then x+c /∈S1for all non-zero

c∈R.

Proof: By deﬁnition, xhas at least one position, say k,

where xk= 0. Hence if c < 0, then xk+c < 0, and thus

x+c /∈S1. If c > 0, then xi+c > 0for all i, and thus

x+c /∈S1since x+cdoes not contain the symbol ‘0’.

Property B: If x∈S2then c1+c2x/∈S2for all c1, c2∈R

with (c1, c2)̸= (0,1) and c2>0.

Proof: Suppose c1+c2x∈S2. Since c2>0and xi≥0

for all i, it follows that c1≤0in order to have at least one

‘0’ in c1+c2x. Since c1<0would result in at least one

negative value in c1+c2x(in a position where xhas a ‘0’),

it follows that c1= 0 and thus c2̸= 1. If 0< c2<1, then

all symbols in c1+c2x=c2xare smaller then q−1, while

if c2>1, then at least one value in c1+c2xis larger than

q−1(in a position where xhas a ‘q−1’). In conclusion,

c1+c2x̸∈ S2.

Property C: x=c /∈S2for all c∈R.

Proof: All codewords x∈S2have at least one symbol equal

to 0 and at least one symbol equal to q−1. Since q > 1,

we conclude that x=c /∈S2.

The above properties of the codebook S2are sufﬁcient to

solve the ﬂaws of the Pearson distance measure discussed

in the previous section. Firstly, property C guarantees that

(6) cannot be singular since σx̸= 0,x∈S2. Secondly,

according to Property B we have for xand ˆ

x∈S2,

ˆ

x̸=c1+c2x. Then in the noiseless case, ν= 0, the

detector operates without errors since for any sent x, the

detector metric (6) is at a global minimum for ˆ

x=x

since according to a well-known property of the Pearson

correlation coefﬁcient ρx,ˆ

x= 1 only for ˆ

x=c1+c2xso

that δ2(x,x) = 0 and δ2(x,ˆ

x)>0,ˆ

x̸=x.

C. Offset-mismatch channels

Evidently, Minimum Pearson Distance detection pre-

sented above can be used for channels with offset mismatch

only (a= 1). However, by a slight modiﬁcation of the

Pearson distance measure we may reduce the redundancy

of the constrained code, and improve the resistance against

additive noise. We propose the distance measure

δ1(r,ˆ

x) =

n

i=1

(ri−ˆxi+ ˆx)2,(17)

where, as we may notice, we have deleted σˆx, in (13).

The advantage of the modiﬁed distance measure for offset-

mismatch channels is that codewords can be drawn from S1

instead of S2, which reduces the code redundancy.

We ﬁrst show that δ1(r,ˆ

x)is, as claimed, independent

of the channel’s offset b, and thereafter we show that in

the noiseless case ν= 0,δ1(x,ˆ

x)has a unique minimum

at ˆ

x=x∈S1. Subsequently, we will show that for

application of (17) it is sufﬁcient to draw codewords from

S1.

5

We ﬁnd

δ1(r,ˆ

x) =

n

i=1

(x′

i+b−ˆxi+ ˆx)2

=

n

i=1

(x′

i−ˆxi+ ˆx)2+ 2b

n

i=1

(x′

i−ˆxi+ ˆx) + b2,

where x′

i=xi+νi. By deﬁnition (8), we have

n

i=1

(x′

i−ˆxi+ ˆx) =

n

i=1

x′

i,

so that

δ1(r,ˆ

x)≡

n

i=1

(x′

i−ˆxi+ ˆx)2.(18)

From the above it is immediate that the minimization of

δ1(r,ˆ

x)is intrinsically resistant to the channel offset b.

In the noiseless case, ν= 0, the detector must operate

error-free, so that for any xthe detector metric δ1(x,ˆ

x)

must have a unique minimum at ˆ

x=x, that is, δ1(x,x)<

δ1(x,ˆ

x)for x̸=ˆ

x, and x,ˆ

x∈S1. From (17), we conclude

that δ1(x,ˆ

x) = δ1(x,x)is true if for all i

xi= ˆxi−ˆx= ˆxi+c, (19)

where cis any real number. However, Property A guarantees

that the above is false for codewords in S1, and thus

δ1(x,x)< δ1(x,ˆ

x),x̸=ˆ

x. Properties B and C are not

required, so that it is sufﬁcient that we draw the codewords

from S1, which, clearly, has a positive bearing on the

redundancy of the system.

In the next section, we will compute the error perfor-

mance of the MPD detection method in the presence of

additive noise.

IV. PER FO RM AN CE ANALYS IS

We will now focus on the detection of codewords con-

veyed over channels with gain and/or offset mismatch,

where we assume that a randomly chosen codeword x∈ST

is sent and received as r=x+ν, where ν=(ν1, . . . , νn),

and νiare noise samples with distribution N(0, σ2). Note

that we dropped the scalars aand bsince, as established

above, the MPD detector performance is independent of

those parameters.

We will start by computing the detection error perfor-

mance for the simplest, ‘offset only’, case, T= 1, using

(17) and codewords taken from codebook S1.

A. T= 1, offset mismatch

We assume x∈S1is sent, and that the receiver applies

(17) to compute the distance between the received vector

r=x+νfor all codewords in S1. The receiver decides

that the codeword xowas sent if (17) attains its least value

for ˆ

x=xo, that is

xo= arg min

ˆ

x∈S1

δ1(r,ˆ

x) = arg min

ˆ

x∈S1

n

i=1

(ri−ˆxi+ ˆx)2.(20)

We have ri=xi+νi, so that

δ1(r,ˆ

x) =

n

i=1

(xi+νi−ˆxi+ ˆx)2.

The analysis is simpliﬁed by noticing that

δ1(r,ˆ

x)≡

n

i=1

(xi+νi−ˆxi+ ˆx−x)2.

Deﬁne e=x−ˆ

xand e=x−ˆx, then we obtain the much

simpler expression

δ1(r,ˆ

x)≡

n

i=1

(ei−e+νi)2.

The detector errs, i.e. xo̸=x, if there is at least one

codeword ˆ

x∈S1,ˆ

x̸=x, such that

δ1(r,ˆ

x)< δ1(r,x),

or n

i=1

(ei−e+νi)2<

n

i=1

ν2

i(21)

or

2

n

i=1

νi(ei−e) +

n

i=1

(ei−e)2<0.(22)

The left-hand side of (22) is a stochastic variable with

distribution N(α1, β1σ2), where

α1=

n

i=1

(ei−e)2

and

β1= 4

n

i=1

(ei−e)2.

We deﬁne the square of the distance between the vectors x

and ˆ

xby

d2

1(x,ˆ

x) = 4α2

1

β1

=

n

i=1

(ei−e)2.

The probability that δ1(r,ˆ

x)< δ1(r,x)equals

Qd1(x,ˆ

x)

2σ,

where the Q-function is deﬁned by

Q(x) = 1

√2π∞

x

e−u2

2du.

The word error rate (WER) over all coded sequences xis

now upperbounded by

WER <1

|S1|

x∈S1

ˆ

x̸=x

Qd1(x,ˆ

x)

2σ.(23)

Deﬁne the square of the minimum distance between any

possible pair of codewords in S1by

d2

min,1= min

x,ˆ

x∈S1

x̸=ˆ

x

d2

1(x,ˆ

x) = min

e̸=0

n

i=1

(ei−e)2.(24)

6

Then, for asymptotically large signal-to-noise-ratio’s, i.e. for

σ << 1, the word error rate is overbounded by [10]

WER < N1Q(dmin,1

2σ),(25)

where N1is the average number of pairs of codewords

(neighbors) at minimum distance, dmin,1. The minimum

distance, dmin,1, is called (asymptotic) coding loss. We

simply ﬁnd

dmin,1=1−1

n.(26)

The computation of the average number neighboring pairs

of codewords ˆ

xof xin S1at minimum distance dmin,1

is a formidable combinatorics exercise. We may, however,

compute an approximation to N1by using the following

observation. Clearly, a pair of codewords ˆ

xof xat unity

Euclidean distance δ′(ˆ

x,x)is also a pair of codewords at

minimum distance dmin,1. For a full set of qncodewords, a

neighbor at unity Euclidean distance from xis obtained by

adding or subtracting a ‘one’ from each of the nsymbols in

x, unless the symbol equals 0 or (q−1), then we can only

add a one (if x1= 0) or subtract a one (if xi=q−1). Then

the average number of pairs of codewords at unity Euclidean

distance equals 2n(q−1)/q. Since the code set S1is

obtained by deleting a relatively small number of codewords

from the full set, we will approximate the average number

of neighbors, N1, at minimum distance dmin,1in S1by

N1≈2n(q−1)

q.(27)

For small values of nand q > 2the computation of N1is

amenable by exhaustively computing the distance between

each pair of codewords. We found that in the range of

(small) values of nand qinvestigated that the approximation

is of sufﬁcient accuracy for engineering applications.

By combining (25), (26), and (27), we obtain an upper-

bound to the word error rate (WER)

WER <2n(q−1)

qQ1

2σ1−1

n.(28)

Figure 3 shows the WER, computed using the above upper-

bound (28), as a function of the signal-to-noise-ratio (SNR),

where the quantity SNR is deﬁned by

SNR(dB) = −20 log10 σ.

Results are presented in Figure 3 for two binary cases,

n= 4 and n= 12. Computer simulations of the detection

process were conducted for assessing the accuracy of (28).

The dotted lines show the results obtained by computer

simulations, which compare fairly well with (28).

B. Case T= 2, offset and gain mismatch

We will now examine the error performance of the

Pearson-distance-based detection scheme. The receiver uses

the Pearson distance (6) for the evaluation of the received

15 15.5 16 16.5 17 17.5 18 18.5 19

10−4

10−3

10−2

10−1

WER

SNR (dB)

n=4

n=12

Fig. 3. Word error rate (WER) of offset-resistant detection as a

function of the signal-to-noise ratio (SNR) for the binary case,

q= 2, and n= 4 and n= 12 computed using upperbound (28).

The dotted lines show results of computer simulations.

word, where we assume that x∈S2is sent, and received

as r=x+ν. The receiver errs if there is at least one

codeword ˆ

x̸=x,ˆ

x∈S2, such that

δ2(r,ˆ

x)< δ2(r,x).

After working out using (12), we obtain

−

n

i=1

ri(ˆxi−ˆx

σˆx

)<−

n

i=1

ri(xi−x

σx

).

We substitute ri=xi+νi, and obtain

n

i=1

(xi+νi)(ai−ˆai)<0,(29)

where

ai=xi−x

σx

and

ˆai=ˆxi−ˆx

σˆx

.

The left-hand side of inequality (29) is a stochastic variable

with distribution N(α2, β2σ2), where

α2=

n

i=1

xi(ai−ˆai)

and

β2=

n

i=1

(ai−ˆai)2.

Since

n

i=1

ai=

n

i=1

ˆai= 0,

7

we have

α2=

n

i=1

xi(ai−ˆai)

=

n

i=1

(xi−x)(ai−ˆai)

=

n

i=1

(xi−x)xi−x

σx−ˆxi−ˆx

σˆx

=σx(1 −ρx,ˆ

x).(30)

In a similar fashion, we ﬁnd

β2= 2(1 −ρx,ˆ

x).(31)

Deﬁne the square of the distance, d2

2(x,ˆ

x), between the

codewords xand ˆ

xby

d2

2(x,ˆ

x) = 4α2

2

β2

= 2σ2

x(1 −ρx,ˆ

x).(32)

The distance, d2

2(x,ˆ

x), is not symmetric in the vectors x

and ˆ

x, that is, in general, d2

2(x,ˆ

x)̸=d2

2(ˆ

x,x). The quantity,

d2

2(x,ˆ

x), is the product of the Pearson distance between the

vectors xand ˆ

x, which is symmetric in xand ˆ

x, and the

word variance of the sent word x. Clearly, sent words x

that have a small symbol value variance are more prone

to error than words with a large symbol value variance.

The word error rate (WER) over all coded sequences xis

upperbounded by

WER <1

|S2|

x∈S2

ˆ

x̸=x

Qd2(x,ˆ

x)

2σ.(33)

We deﬁne the minimum squared distance between any pair

of codewords in S2,d2

min,2, by

d2

min,2= min

x,ˆ

x∈S2

x̸=ˆ

x

d2

2(x,ˆ

x)

= min

x,ˆ

x∈S2

x̸=ˆ

x

2σ2

x(1 −ρx,ˆ

x).(34)

At high signal-to-noise ratios, the word error rate (WER) is

overbounded by [10]

WER < N2Q(α2

√β2σ)

=N2Q(dmin,2

2σ),(35)

where N2is the (average) number of nearest neighbors.

We will now compute the minimum distance, d2

min,2, and

the number of nearest neighbors, N2.

In order to ﬁnd the minimum distance, dmin,2, we must

compute the distance between any pair of codewords x,ˆ

x∈

S2, which implies an exhaustive domain search of size

around |S2|2. We may signiﬁcantly reduce the number of

evaluations by the following observations.

It is not difﬁcult to see that any permutation of the

symbols of a T-constrained n-length q-ary codeword yields

again a T-constrained codeword. A constant composition

code is a set of n-length q-ary codewords where the numbers

of occurrences of the symbols within a codeword is the same

for each codeword [11]. These specialize to constant weight

codes in the binary case, and permutation codes in the case

that each symbol occurs exactly once.

Deﬁne the composition vector w(x)=(w0, . . . , wq−1)

of x, where the qentries wj,j∈ Q, of windicate the

number of occurrences of the symbol j∈ Q in x. Thus for

a sequence x, we denote the number of appearances of the

symbol jby

wj(x) = |{i:xi=j}| for j= 0,1, . . . , q −1.(36)

It is immediate that wj=nand wj∈ {0, . . . , n}. A

constant composition code will be denoted by Sw, where

wis the composition vector that characterizes the code.

Clearly, the codebook STis the union of Kconstant

composition codes, denoted by Swi,1≤i≤K, whose

composition vector

wi= (w0, . . . , wj, . . . , wq−1)i,1≤i≤K,

has w0>0for T= 1, and both w0>0and wq−1>0

for T= 2. The number, K, of constant composition codes

equals

K=n+q−1−T

q−1.(37)

For the binary case, q= 2, we simply ﬁnd

K=n+ 1 −T.

Each constant composition code is characterized by one

codeword of the code, called pivot word, denoted by xpi,

1≤i≤K. The pivot word xpiis, by deﬁnition, the largest

word in the lexicographical ordering (the largest symbols

ﬁrst) of the codewords in Swi. Thus, for a pivot word we

have xpi∈Swiand xpi=(xpi,1, xpi,2, . . . , xpi,n), where

xpi,1≥xpi,2≥xpi,3... ≥xpi,n−1≥xpi,n,1≤i≤K.

By deﬁnition we have for T= 2,xpi,1=q−1and

xpi,n = 0,1≤i≤K. The remaining codewords in

STconsist of all distinct sequences that can be formed by

permuting the order of the nsymbols that form the Kpivot

words xpi,1≤i≤K.

Let the codewords x∈Swiand ˆ

x∈Swj,i̸=j, then

we have

d2

2(x,ˆ

x) = 2σ2

x(1 −ρx,ˆ

x) = A−B

n

i=1

xiˆxi,

where

A= 2σ2

x(1 + nxˆ

x

σxσˆx

)

and

B=2σx

σˆx

are positive constants. Since the average symbol value and

symbol value variance of codewords from the same constant

composition code are all equal, the only degree of freedom

8

we have for minimizing d2

2(x,ˆ

x)is permuting the symbols

in xand ˆ

xin such a way that the inner product n

i=1 xiˆxi

is maximized. It has been shown by Slepian [12] that

n

i=1 xiˆxiis maximized by pairing the largest symbol of

xwith the largest symbol of ˆ

x, the second largest symbol

of xwith the second largest symbol of ˆ

x, etc. Since, by

deﬁnition, the pivot words are sorted by descending order

of the symbol values, we conclude that the minimum inter-

subset distance is given by

min

x∈Swi,ˆ

x∈Swj

d2(x,ˆ

x) = d2(xpi,xpj), i ̸=j.

Deﬁne the minimum intra-subset distance by

d2(xpi,xpi) = min

x,ˆ

x∈Swi

x̸=ˆ

x

d2(x,ˆ

x),

then it is immediate that

dmin,2= min

1≤i,j≤Kd2(xpi,xpj).(38)

A second reduction in the number of distance evaluations

can be made by observing that

d2(x,ˆ

x) = d2(q−1−x, q −1−ˆ

x).(39)

The above observation implies that we may limit the dis-

tance evaluations to (sent) words x, whose number of ‘q−1’

symbols is less than the number of ‘0’ symbols. For other

values of q,q > 2, the pivot words start with a series of

‘q−1’ symbols, followed by a series of ‘q−2’ symbols

etc, and ended by a series of ‘0’ symbols. The series of

symbols may be of zero length, except, however, for the

symbol values ‘q−1’ and ‘0’, where the series must have

a length of at least unity.

Figure 4 shows results of computations, where we plotted

−20 log(dmin,2)(dB) as a function of nwith q=2, 3, 4

as a parameter. After perusing the diagram, we notice that

the variation of dmin,2as a function of ndiminishes with

larger values of q. We further notice that with increasing n

the minimum distance dmin,2converges to a limiting value.

In our computations, we found that (but we could not prove

it for all qand n) that the codewords x= (q−1, q −

2,0, . . . , 0) and ˆ

x=(q−1, q−1,0,...,0), and their inverses

(q−1, q −1, . . . , q−1,1,0) and (q−1, q −1, . . . , q −1,0,0)

are at minimum squared distance d2

min,2= min 2σ2

x(1 −

ρx,ˆ

x),x,ˆ

x∈S2. For q= 2, the codewords (1, 0, 0, ...) and

its inverse (1, . . . , 1,0) each have n−1nearest neighbors.

This also holds for the npermutations of (1, 0, 0, . . . )

plus its inverse (0, 1, 1, . . . ), so that, for q= 2, the total

number of pairs of codewords at minimum distance equals

2n(n−1). For q > 2, the codeword (q−1,q−2, 0, . . . )

and its n(n−1) permutations each have only one codeword

at minimum distance. The same holds for its inverse (0, 1,

q−1,q−1,...), so that for q > 2there are 2n(n−1) pairs

of codewords at minimum distance. We conclude with (35)

that

WER <2n(n−1)

|S2|Q(dmin,2

2σ), σ << 1.(40)

0 5 10 15 20 25 30

1.8

2

2.2

2.4

2.6

2.8

3

σ2

mi n, 2 (dB)

n

q=2

q=4

q=3

Fig. 4. Minimum squared distance, −20 log (dmin,2)(dB), as a

function of the codeword length nwith q= 2,3,4as a parameter.

Although lines have been drawn, the curves consist of discrete

points.

15 15.5 16 16.5 17 17.5 18 18.5 19

10−4

10−3

10−2

10−1

WER

SNR (dB)

n=12

n=4

Fig. 5. Word error rate (WER) of offset&gain-resistant detection

as a function of the signal-to-noise ratio (SNR) for q= 2,n=

4and12. The diagram shows the error performance computed by

upperbound (33) and computer simulations (dotted lines).

Upperbound (40), where it is assumed that minimum

distance error events dominate the performance, is far from

accurate in the range WER >10−8. A better approximation

to the word error rate is given by upperbound (33), where

the full distance proﬁle is used. Figure 5 shows the word

error rate computed using upperbound (33) for q= 2 and

n=4, 12, as a function of the signal-to-noise-ratio. The

computer simulations (dotted lines) compare fairly well with

upperbound (33).

V. IMPLEMENTATION ISSUES

In the above we did not yet address the implementation

of the Minimum Pearson Distance detector, and we tacitly

assumed that the receiver computes the Pearson distance

for all codewords in the codebook before it may give its

verdict on the word sent. Below we will show that we

9

TABLE I

PIVOT W OR DS,AVE RAG E SYM BO L VALUE ,THE S YM BOL VAL UE

VARIANCE AND THE DISTANCE OF CASE DESCRIBED IN EXAMP LE 1.

ixpixpiσ2

xpiδ2(r,xpi)

1 (1,0,0,0) 1/4 3/4 5.93

2 (1,1,0,0) 2/4 1 6.23

3 (1,1,1,0) 3/4 3/4 6.74

may reduce the number of distance computations to the

number of constant composition subsets, K, that constitute

the full set ST. This means for q= 2 and T= 2,

for example, that instead of 2n−2for a full set, only

n−1computations of the Pearson distance are required.

As discussed earlier, Slepian [12] showed that a single per-

mutation modulation code may be very efﬁciently decoded

by applying a sorting algorithm to the entries of the received

signal vector. Slepian’s method can be extended to our case

incorporating a plurality of Kconstant composition codes.

The receiver has tabulated the Kpivot words, where the

symbols of the pivot words are, as described above, sorted

in descending order, i.e., the symbols with the largest values

ﬁrst. Detection of the received vector, r, is accomplished by

invoking the following two-step procedure.

1) The nsymbols of the received word, r, are sorted,

largest to smallest, in the same way as taught in

Slepian’s prior art.

2) Compute δ2(r,xpi)or δ1(r,xpi),1≤i≤K, using

(12) or (17), for all Kpivot words. The receiver

decides that a word taken from Swk,1≤k≤K,

was sent in case the pivot word xpkis at minimum

distance to the received vector r. Now that we

have ascertained that the sent word is a member of

Swk, we can decode the received word by Slepian’s

procedure for single permutation codes.

Below we will describe a simple example for the gain-and-

offset mismatch channel to illustrate the detection routine.

Example 1: Let n= 4 and q= 2, then there are 14

codewords in S2and 3 subsets of constant composition.

Assume the received vector is r= (1.2, 2.3, 0.4, 0.8). First

we sort the symbols of rlargest to smallest, and obtain

(2.3, 1.2, 0.8, 0.4), and compute δ2(r,xpi)for each pivot

word xpi. Table I lists xpi,i= 1,2,3, the average symbol

value of the pivot words, the symbol value variance of the

pivot words, and the distance δ2(r,xpi)computed using

(13). We conclude that the pivot word (1,0,0,0) has the

smallest distance, 5.93, to the received vector r, so that

the detector, following Slepian’s sorting algorithm assigns

the largest symbol in rto a ‘1’ and the three other symbols

to ‘0s’. Thus, the receiver decides that the word (0,1,0,0)

was sent.

VI. CONCLUSIONS

We have studied coding and detection techniques for q-

level channels with gain and/or offset mismatch. We have

analyzed a new technique, where codeword detection is

based on the Pearson distance. The proposed detection

technique is used in conjunction with T-constrained codes

consisting of q-ary codewords, where in each codeword T

reference symbols appear at least once. We have shown that

the new detection technique is intrinsically resistant to offset

and/or gain mismatch. The redundancy of T-constrained

codes is much lower than that of prior art balanced codes

that offer offset and gain mismatch resistant detection,

which makes the new codes more attractive for practical

applications. We have analyzed the error performance of

the Pearson Distance detection technique in the presence of

additive noise. Results of computer simulations of the noisy

channel have been compared with analytical expressions of

the word error rates.

REF ER EN CE S

[1] K.A.S. Immink, ‘Coding Methods for High-Density Optical Record-

ing’, Philips J. Res., vol. 41, pp. 410-430, 1986.

[2] G. Bouwhuis, J. Braat, A. Huijser, J. Pasman, G. van Rosmalen, and

K.A.S. Immink, Principles of Optical Disc Systems, Adam Hilger

Ltd, Bristol and Boston, 1985.

[3] K.W. Cattermole, ‘Principles of Digital Line Coding’, Int. Journal of

Electronics, vol. 55, pp. 3-33, July 1983.

[4] A. Jiang, R. Mateescu, M. Schwartz, and J. Bruck, ‘Rank Modulation

for Flash Memories’, IEEE Trans. Inform. Theory, vol. IT-55, no. 6,

pp. 2659-2673, June 2006.

[5] H. Zhou, A. Jiang, and J. Bruck, ‘Error-correcting schemes with

dynamic thresholds in nonvolatile memories’, Int. Symposium in

Inform. Theory (ISIT), St Petersburg, July 2011.

[6] F. Sala, R. Gabrys, and L. Dolecek, ‘Dynamic Threshold Schemes

for Multi-Level Non-Volatile Memories’. IEEE Trans. on Commun.,

pp. 2624-2634, Vol. 61, July 2013.

[7] K.A.S. Immink, ‘Coding Schemes for Multi-Level Flash Memories

that are Intrinsically Resistant Against Unknown Gain and/or Offset

Using Reference Symbols’, Electronics Letters, vol. 50, pp. 20-22,

2014.

[8] K.A.S. Immink, ‘Coding Schemes for Multi-Level Channels with

Unknown Gain and/or Offset Using Balance and Energy constraints’,

IEEE International Symposium on Information Theory, (ISIT), Istan-

bul, July 2013.

[9] K.A.S. Immink, ‘High-Rate Maximum Runlength Constrained Cod-

ing Schemes Using Nibble Replacement’, IEEE Trans. Inform. The-

ory, pp. 6572-6580, vol. IT-58, No. 10, Oct. 2012.

[10] G.D. Forney Jr., ‘Maximum-Likelihood Sequence Estimation of Dig-

ital Sequences in the Presence of Intersymbol Interference’, IEEE

Trans. Inform. Theory, vol. IT-18, pp. 363-378, May. 1972.

[11] W. Chu, C.J. Colbourn, and P. Dukes, ‘On Constant Composition

Codes’, Discrete Applied Mathematics, Volume 154, Issue 6, 15 pp.

912-929, April 2006.

[12] D. Slepian, ‘Permutation Modulation’, Proc IEEE, vol. 53, pp.

228-236, March 1965.

Kees Schouhamer Immink (M81-SM86-F90) received his

PhD degree from the Eindhoven University of Technology.

He was with Philips Research Labs in Eindhoven from

1968 till 1998. In 1998, he founded Turing Machines Inc, a

company that has been successful in applying the tenets of

information theory to digital data storage and transmission.

He is, since 1994, an adjunct professor at the Institute

10

for Experimental Mathematics, Duisburg-Essen University,

Germany.

Immink designed coding techniques of virtually all

consumer-type digital audio and video recording products,

such as Compact Disc, CD-ROM, CD-Video, Digital

Audio Tape recorder, Digital Compact Cassette system,

DCC, Digital Versatile Disc, DVD, Video Disc Recorder,

and Blu-ray Disc. He received widespread recognition

for his many contributions to the technologies of video,

audio, and data recording. He received a Knighthood in

2000, a personal Emmy award in 2004, the 1996 IEEE

Masaru Ibuka Consumer Electronics Award, the 1998

IEEE Edison Medal, the 1999 AES Gold Medal, the

2004 SMPTE Progress Medal, and the Eduard Rhein

Prize for Technology in 2014. He received the Golden

Jubilee Award for Technological Innovation by the IEEE

Information Theory Society in 1998. He was named a

fellow of the IEEE, AES, and SMPTE, and was inducted

into the Consumer Electronics Hall of Fame, and elected

into the Royal Netherlands Academy of Sciences and the

US National Academy of Engineering. He received an

honorary doctorate from the University of Johannesburg in

2014. He served the profession as President of the Audio

Engineering Society inc., New York, in 2003.

Jos H. Weber (S’87-M’90-SM’00) was born in Schiedam,

The Netherlands, in 1961. He received the M.Sc. (in math-

ematics, with honors), Ph.D., and MBT (Master of Busi-

ness Telecommunications) degrees from Delft University

of Technology, Delft, The Netherlands, in 1985, 1989, and

1996, respectively.

Since 1985 he has been with the Faculty of Electrical

Engineering, Mathematics, and Computer Science of Delft

University of Technology. Currently, he is an associate

professor in the Department of Intelligent Systems. He is the

chairman of the WIC (Werkgemeenschap voor Informatie-

en Communicatietheorie in the Benelux) and the secretary

of the IEEE Benelux Chapter on Information Theory. He

was a Visiting Researcher at the University of California

at Davis, USA, the University of Johannesburg, South

Africa, the Tokyo Institute of Technology, Japan, and EPFL,

Switzerland. His main research interests are in the areas of

channel and network coding.