Sie sind auf Seite 1von 14

Signal Processing 28 (1992) 139-152 Elsevier

139

Using M-sequences for determining the impulse responses of LTI-systems

Ning Xiang'

Lehrstuhl fur Allgemeine Elektrotechnik und Akustik, Ruhr-Unioersitat Bochum, Germany

Received 9 January 1989

Revised 4 May 1990 and II October 1990

Abstract. Determinations of the impulse responses of LTI-systems can be performed using the Fast M-sequence Transform, where the efficient Fast Hadamard Transform algorithm can be exploited. For this purpose, two permutations must be carried out. This paper presents an alternative to several existing approaches by constructing the permutation matrices from right cyclic shifted M-matrices. This approach is convenient in the sense that merely one permutation matrix has actually to be calculated, it can however be used at the same time for two different M-sequences. Several aspects of the technique will be discussed with particular reference to implementation of the approach on a PC-AT computer.

Zusammenfassung. Messungen von Impulsantworten konnen mittels der Fast M-Foige Transformation durchgefuhrt werden, wobei der leistungsfahige Algorithmus der Fast Hadamard Transformation ausgenutzt werden kann. Die Voraussetzung dafiir ist, zwei Permutationen auszufuhren. Als Alternative zu einigen existierenden Verfahren zeigt dieser Artikel ein Verfahren, die Permutationsmatrizen aus rechts zyklisch verschobenen M-Matrizen zu konstruieren. Es braucht ausschlieBlich eine permutationsmatrix berechnet zu werden, sie kannjedoch bei diesem Verfahren gleichzeitig fur zwei unterschiedliche M-Foigen verwendet werden. Anhand der Implementierung des Verfahrens auf einem AT Personal Computer werden einige relevanten technischen Aspekte diskutiert.

Resume. La determination des reponses impulsionnelles des systemes LTI peut etre realisee a I'aide de la transformee Msequences rapide, dans laquelle I'algorithme efficace de transformee rapide de Hadamard peut etre exploite, Dans cette optique, deux permutations doivent etre operees. Cet article presente une alternative a plusieurs approches exist antes consistant en la construction de matrices de permutation a partir de M-matrices decalees cyciiquement a droite. Cette approche est attrayante au sens qu'une seule matrice de permutation doit etre en fait calculee, et peut neanmoins etre employee au meme instant par deux M-sequences differentes. Plusieurs aspects de cette technique sont discutes avec une emphase particuliere sur son implantation sur un ordinateur PC AT.

Keywords. PN-sequence, M-sequence, LTI-system measurement, impulse response, system evaluation.

1. Introduction

One important aspect m the analysis of linear time-invariant systems (in short: LTI-systems) is knowing the transfer function or the impulse

Correspondence to: Ning Xiang, HEAD Acoustics GmbH, Kaiserstrasse 100, W-5120 Herzogenrath, Germany. Tel: (+49- 2407) 577-0; Fax: (+49-2407) 577-99.

I Present address: Head Acoustics GmbH, Kaiserstrasse 100, 5120 Herzogenrath, Germany.

response of the system concerned. For many applications, direct determination of the impulse response is preferable. For instance, a room impulse response between a loudspeaker and a microphone in, say, a concert hall, contains significant acoustic information. Not only can many important physical parameters be derived from it, but the convolution of an anechoic signal (i.e. music or speech) with so-called binaural impulse responses measured with the aid of a dummy head

0165-1684/92/$05.00 © 1992 Elsevier Science Publishers B.V. All rights reserved

140

N. Xiang / M-sequences for determining impulse responses

can also offer possibilities of 'listening in' to the room [8]. Among various methods of determining the impulse response, the method based on the fast M-sequence transform (FMT) [4] provides an efficient approach where an analog version of a binary periodic maximal-length sequence (in short M-sequence) is used as the stimulus signal to the input of LTI-systems. After sampling one period of the system response at the output, the impulse response of the system can be evaluated by crosscorrelation between the digital version of the Msequence and the received system response. The efficiency of the FMT lies in the fact that the algorithm of the fast Hadamard transform (FHT) can be exploited [12]. A main advantage of this technique over conventional ones, as mentioned in several previous works [3, 18], is its high noise immunity.

In order to use the FHT algorithm, two permutations, as discussed in a later section, have to be carried out according to permutation matrices derived from a selected M-sequence. The application of M-sequences for determining impulse responses of LTI-systems dates back to the beginning of the 70s [16]. Since then several contributions to this concept have been made [2-4, 12]. However, most of them have merely concentrated on calculating permutation matrices, or have been restricted to a certain application. The M-sequence method, however, has found and, in the author's opinion, will continue to find wide applications over interdisciplinary fields.

The aim of this paper is, firstly, to introduce another approach to calculating the permutation matrices. Unlike some existing approaches, the implemented approach, described below, starts calculating permutation matrices from the right cyclic shifted M-matrices. It can be shown that just one permutation matrix needs to be determined, this is simultaneously suitable for the two M-sequences. It favors those applications in which selected Msequences have to be frequently changed, such as in a so-called 'matched receiver' [13, 17] in radar applications or in telecommunication systems for purpose of security. It is also of great convenience

Signal Processing

when investigating to what extent different Msequences influence results of the FMT, for different M-sequences of the same length show different statistical properties as mentioned by several authors [1, 7, 19]. Furthermore, the possibilities exist of cancelling the special restrictions that several other approaches place on the M-sequences, and of eliminating DC-error, which is desirable in some applications.

