Digital Signal Processing Reference
In-Depth Information
4.9.1 Test Data Generation
We require data to test
the FDLS algorithm. This is generated synthetically.
Consider a system
B
ð
z
Þ
A
ð
z
Þ
;
H
ð
z
Þ¼
ð
4
:
47
Þ
where B
ð
z
Þ
and A
ð
z
Þ
are chosen as in (4.44) and (4.45) and output y
k
is obtained
using (4.46). The gain A
i
and the phase shift
i
of the system at a specific frequency
f , as required in (4.36) to (4.42), are obtained by choosing the frequency f
i
then
generating a sequence u
k
as follows:
fi
N
is the normalised frequency
u
k
¼
cos
ð
2
f
n
k
Þ
where
f
n
¼
:
ð
4
:
48
Þ
The system is excited by u
k
and for k
>
1000 we obtain the DFT for the sequences
u
k
and y
k
as
U
¼
DFT
ð
u
k
w
k
Þ;
ð
4
:
49
Þ
Y
¼
DFT
ð
y
k
w
k
Þ;
ð
4
:
50
Þ
where w
k
is a time-domain weighting sequence known as a Hamming window and
given by
8
<
;
46 cos
k
N
:
54
þ
0
:
j
k
j
N
;
0
w
k
¼
ð
4
:
51
Þ
:
0
;
j
k
j >
N
:
Notice that
the arrays U and Y are vectors with complex elements. Let
U
¼½
U
1
; ...;
U
N
. Since we know that the signal is a pure sinusoid, there will be
a dominant peak in the spectrum. Hence the element of U whose magnitude is
maximum is computed and the index where this maximum occurs is defined as j.
Thus j
¼
arg max
j
U
l
j
for 1
l
N. Then we have
A
i
u
¼j
U
j
j;
ð
4
:
52
Þ
i
u
¼
phase
ð
U
j
Þ:
ð
4
:
53
Þ
Similarly, from the complex vector Y we can obtain A
i
y
and
i
y
. Now we generate the
desired data as
A
i
y
A
i
u
;
A
i
¼
ð
4
:
54
Þ
i
i
i
u
¼
y
:
ð
4
:
55
Þ
Search WWH ::
Custom Search