We will first enumerate, in this paper, in Section 2, some of the relevant properties of M-sequences and the related mathematics. Section 3 outlines the principle of impulse response determination using M-sequences. The calculation of the permutation matrices is dealt with in Section 4. Finally, two practical problems are discussed in Sections 5 and 6.

2. Maximal-length sequences

A full discussion of M-sequences can be found in [5]. In this section, a concise explanation is given. An n stage linear shift-register (see Fig. 1) can generate a binary periodic M-sequence {ai}, aiE {O, I} of period T= 2n - 1, it fulfils the linear recurrence

n

a.= I Ckai-k(mod2b O~i< T, k=1

(1)

with Ck E {O, I} but Co = c; = 1. The summation is calculated modulo 2. The primitive polynomial f(x) = I:=o CkXk defined over the finite field GF(2) represents the feedback combination of the shiftregister. One primitive polynomial of degree nand one initial state a-I, a-2, ... , a-n of the shift-registers (representing the initial content of each shiftregister stage) corresponds to a unique Msequence. Under a given primitive polynomial, different initial states (apart from the zero-state) correspond to different M-sequences, which differ from each other only in a phase shift [5].

EXAMPLE 1. Consider Fig. 1, let n = 3, T= 7, the primitive polynomial f( x) = 1 + x + x3• When the

N. Xiang / M-sequences for determining impulse responses

Memory element or flip-flop

Addition mod. 2 or exclusive OR

Feedback coefficient [j E (0,1)

OJ

141

OJ-n

[n=1

Oi =i [kOj_k (Mod.2), fIx) =1+ f [kXk, [n=1

k=1 k=1

bj=(-11Qi (or) bi=1-2oj

Fig. 1. An n-stage linear shift register for generating binary periodic sequences.

initial state of the shift-register a_I = a-3 = I, a-z = o is given, an M-sequence {ai} = {0011101} with o ~ i < 6 can be generated. Under the given primitive polynomial, another M-sequence {di} = {1110100} can also be obtained by the initial state a-I=a-Z=O, a-3=1.

Furthermore, one can always derive an Msequence {di} from a given one {ai} in terms of a phase shift, e.g. d, = a, + T so that the condition d, = dZi is satisfied, where the index 2i is calculated modulo T. The sequence {d;} is referred to for the first time as characteristic M-sequence by Gold [9]. Associated to each primitive polynomial is precisely one characteristic M-sequence in connection with one initial state.

EXAMPLE 2. Consider an M-sequence with the period 7:

{ai}={0011101}, 0~i~6,

where ao=O, al =0, az= 1, ... , a6= 1. When 1'=2, it is clear that {di} = {1l10100} is a characteristic M-sequence. The reader can easily verify that the condition d, =d» holds, since do = do = "1, d, = dz = 1, dz = d4 = 1, ds = d3 = 0 and so on. Note that the index of the sequence element dZi has to be calculated modulo 7.

A primitive polynomial f(x) of degree n with coefficients from GF(2) has close connection with the elements of GF(2n) which again are of importance in this context. GF(2n) is called Galois field which is a finite field containing 2n elements with n being any positive integer. GF(2), for example, is its special case, when n = 1. In a finite field, it is possible to add, subtract, multiply and divide [15]. Furthermore, for any element a in the field, elements 0, 1, -a and (for a #0) a-I must exist such that

O+a=a,

(-a)+a=O, (a-I)a = 1.

Oa=O,

la=a,

The elements of GF(2n) can be represented in a polynomial form; they are all polynomials in x of degree ~n - 1 with coefficients from GF(2). Another form ofrepresenting elements ofGF(2n) is as successive powers of a certain fixed field element called a primitive element denoted e.g. by v. As mentioned above, there exists another element V-I (for v#O). V-I is also a primitive element of GF(2n) [11]. Given a primitive polynomialf(x) of degree n, one can always find a primitive element v of GF(2n) such that f(v) =0. Note that there exists another element v -I which is also a primitive element. So we can say: if f(x) is given, one can always find a certain primitive element denoted by

Vol. 28, No.2, August 1992

142

N. Xiang / M-sequences for determining impulse responses

V-I so that f( V-I) = 0 [11, 15]. The last statement favors our discussion in the following.

EXAMPLE 3. Let n=4, the primitive polynomial f(x) =X4+ x+ 1. There exist a, vEGF(24) and a = V-I such thatf(a)=O, all elements of GF(24), apart from 0, can then be represented as

2 3 aI4,aI5=1.

a, a, a, ... ,

The 16 elements of GF(24) can also be written as

A correspondence between these two forms can be obtained from a shift-register associated with the given primitive polynomial f(x) as shown in Fig. 2. All states of this' shift-register correspond to the elements of GF(24) both as successive powers of a and as polynomials in x of degree smaller than 4, where only the coefficients of the polyn omials are lis ted (see also [15]).

+ x

+x 4 =f(x)

As a polynomial As a power of ex
0 0 0 1
1 0 0 0 ex
1 1 0 0 ex2
1 1 1 0 ex3
1 1 1 1 ex4
0 1 1 1 ex5
1 0 1 1 ex6
0 1 0 1 ex7
1 0 1 0 exB
1 1 0 1 ex9
0 1 1 0 ex 10
0 0 1 1 ex 11
1 0 0 1 ex 12
0 1 0 0 ex 13
0 0 1 0 ex 14
0 0 0 1 ex 15 = 1
Fig. 2. The elements of the GF(24) generated by the shift-
register associated with f( x) = 1 + x + X4.
Signal Processing Lempel [11] revealed a close relation between a characteristic M-sequence and the trace operator of an element a over GF(2n). Based on the trace operator, the concept of trace orthogonal basis (TOB), which is subsequently of importance in factorisation of an M-matrix (see (21) and (23», can easily be understood.

DEFINITION 1. Let a be an arbitrary element of GF(2n), then the trace of a is defined by

n-I

Tr(a) = L a2i.

i=O

(2)

Note that the summation in (2) is calculated modulo 2, where a should be represented in the form of polynomials of degree ~n - 1 (see [15] for details).

The trace operator has the following properties [1, 11, 15]:

Tr(a)EGF(2),

Tr(a2) =Tr(a),

(3) (4)

Tr(aa +bf3) =a Tr(a) +b Tr(f3),

where a, f3EGF(2n) and a, bEGF(2).

From its definition and its properties (eqs. (2) and (3», the trace operator can be considered as a special transformation from the elements defined over GF(2n) to those over GF(2). To be more precise, letf(x) be a primitive polynomial of degree n over GF(2) and V be a primitive element of GF(2n) which satisfies f( V-I) =0 (see [11, 15] for details), then sequence {ai} with the elements

(5)

is just a characteristic M-sequence [9, 11] where i is an integer. Equation (1) and the properties in (3) make this more understandable: first of all, an element of the sequence {ai} is binary, because Tr( Vi) EGF(2); secondly, a, fulfils the linear recurrence in (1) (see [11]); finally, a2i=Tr(v2i)= Tr( Vi) = a., which satisfies the condition mentioned above for a characteristic M-sequence.

N. Xiang / M-sequences for determining impulse responses

DEFINITION 2. A trace orthogonal basis IS defined by a basis Q={WO,WI, ... ,Wn-t} of GF(2n) over GF(2) for which

(6)

and

(7)

A trace orthogonal basis can be considered as a special coordinate system containing n vectors Wo, WI, ... , Wn-I which are orthogonal to each other in a sense of trace operator so that an arbitraryelement viEGF(2n) - {O} can be represented by an n-tuple binary number (eiO, eit , ... , ein-I) as (see also [1])

n-I

vi= L eikWk, k=O

(8)

while

eik = Tr( ViWk) EGF(2).

(9)

M-sequences possess numerous properties which make them attractive in applications. Detailed presentation of their properties and of the trace properties is beyond the scope of this paper (see [5, 11, 15] for more detail). In Section 4, the statements presented here will be used for the purpose of constructing permutation matrices for the FMT on which estimation of impulse responses by fast cross-correlation computation is based.

3. The principle of the determination

In order to estimate the impulse response {g(k)} of an L TI analog system, being of finite order (FIR-system) defined between one input and one output of the system, an analog signal met) (its digital version is noted as {m( k)} or {md where k is an integer) will be applied to the input. Its output signal is sampled by the same clock frequency as that with which the input is generated. This sampled output signal is denoted as {y(k)}. Note that the input signal, the impulse response and the output signal are denoted in this paper as {md, {g(k)}

143

and {y(k)}, respectively, being sequences with finite length, which implies one period of the digital periodic signals. The period of these signals is of the same length T determined by the input signal {mk}. The length of this period T must be chosen to be sufficiently long so that the impulse response to be determined decays to a negligible value over the first J samples, i.e. Ig(J)1 ~O, with J ~ T. When measuring, the input signal has to be fed to the system periodically. One period of the output signal can efficiently be sampled from the beginning of the second period so that the system has become stable. Figure 3 shows this concept in detail. The

Periodic M-sequence

met)

3.period -

+1

-1

LTI analog system under test

Analog/Digital Converter

Digital version of the periodic output

y(k)

Begin of the measurement

Fig. 3. Sampling one period of the system output when stimulating the L TI-system under test by using a periodic M-sequence.

Vol. 28, No.2, August 1992

144

N. Xiang / M-sequences for determining impulse responses

following discussion remains merely in digital domain for convenience.

In system theory, it is well-known that the crosscorrelation function 4>my(k) between the input and output signals of an L TI -system is related to the auto-correlation function 4> (k) of the input signal by

4>my(k)=g(k) * 4> (k),

(10)

with * denoting periodic discrete linear convolution and g(k) the impulse response of the system under test. Let {a;} be an arbitrary binary M-sequence of period T. Consider the periodic M-sequence {m;}, where

m;= I-2a;E{ -1, +I},

(11)

as the input signal, its periodic autocorrelation function is nearly the two-valued Kronecker function (see also [3]):

4>(k)=T+I8(k)-_!_,

T T

(12)

with

8(k)={I, for k=O, 0, for k#O,

where k is calculated modulo T. Figure 4 shows the auto-correlation function of an M-sequence with a period T= 7.

Applying the M-sequence {mk} to the input of the system being measured and substituting 4>(k) in (10) by (12), the impulse response of the system

, .

can then be estimated [3] by

T [ 1 T-l ]

g(k) =- 4>my(k) +- I g(k) .

T+ 1 T k=O

I f1 I I I I I
I
1'" 0 1 2 3 4 5 6 7
-7 I I"

Fig. 4. Periodic auto-correlation function of an M-sequence with the period T=7.

Signal Processing

It is easily verified (see also [3]) that

T-l T-l

I g(k) = T I 4>my(k)

k=O k=O

and

T [ T-l ]

g(k) = T+ 1 4>my(k) + k~O 4>my(k)

1 [T-l ]

=-- I mjYj+k- Y ,

T+ 1 j=O

k=O, 1, ... , T-I, (13)

where the index j + k is calculated modulo T. Equation (13) can again be written in a matrix form [2] :

G=_I_ [MY- it T+I

(14)

where G, Y and Yare column vectors with T elements, and

Y= (y(O), y(I), ... ,y(T-I»T,

Y- (- - -)T

= y,y, ... ,y ,

G= (g(O), g(l), ... ,g(T-I»T.

The matrix M consists of right cyclic shifted Msequences [20]. To be more precise, it can be represented as

M= (Mij) = (mj-;(mod T»,

i,j= 0, 1, ... ,T-I, (15)

N. Xiang / M-sequences for determining impulse responses

145

where M ij denotes an element of the matrix M at the ith row and jth column, and m; is the kth element of the M-sequence {md. The M-matrix contains just one period of the selected M-sequence at its first row, with the following rows containing right cyclic shifts of the M-sequence.

In this paper, we emphasize the structure of the M-matrix consisting of right cyclic shifted Msequences. It will be shown in the next section that a new approach of calculating two permutation matrices for the FMT can be derived from this structure. Given an M-sequence, these permutation matrices, only one of which needs actually to be calculated, are at the same time suitable for two different M-sequences. It is of great convenience if long M-sequences being used (e.g. T> is -1) have to be changed frequently, since the calculation of the permutation matrices for such a length is very time consuming. Moreover, this structure is also advantageous in the sense that the elements of the vector G are in a natural order. Otherwise, they take a reversed order apart from the first element [2]. On the technical level, especially in implementing an algorithm for even longer M-sequences on a PC computer which unfortunately do not have prodigious memory capacity, having to reorder the resulted long impulse response takes much more time. The reason for this is that the reordering needs two arrays, each as long as the Msequences. The arrays cannot be located at the same time in the main memory, so that additional time is consumed by having to access the data on disk.

The second term at the right-hand side in (13) or (14) is a constant calculated simply by summation of all digital values of the system response in one period. This calculation will be discussed in Section 6. In the following, a solution of the first term in (14) is discussed. Denote this term as a vector matrix G in order to be distinguished from G, that is,

I G=-MY T+I

(16)

or

1 T-I g(k)=-- L m)Y)+b T+ I )=0

k=O,I, ... ,T-l, (17)

where the index j + k is calculated modulo T. This relation is designated M-sequence transform III earlier works [4, 12].

The matrix M is permutationally similar to Hadamard matrices according to Lempel [12], i.e., (16) can then be written as

~ 1

G=--P2HPIY

T+l '

(18)

where PI and P2 are permutation matrices of dimensions Txt and t x T, respectively, with t = T + 1. The matrix H is the Sylvester-type Hadamard matrix with elements HijE( -1, + 1) (see Appendix A). Since a fast algorithm is possible for the Hadamard transform [2], the M-sequence transform can also be performed in exploiting the fast algorithm of the Hadamard transform. The flow graph in Fig. 5 gives an explanation for the estimation by using the FMT with an M-sequence {mi}={-I, -1, -1, +1, -1, +1, +1}. Stimulating the system under test by an analog version of the M-sequence {mi} periodically, the system response y(i) of one period is measured. This sequence will then be permuted in an appropriate fashion where a zero will be introduced at the beginning of the permuted sequence to build up a sequence with length 2n (corresponding to PI Y in (18». After doing this, Hadamard transform will be carried out where a fast algorithm (FHT) is available just like FFT but only with addition or subtraction (being associated with H(PI Y) in (18». The resulting sequence after FHT will be reduced by ignoring the first value at the point B in Fig. 5. At the same time in the repermutation, the sequence will also be multiplied by a factor 1/( T + 1) (eq. (18».

As explained in Fig. 5, two permutations, besides the FHT, have to be carried out in order to estimate an impulse response from the measured system response. These permutations can be carried

Vol. 28, No.2, August 1992

146

N. Xiang / M-sequences for determining impulse responses

Maximalsequence

Perrnu tal ion =>

=:> System

FHT (tlld)

Impulse Factor:> response => 1

T .. 1

Repermutation

=>

-1 • y(O) • g (0)
-1 • Y (1) • il\r)
-1 • ~EJ~I2J • g 12)
-+ 1 • Syslern y(31 ~~;J~
-I • y(4) • g(4)
+ 1 • y(5) • g (5)
+1' y(6) • g (6) Fig. 5. Flow graph of the FMT for determining an impulse response with an example n = 3, T= 23 - I = 7, t = 23 = 8 and the primitive polynomialf(x) = I + x+ x3•

out upon the permutation matrices in (18). In the following two sections, determination of these permutation matrices is considered.

4. Construction of permutation matrices

In order to determine the permutation matrices P, and P2 in (18), consider the Reed-Muller matrix [6] R, which is a square matrix of order t with its elements RijEGF(2) obtained from the elements Hij of the matrix H by the relation

1- Bij

R··=---=-

IJ 2

(19)

Rt

It has been shown [4] that /It can be factorized as

(20)

where Q is a t x n matrix with t=Z', QT is the transpose of Q. It is interesting that the kth row of Q corresponds exactly to the binary representation of the integer number k (see (25)). With this in mind, we first convert the elements of Minto binary values 0 and 1, similar to (19), with the relation aij=!(1- mij)' The converted matrix A from M can again be factorized in two matrices [11] :

(21)

Signa' Processing

where E, is a matrix of dimension n x T while E2 is a matrix of Tx n. Comparing (21) with (20), the equivalence between (16) and (18) makes the following equations easily understood:

(22)

Hence, in order to determine the permutation matrices, we need only to factorize the matrix A into two factors [22]. To this end, the properties of M-sequences and trace operator come into use. Let {ai} be a characteristic M-sequence with its primitive polynomial j'(x) of degree n, and let v be a primitive element over GF(2n) which satisfies f( V-I) = O. Using the concept of the trace operator and TOB in (2)-(9) and (15), the matrix A can then be factorized as [22]

(23)

To calculate the elements of E" several algorithms can be exploited [2, 11] (see also Appendix B). As an example, consider the sequence {ai} = {1110 100}. By factorizing its corresponding Mmatrix, it can be written as

1 1 o 1

N. Xiang / M-sequences for determining impulse responses

1 0 1 0 0 1 1 0 1 0

001 1 101

A= 1 0 0 1 1 1 0 o 1 001 1 1 1 0 1 001 1 1 101 001

1 1 1 1 1 0

= ~ ~ ~ [1~

1 0 1

010

100

1 0 1 0 0 1]

~~~~~~.

(24)

As has been discussed above, if the M-matrix A has been factorized into two matrices like (24), determination of the permutation matrices IS straightforward, since the matrix Q in (22) is already available. For the above example, the matrix QT can easily be reconstructed:

QT = (0, 1, 2, 3, 4, 5, 6, 7)index

[0 1

= 0 0 o 0

Hence

01010 1 1 0 0 1 o 0 1 1 1

(25)

10100

o 1 001

o 0 1 1 1

101 o 1 1 000

~ ~ ~ ~1]

1 1 1

o 0 0 0 0 0 0

o 1 0 0 0 0 0

o 0 1 0 0 0 0

o 0 0 0 0 0 1

x 0 0 0 0 1 0 0 (26)

000 100 0

o 0 000 1 0

1 0 0 0 0 0 0

147

In a similar fashion, P2 can be obtained by knowing E2:

000 0 000 1 000 1 0 0 0 0 000 0 0 0 1 0

P2 = 0 0 0 0 1 0 0 0 (27)

00000 1 0 0

001 0 0 0 0 0

o 1 0 0 0 0 0 0

Fortunately, PI and P2 take a sparse structure. More precisely, every row of PI in (26), apart from the first row possessing only zeros, contains only one '1', hence matrix PI can be expressed by T integer numbers, each corresponds to a column in PI and indicates in which row '1' appears:

PI = (7, 1, 2, 5, 4, 6, 3)index'

(28)

Note that the first all-zero row has been ignored for PI.

Observing the columns of matrix EI in (26), it is easy to show that columns of EI only contain the binary representation of integer numbers which exactly correspond to PI in (28).

Similarly, P2 in (27) can be written as

P2 = (7, 3, 6,4, 5, 2, 1 )index,

(29)

where each integer corresponds to a row in P2 and indicates in which column '1' appears. When PI and P2 are presented in this form, they need to be calculated only once for a given M-sequence and stored for the FMT. It can also be seen by comparing (29) with (28) that the order of the integer numbers in (29) is just the reverse of that in (28) apart from the first number '7', which is exactly what the result of (23) expresses. Hence, it is noted that the elements of E2 can be easily derived from EI, so that only one matrix needs to be calculated.

In this section, the construction of permutation matrices has been discussed. The starting point is supposing v to be a primitive element over GF(2n) which satisfies I( V-I) = 0, where I(x) is the primitive polynomial of the selected M-sequence {ai} for determining impulse responses. Thus, the Mmatrix A containing right cyclic shifts of the Msequence {ai} can be factored in two factors EI and

Vol. 28, No.2, August 1992

148

N. Xiang / M-sequences for determining impulse responses

E2 by using the concept of the trace operator and TOB introduced in Section 2. After having achieved these two factor matrices of the M-matrix A, two permutation matrices PI and P2 can directly be derived. In particular, their index form can easily be determined by directly converting the binary row-vectors or column-vectors in matrices EI and E2 into integer numbers. In the FMT, the necessary permutations will be performed according to the indices having stored.

Interestingly, for the given primitive polynomial f(x) there always exists a reciprocal primitive polynomial rex) = x'ft» -I) which corresponds to another characteristic M-sequence {eli} [22]. If V-I satisfies f( v -I) = 0, then (v -I) -I also satisfies r( (v -1) -I) = O. Suppose matrix Ar consists of cyclic right shifts of this (reciprocal) characteristic Msequence {eli}, then it can be factored into factors EI and E2, in a similar fashion as (23), by

Ar = (Ar(ij») = (elj_ i) = (Tr( (v -1 )j- i(mod T»))

(30)

Compare the two factor matrices E2 and EI, especially the term o=;:~ eise(-j)s) in (30), to the corresponding factor matrices as well as the term (L;:~ e(-i)sejs) in (23), and bear in mind that the primitive element v is the same in (30) as in (23). It turns out that two permutation matrices (in the form shown in (28) and (29)) calculated for the M-sequence {ai}, can be used directly for the reciprocal M-sequence {eli} by exchanging the order of these two permutation matrices, in other words, PI = (7, 1, ... )index for {ai} becomes P2 = (7, 1, ... )index for {eli}; P2 = (7,3, ... )index for {ai} becomes PI = (7,3, ... )index for {eli} [22].

5. Using an arbitrary M-sequence

Previously, we started the construction of the permutation matrices from a characteristic Msequence. However, in practical implementation, an initial state, e.g. 00 ... 01 or 11 ... 11, may be

Signal Processing

desirable for generating an M-sequence. In this way, the generated M-sequence can be a phase shift of the characteristic one. The permutations according to the permutation matrices derived above also deliver a phase shift of the resulting impulse response when stimulating an LTI-system to be measured with this sequence [20]. This statement can be proved as follows:

Let {ai} be a characteristic M-sequence, and {bi} be generated by the same primitive polynomial but with an arbitrary initial state so that ai=bi-r. Using the relation in (11), two converted Msequences {mi} and {Zi} are obtained with m.= 1- Za, and zi= 1- 2bi, respectively. When stimulating an LTI-system with these two different sequences, two different system responses {y(i)} and {Yl(i)} will result with {y(i)} corresponding to {mi}, {YI (i)} to {Zi} where y(.j) = YI (i - r). As in (17), the impulse response can be estimated as

1 T-I

g(k)=-- L mjy(j+k) mod T, T+ 1 j=O

k=O,I, ... ,T-l

(31)

or

1 T-I

g(k)=-- L zjYI(j+k) mod T, T+ 1 j=O

k=O, 1, ... , T-l.

When performing the permutations of the system response {YI (i)} corresponding to {Zi} based on the permutation matrices for {mi}, it results in another impulse response gl(k):

1 T-I

gl(k)=-- L mjYI(j+k) mod T T+ 1 j=O

1 T-I

=-- L mjy(j+k+ r) mod T. (32)

T+ 1 j=O

Replacing k in (31) by k + r, it becomes g(k+ r)

1 T-I

=-- L mjy(j+k+ r) mod T. (33)

T+ 1 j=O

Comparing (33) with (32), it turns out that g(k+ r) = gl(k).

N. Xiang / M-sequences for determining impulse responses

The statement mentioned above has then been proved.

The permutation matrices derived from {ai} have to be modified in order to meet the need for {bi} in order to achieve the independence of a characteristic M-sequence. Let Al be an M-matrix consisting of the right cyclic shifts of {bi}, it is clearly different from A in (21). Bearing in mind that a= bi-r, the M-matrix Al can, similar to (23), be factored as

Al = (A I (ij» = (bj-i) = (aj-i+r) = (Tr(vj-i+r(mOd T»)

= (Tr( v-ivj+T)) = E2EI

(n-I )

= I e(-i)se(j+r)s , s=o

(34)

where EI , E2 take the same form as EI, E2 in (21) and denote two factors of the matrix A I. Because {ai} and {bi} have the same primitive polynomial, they differ from each other merely in initial states, the primitive element v (equivalently V-I) over GF(2n) in (34) is, therefore, the same as that in (23). Comparing (34), especially' the term (I;:-~ e(-i)Se(j+r)s), to (23), also the term (I;:-~ e(-i)sejs), it is evident, that E2 in (34) is the same as E2 in (23). EI in (34) can be derived from EJ in (23) by cyclicly shifting the elements by r columns when knowing the phase shift r which can be calculated without difficulties [20].

According to the discussion in this section, an arbitrary M-sequence can be selected for determining impulse responses of an L TI -system, which implies that not only the length, the primitive polynomial of an M-sequence can arbitrarily be selected for different purposes, but also the initial state of the shift-register for generating an M-sequence can be set without any limitation where eventually only one permutation matrix has to be slightly modified. This will be of practical interest if a shift-register generator equipped with adjustable stages, for instance, needs to be built for different purposes. In this case, the initial states of all stages (the initial

149

contents of each shift register stage) can conveniently be set, for example, to be high level (digit '1').

6. Elimination of DC-errors

Because of a DC-value in the auto-correlation function of M-sequences (see (12)), estimation of impulse responses using (16) results in a DC-error (see (14». For some applications, however, eliminating this error is desirable. As can be seen in (14), determining the impulse response precisely requires knowing the sum of the system's output. For this reason, consider the point B in Fig. 5. At this point, the FHT just results in the sum of the system's output I y which will not be used otherwise. Thus the DC-error can be removed with this value at the same time as the repermutation is carried out without additional expense of calculating I y.

Another way of eliminating the DC-error is to convert an amplitude-symmetrical M-sequence {mi} with (m,e {-I, + I}) into an amplitudeasymmetrical one in terms of substituting all -1 's of the M-sequence by the value -q with [14]

q= 1/(1 +2/~T+ 1),

(35)

where «< 1, so that the negative component -1/T of its auto-correlation function becomes zero (such auto-correlation functions are referred to as 'perfect' auto-correlation functions, the corresponding sequences are known as 'perfect' sequences [14]). Impulse responses can then be determined only by the cross-correlation between this perfect Msequence and the system response (see (16».

Unfortunately, there are difficulties in realizing the perfect (amplitude-asymmetrical) M-sequences with a shift-register generator, since a precise attenuation of a negative amplitude cannot be easily achieved. We have developed a measurement system on an IBM-AT personal computer with a fast transient recorder for different purposes, it is able to work up to 1 MHz sampling frequency with a resolution of 14/16 bits and is equipped with 4 parallel input- and output-channels. Two fast FIFOmemories (FIFO stands for first in, first out memory principle) with 1 MBytes (extendable up

Vol. 28, No.2, August 1992

150

N. Xiang / M-sequences for determining impulse responses

to 4 MBytes) capacity are also available for inputand output-buffering. The perfect M-sequences can then be generated with software before performing measurements. Figure 6 shows the output side of the transient recorder for generating the perfect Msequence. In order to use the full dynamic range of the DA-converter, the M-sequence is multiplicated at first by an appropriate factor G, its negative amplitude is then attenuated by q (in (35)). Before a measurement, a period of the selected perfect Msequence will have been stored in the FIFO-stage and then sent repeatedly through the DA-converter into the system under test.

Under the given operating system of PC ATs, the algorithm is implemented for a length of Msequence up to 218 - 1 points. Meeting the need of various kinds of requirements, not only the length is adjustable between 28 - 1 and i8 - 1 points, but also M-sequences with different primitive polynomials can be selected according to the user's purpose. Figure 7 illustrates a pair of binaural room-impulse responses measured by an Msequence of length 215 - 1 with a sampling frequency of 44.1 kHz for each channel.

7. Conclusions

This paper is devoted to fast determination of impulse responses of an L TI -system using M-sequences. The efficiency of the method lies in the fact that the algorithm of the Fast Hadamard Transform (FHT) can be exploited. The measured

r-----------------l

I IBM-AT-PC

I

I 5hlft-~iIIler

: generator

I 1-1.+11

I

I Amplifier Attenuator

I for the neg.

I G am itude

L -------~--

I-G.+GJ l-qG.+GI

FIFO

up 10 4 MByte

Fig. 6. Output side of the transient recorder for generating the perfect M-sequences, where the stage 'DMA' stands for 'direct memory access' of PC computers and 'FIFO' stands for 'first

in, first out' memory.

Signal Processing

left ear
I.L. ...
f1Il' "Of
right ear
",01lL. 150

300

ms

450

600

Fig. 7. Binaural room-impulse response measured in a lecture room, sampling frequency: 44.1 kllz/channel; length of the M-sequence: 32727.

system response to the M-sequence and the resulting sequence after the FHT have to be permuted. These permutations are performed according to two permutation matrices.

The present paper has presented an approach to constructing these permutation matrices from the M-matrix containing right cyclic shifts of the Msequence being selected for determining impulse responses. Actually, only one permutation matrix has to be calculated, the other one can be derived straightforwardly from the first one without tedious calculations. These two permutation matrices can, at the same time, be used for another Msequence (reciprocal one) by simply exchanging their order.

It has also been represented that the restriction on a characteristic M-sequence for determination is avoidable when knowing the time shift between the selected M-sequence and the characteristic one. Efficient methods for eliminating the DC-error, which is of practical interest for some applications, have also been demonstrated. The method presented in this paper has been implemented on a PC-AT computer. Having an adjustable length of M-sequences between 28 - 1 and i8 - I and an adjustable sampling frequency, the implemented system for determining impulse responses can find various applications in different fields.

N. Xiang / M-sequences for determining impulse responses

Acknowledgments

The author wishes to express his appreciation to Professor J. Blauert for his helpful support and advice. He is grateful to the anonymous reviewers of the early version of this paper for some critical and valuable comments. His thanks are also due to Ms. G. Harland for help in refining English in the final manuscript. He wishes to thank the Deutsche Forschungsgemeinschaft for financial support.

Appendix A

The Sylvester-type Hadamard matrix and its properties have been extensively described elsewhere [3, 4], but will be briefly repeated.

The Sylvester-type Hadamard matrix H, is a square matrix, its row vectors with the elements being either -lor + 1 are mutually orthogonal, which can be constructed recursively by

+HI]

H' - I

where t is in the form t=T', n=O, 1,2, .... For example, let t = 8, we get

H2=[+1 +1

+1 ]

-1 '

+1 +1 +1 -1 H4=

+1 +1

+1 -1

+1 +1 +1 +1 +1 -1 +1 -1 +1 +1 -1 -1 +1 -1 -1 +1

H; = + 1 + 1 + 1 + 1

+1 -1 +1 -1 +1 +1 -1 -1 +1 -1 -1 +1

+1 +1 +1 -1 +1 +1 +1 -1 -1 -1

-1 +1

-1 -1

-1 +1

+1 +1 +1 -1 -1 -1 '

-1 +1

+1 +1 -1

-1

-1

-1

+1 +1

+1 -J

-1

+1 -1 +1 +1 -1

151

Appendix B

F or completeness of our discussion, we use the algorithm from Alrutz and Schroeder [2] as an example to explain the calculation of the elements of PI in index form like (28). We start the calculation with a characteristic (idempotent) M-sequence where the primitive polynomial f(x) = I;=o c.x' must be given, let

ao=n (mod 2)

and

i

ai=Ci(i+n)+ L csai-s(mod2),

s=1

i=I, ... ,n-l.

From these two equations, the corresponding initial state of the shift register can actually be determined [9]. By using the linear recurrence in

(1),

n

a= L Csai-s(mod2» i=n, n+ 1, ... , T-l, s=1

the characteristic M-sequence can easily be obtained.

Further, n elements of the corresponding traceorthogonal basis must be found based upon (5)(7). Since the Aith element of the characteristic sequence can be expressed by the trace operator in

(5),

aAi = Tr( VAi),

where v satisfies f( V-I) = 0, according to the definition of the trace-orthogonal basis (TOB) in (6) and (7), the Aith element of the sequence corresponds to an element VAi of the TOB, if

Tr(vAi) = 1

and

Tr( VAiVAj) = 0, for i i= j.

Observe n indices Ai of the sequence, so that

for i=], i,j=O, 1, ... , n-l.

Vol. 28, No.2, August 1992

152

N. Xiang / M-sequences for determining impulse responses

In this way, n indices of the characteristic Msequence can be found which exactly correspond to n elements belonging to the TaB.

By knowing the characteristic M-sequence and its TaB, the elements of factor matrix EI in (23) can immediately be calculated. This time, (9) is applied. Since n indices Aj, j = 0, ... , n - I have been found, n elements of the TaB to, can then be expressed as

W . = vAj J' ° 1

} ' =, ... , n- .

From (9), the elements of EI , eij= Tr( viw)

i= 0, I, ... , T-I,

and the index form of the permutation matrix PI can easily be obtained by converting the binary representations in every row of EI into integer numbers,

n-I

PI(i) = L 2jaAj+i, i= 0, ... , T-l. j=O

References

[1] H. Alrutz, Uber die Anw~ndung von Pseudorauschfolgen zur Messung an linearen Ubertragungssystemen, Dissertation Georg-August-Universitat Gottingen, 1983.

[2] H. Alrutz and M.R. Schroeder, "A fast Hadamard transform algorithm for the evaluation of measurements using pseudorandom test signals", Proc. 11th Internat. Con! Acoust., Paris, Vol. 6, 1983, pp. 235-238.

[3] J. Borish and J.B. Angell, "An efficient algorithmus for measuring the impulse response using pseudorandom noise", J. Audio Engrg. Soc., Vol. 31, 1983, pp. 478-488. [4] M. Cohn and A. Lempel, "On fast M-sequences transforms", IEEE Trans. Inform. Theory, Vol. 23, 1977, pp. 135-137.

[5] S.W. Colomb, Shift Register Sequences, Holden-Day, San Francisco, 1967.

[6] P. Delsarte et aI., "On generalized Reed-Muller codes and their relatives", Inform. and Control, Vol. 16, 1970, pp. 403-442.

Signal Processing

[7] H. Els, Ein MeJ3system fiir die akustische Modelltechnik Schriftenr. Bundesanst. Arbeitsschutz Unfallforsch., Vol:

Fb 477, Dortmund, Germany.

[8] H. Els and J. Blauert, "A measuring system for acoustic scale models", Proc. Vancouver Symp.: Acoustics and Theatre Planning for the Performing Arts, 12th Internal. Congr. Acoust., Canada, 1986, pp. 65-70.

[9] R. Gold, "Characteristic linear sequences and their coset functions", SIAM J. Appl. Math., Vol. 14, 1966, pp. 980- 985.

[10] K.W. Henderson,"Comment on computation of the fast Walsh-Fourier transform", IEEE Trans. Comput., Vol. 19, 1970, pp. 850-852.

[11] A. Lempel, "Matrix factorization over GF(2) and traceorthogonal bases of GF(2n)", SIAM J. Comput., Vol. 4, 1975, pp. 175-186.

[12] A. Lempel, "Hadamard and M-sequence transforms are permutation ally similar", Appl. Optics, Vol. 18, 1979, pp. 4064-4065.

[13] H.D. Liike, Signaliibertragung, Springer, Berlin, 1985, Chapter 6, pp. 133-136.

[14] H.D. Liike, "Folgen mit perfekten periodischen Auto- und Kreuz-Korrelationsfunktionen", Frequenz, Vol. 40, 1986, pp.215-220.

[15] F.J. MacWilliams and N.J.A. Sloane, "Pseudo-random sequences and Arrays", Proc. IEEE, Vol. 64, 1976, pp. 1715-1729.

[16] E.D. Nelson and M.L. Fredman, "Hadamard spectroscopy", J. Opt. Soc. Amer., Vol. 60,1970, pp. 1664-1669. [17] D.O. North, "An analysis of the factors which determine signal/noise discrimination in pulsed-carrier systems", Proc. IRE, Vol. 51, pp. 1016-1027.

[18] M.R. Schroeder, "Integrated-impulse method measuring sound decay without using impulses", J. Acoust. Soc. Amer., Vol. 66, 1979, pp. 497-500.

[19] G.H. Tomlinson and P. Galvin, "Analysis of skewing in amplitude distributions of filtered M-sequences", Proc. IEEE, Vol. 121, No. 12, 1974, pp. 1475-1479.

[20] N. Xiang, "Messung von Impulsantworten mit Maximalfolgen", Forlschritte der Akustik-DAGA '88, DPGGmbH, 1988, pp. 893-896.

[21] N. Xiang, "Ein IBM-PC-gestiitztes MeJ3system fur Raumimpulsantworten mittels schneller Maximalfolgen- Transformation", Fortschritte der Akustik, DAGA '89, DPGGmbH, pp. 447-450.

[22] N. Xiang, A mobile universal measuring system for the binaural room-acoustic modelling-technique, Schriftenr. Bundesanstalt fiir Arbeitsschutz, Dortmund, Vol. Fb 611, Wirtschaftsverlag NW, 1991 (ISBN 3-89429-028-5).