Measuring device and method for measuring relative phase shifts of digital signals

Information

  • Patent Grant
  • 7945406
  • Patent Number
    7,945,406
  • Date Filed
    Friday, September 8, 2006
    18 years ago
  • Date Issued
    Tuesday, May 17, 2011
    13 years ago
Abstract
M periods of the test signal and of the reference signal are received. The periods of the test signal and of the reference signal are in each case Tsig long. The test signal is sampled with N sampled values at a sampling frequency fs=1/Ts. Also, N*Ts=M*Tsig, where N>M. The sampled values are numbered progressively by n, for which 0≦n ≦N−1. The sampled values have a defined relative phase shift with respect to the reference signal. The phase shift Tφ is calculated by
Description
PRIORITY

This application claims priority from German Patent Application No. DE 10 2005 043 208.5, which was filed on Sep. 9, 2005, and German Patent Application No. DE 10 2005 044 194.7, which was filed on Sep. 15, 2005, and are incorporated herein by reference in their entirety.


TECHNICAL FIELD

The invention relates to a measuring device and method for measuring relative phase shifts of digital signals.


BACKGROUND

During digital real-time signal analysis in the time domain it is important to know the phase shift of the signal to be tested with respect to the reference signal. Deviations in the phase shift between these two signals lead to reduced accuracy in the determination of the signal parameters.


The relative phase shift of signals is the phase difference, that is to say the time displacement, of the signals in relation to one another. From Tietze U., Schenk Ch. “Halbleiter-Schaltungstechnik” [Semiconductor Circuit Engineering], 10th edition, p. 956, it is known to detect the phase by means of a sample and hold element, by the voltage of a signal at the time of the zero crossing of a reference signal being switched to a capacitor and the voltage on the capacitor indicating a measure of the phase.


A measurement of the relative phase shift of digital signals by using a capacitor, which represents a delay element, would slow the measurement at high frequencies, for example in the range from 1 MHz to 10 MHz, and the measurement would not be able to be performed in real time. In addition, during the measurement of relative phase shifts of digital signals with such high frequencies, a high sampling rate and, at the same time, a good resolution are required. At a signal frequency of 10 MHz and a required 1000 sampled values per period, the sampling frequency would have to be 1000*10 MHz=10 GHz. Such a high sampling frequency cannot be implemented in many applications.


SUMMARY

In a measuring device and in a method with which the relative phase shift between two digital signals is measured in real time, even if the signals exhibit high frequencies, firstly M periods of the test signal and M periods of the reference signal are received. The period length of the test signal and the period length of the reference signal are respectively Tsig, and M is a natural number greater than 1. The test signal is not present as a continuous function but as a sequence of equidistant sampled values. In order to achieve a predefined accuracy of the analysis, a minimum number of the sampled values per test signal period may be required.


The test signal can be sampled with N sampled values. The sampled values can be synchronized with the reference signal, that is to say they have a defined relative phase shift in relation to the reference signal. The time interval of the sampled values is given by the sampling frequency fs, which is equal to 1/Ts. The number of sampled values N can be chosen such that N*Ts=M*Tsig. Here, N is a natural number greater than M. The sampled values can be numbered by means of the value n. n can be incremented by 1 in each case in the range 0≦n≦N−1, beginning at zero.


The relative phase shift Tφ between the test signal and the reference signal can be calculated by means of the term










i
=
0


M
-
1








Idk


(
i
)



+

K
.






Here, K is a constant and Idx(i) is the number n of that sampled value which is the first sampled value after the zero crossing of the test signal in the ith period of the reference signal. The periods can be incremented from 0 up to and including M−1. During the zero crossings, either only the rising or only the falling zero crossings can be taken into account. Rising zero crossings will also be designated positive zero crossings and falling zero crossings will also be designated negative zero crossings in the following text.





BRIEF DESCRIPTION OF THE DRAWINGS

The invention is illustrated in more detail in the drawings, using an exemplary embodiment.



FIG. 1 shows the distribution of the sampled values over M periods of a test signal.



FIG. 2 shows a sinusoidal test signal and a sinusoidal reference signal, which are connected to the inputs of a measuring circuit.



FIG. 3 shows a testing device having a measuring device.



FIG. 4 shows details of the measuring device from FIG. 3.





DETAILED DESCRIPTION

The N sampled values are distributed over the number of periods of the test signal received. It can be therefore advantageously possible to operate with a low sampling frequency and nevertheless to achieve the required time resolution. For instance, if a sampling circuit is available which is capable of sampling a signal at a maximum of 350 MHz, then N=1000 sampled values can be distributed over at least 10 GHz/350 MHz=28.57 periods. The number of periods M must be integral. Therefore, M=29 would be chosen in this example. The N sampled values of the sinusoidal test signal are distributed over M periods so that, for one data set, M measurements are available, from whose average the phase shift is determined. As a result, the susceptibility to noise can be reduced sharply. By means of a suitable choice of M, signals with any desired high virtual sampling rate can be processed.


In this case, the term










i
=
0


M
-
1








Idk


(
i
)



+
K





indicates the computational rule, using which the relative phase shift between the test signal and the reference signal can be determined. In order to distribute the sampled values to a plurality of periods, it is necessary for the test signal and the reference signal to be periodic. The use of a low-frequency sampling rate permits the use of simple and therefore also inexpensive measuring devices, for example for the generation of the sampling frequency. If no devices for sampling with a very high sampling frequency are available, the measurement of the phase shift of test signals with high frequencies is made possible only by the distribution of the sampled values to a plurality of periods.


The number of sampled values n can be incremented from 0 up to and including N−1, which means that frequent resetting of a counter needed for the incrementing is avoided. The synchronization of the sampling with the reference signal is complicated and should therefore be carried out only as often as necessary.


The values Idx(i) can be read during the M periods of the test signal and are therefore available in real time.


The real sampling rate for this configuration is still only fs=fsig*N/M=344.828 MHz. Here, fsig=1/Tsig. If the sampled values lying on M=29 periods are re-sorted to a single period, a virtual sampling frequency of fs=N*fsig=10 GHz is obtained.


The number of sampled values N and the number of received periods M are preferably relatively prime, that is to say are coprime.


If, on the other hand, M and N have a common divider, then some of the samples are simply repetitions of other sampled values. For instance, if M=2 and N=12, then 256 values of the test signal are sampled twice successively. In this case, although the second set of 256 samples samples the second period, it is given the same values as during the sampling of the first period. The second set of samples consequently provides no gain in information. Such unnecessary samples are avoided by the provision of coprime values M and N.


In one embodiment, the constant K is calculated by means of the term (NM)−N+M. Thus, K can be calculated independently of the periods Tsig and Ts. The relative phase shift Tφ is preferably calculated by means of one of the formulas















T
Φ


T
sig


=


1
N



(





i
=
0


M
-
1








Idx


(

i
+

)



-



NM
-
N
+
M

2

±

1
2



)



,








T
Φ


T
sig


=


1
N



(





i
=
0


M
-
1








(


Idx


(

i
+

)


-

N
2


)


+



N
-
M

2

±

1
2



)











T
Φ


T
s


=


1
M



(





i
=
0


M
-
1








Idx


(

i
+

)



-



NM
-
N
+
M

2

±

1
2



)



,








T
Φ


T
s


=


1
M



(





i
=
0


M
-
1








(


Idx


(

i
+

)


-

N
2


)


+



N
-
M

2

±

1
2



)











T
Φ


T
vs


=


(





i
=
0


M
-
1








Idx


(

i
+

)



-



NM
-
N
+
M

2

±

1
2



)






or














T
Φ


T
vs


=

(





i
=
0


M
-
1








(


Idx


(

i
+

)


-

N
2


)


+



N
-
M

2

±

1
2



)

















Idx(i+) designates the numbers of the sampling points immediately after the zero crossing of the rising flank. The formulas in each case specify the upper and the lower limit of a range in which the value for the normalized phase shift is located.


The formulas are derived in that, firstly, a periodic continuous test signal having M periods is considered. Let the time displacement of the test signal with respect to a reference signal be Tφ. The time interval between two positive zero crossings of the test signal is equal to the period Tsig. The times at which the rising test signal intersects the zero line are designated T0i. If the M times are added to the positive zero crossings T0i, the result is
















i
=
0


M
-
1








T

0

i



=




i
=
0


M
-
1








(


T
Φ

+

iT
sig


)









=


MT
Φ

+


T
sig





i
=
0


M
-
1















i
=


MT
Φ

+


T
sig



1
2



M


(

M
-
1

)











(
2.1
)







If






(
2.1
)






is





rearranged





for






T
φ


,

the





result






is
:














T
Φ

=



1
M






i
=
0


M
-
1








T

0

i




-


T
sig





M
-
1

2

.







(
2.2
)







For phase compensation, it can be beneficial to relate the time displacement Tφ to the sampling time Ts=1/fs, which specifies the time interval between two sample values.











T
Φ


T
s


=



1
M






i
=
0


M
-
1









T

0

i



T
s




-



T
sig


T
s





M
-
1

2







(
2.3
)







The sampling time and the period of the test signal are linked with one another via the ratio between the number of sampled values N and the number of periods M.










NT
s

=



MT
sig




T
sig


T
s



=

N
M






(
2.4
)







If the ratio from (2.4) is inserted into (2.3), then the final result is











T
Φ


T
s


=



1
M






i
=
0


M
-
1









T

0

i



T
s




-


N
M




M
-
1

2







(
2.5
)








By using the shortened form










Idx


(
i
)


=


T

0

i



T
s






(
2.6
)








the following is obtained:











T
Φ


T
s


=




1
M






i
=
0


M
-
1








Idx


(
i
)




-


N
M




M
-
1

2



=


1
M




(





i
=
0


M
-
1








(


Idx


(
i
)


-

N
2


)


+

N
2


)

.







(
2.7
)







If the phase shift is normalized to the signal frequency Tsig, the formula results as:














T
Φ


T
sig


=



1
N






i
=
0


M
-
1




Idx


(
i
)




-


M
-
1

2













=


1
N



(





i
=
0


M
-
1




(


Idx


(
i
)


-

N
2


)


+

N
2


)










(
2.8
)








The accuracy of the method can be determined by means of the determination of the error. If the first zero crossing of the rising flank is located exactly at an integer multiple of the sampling time, then for this time period it is true that:

T00=kTsk∈N  (3.1)


However, if the zero crossing is located between two sampled values, then a positive value less than 1 still has to be taken into account.

T00=(k+α)Ts=α·Ts+kTs0<α<1  (3.2)

The second zero crossing takes place one period later.













T
01

=


α
·

T
s


+

kT
s

+

T
sig








=


α
·

T
s


+

kT
s

+



T
sig


T
s




T
s









=


α
·

T
s


+

kT
s

+


N
M



T
s










(
3.3
)








For the ith zero crossing it is then true that:










T

0

i


=


α
·

T
s


+

kT
s

+



i





N

M



T
s







(
3.4
)







When summing the times, only the indices of the sampled values are added. This means that only integer multiples of the sampling time Ts are taken into account
















i
=
0


M
-
1





T

0

i



T
s



=





i
=
0


M
-
1




(

k
+

Int


(

α
+


i





N

M


)



)


+
ɛ







=





i
=
0


M
-
1




Idx


(
i
)



+
ɛ








(
3.5
)







The operator Int(X) supplies the integer component of the floating-point number X. The unconsidered sum of the remainders leads to an error ε. The remainders are formed by the modulo operator.









ɛ
=




i
=
0


M
-
1





mod


(



M





α

+

i





N


,
M

)


M






(
3.6
)








Since N and M are coprime, their ratio is not an integer. N may be broken down into the sum of a multiple of M and a remainder.

iN=αiM+bi  (3.7)
mod(iN,M)=bi  (3.8)

Since M and N are relatively prime, the coefficients bi run through all values from 0 to M−1.


The expression M α, can also be broken down into an integer and a fractional component.

Mα=cM+β with 0≦β<1  (3.9)

From the relationship β<1 it follows that the sum of β and bi is smaller than M for all i.

bi+β<M ∀i with 0≦i<M−1  (3.10)
and thus
mod(Mα+iN, M)=mod(Mα,M)+mod(iN, M)=βbi  (3.11)

This means that a displacement of the test signal by α does not manifest itself in the integer sum of the zero crossings. For the sum of the remainders, the following is thus obtained:












ɛ
=




i
=
0


M
-
1





β
+

b
i


M













=




i
=
0


M
-
1





β
+
i

M














=

β
+


1
M



1
2



M


(

M
-
1

)












(
3.12
)






ɛ
=

β
+


M
-
1

2






(
3.13
)







When forming the integer values, there is the possibility of using the points immediately before the zero crossings or the points immediately after the zero crossings.


When the sampled values before the zero crossing are chosen, the integer is formed by rounding down. This is achieved by means of the floor() operator, which always rounds to the next smaller whole number. In this case, the sum over the integer indices is too small. The result still has to be corrected upward by the components of the remainders. For the ith zero crossing it is then true that:














T

0

i



T
s


=

k
+

floor


(

α
+


i





N

M


)


+


mod


(



M





α

+

i





N


,
M

)


M













=


Idx


(

i
-

)


+


mod


(



M





α

+

i





N


,
M

)


M










(
3.14
)








Idx(i) designates the indices of the sampling points immediately before the zero crossing of the rising flank. The following is therefore obtained for the sum of the zero crossings:
















i
=
0


M
-
1





T

0

i



T
s



=




i
=
0


M
-
1




(


Idx


(

i
-

)


+


mod


(



M





α

+

i





N


,
M

)


M


)








=





i
=
0


M
-
1




Idx


(

i
-

)



+
β
+


M
-
1

2









(
3.15
)








If this relationship is taken into account in (2.7), the following is obtained:











T
Φ


T
s


=


1
M



(





i
=
0


M
-
1




(


Idx


(

i
-

)


-

N
2


)


+

N
2

+
β
+


M
-
1

2


)






(
3.16
)







When the sampled values before the zero crossing are chosen, the integer is formed by rounding up. This is achieved by means of the ceil() operator, which always rounds up to the next larger number. In this case, the sum over the integer indices is too large. The result still has to be corrected downward by the components of the fractional terms. For the ith zero crossing it is then true that:














T
Φ


T
s


=

k
+

ceil


(

α
+


i





N

M


)


-

(

1
-


mod


(



M





α

+

i





N


,
M

)


M


)








=


Idx


(

i
+

)


-

(

1
-


mod


(



M





α

+

i





N


,
M

)


M


)









(
3.17
)








The following is therefore obtained for the sum of the zero crossings:
















i
=
0


M
-
1





T

0

i



T
s



=




i
=
0


M
-
1




(


Idx


(

i
+

)


-

(

1
-


mod


(



M





α

+

i





N


,
M

)


M


)


)








=





i
=
0


M
-
1




Idx


(

i
+

)



-

(

M
-

(

β
+


M
-
1

2


)


)








=





i
=
0


M
-
1




Idx


(

i
+

)



+

(

β
-


M
+
1

2


)









(
3.18
)








If this is taken into account in (2.7), the following is obtained:











T
Φ


T
s


=


1
M



(





i
=
0


M
-
1




(


Idx


(

i
+

)


-

N
2


)


+

N
2

+
β
-


M
+
1

2


)






(
3.19
)







The total error is composed of the influence of the fractional terms and the phase shift between two sampling points. The first can be determined exactly, while the second can be specified only within a fixed range. Both in (3.16) and in (3.19), the correction factor β−½ occurs. Since β lies between 0 and 1, this expression can be specified as a variable error |±β/2|≦|±½|.











T
Φ


T
s


=


1
M



(





i
=
0


M
-
1




(


Idx


(

i
-

)


-

N
2


)


+



N
+
M

2

±

1
2



)






(
3.20
)








T
Φ


T
s


=


1
M



(





i
=
0


M
-
1




(


Idx


(

i
+

)


-

M
2


)


+



N
-
M

2

±

1
2



)






(
3.21
)







Further evaluation formulas for the indices of the sampling points immediately after the zero crossing of the rising flank result from transforming equation (3.21).


In the case of normalizing to the signal period Tsig, the result is:











T
Φ


T
sig


=


1
N



(





i
=
0


M
-
1




Idx


(

i
+

)



-



NM
-
N
+
M

2

±

1
2



)






(
4.1
)








T
Φ


T
sig


=


1
N



(





i
=
0


M
-
1




(


Idx


(

i
+

)


-

N
2


)


+



N
-
M

2

±

1
2



)






(
4.2
)







On the other hand, in the case of normalizing to the sampling time








T
s

=


M
N



T
sig



,





the result is:











T
Φ


T
s


=


1
M



(





i
=
0


M
-
1




Idx


(

i
+

)



-



NM
-
N
+
M

2

±

1
2



)






(
4.3
)








T
Φ


T
s


=


1
M



(





i
=
0


M
-
1




(


Idx


(

i
+

)


-

N
2


)


+



N
-
M

2

±

1
2



)






(
4.4
)








Normalizing to the virtual sampling time







T
vs

=



1
M



T
s


=


1
N



T
sig








gives:











T
Φ


T
vs


=

(





i
=
0


M
-
1




Idx


(

i
+

)



-



NM
-
N
+
M

2

±

1
2



)





(
4.5
)








T
Φ


T
vs


=

(





i
=
0


M
-
1




(


Idx


(

i
+

)


-

N
2


)


+



N
-
M

2

±

1
2



)





(
4.6
)







For the measurement error F, based on the signal frequency fsig,






F
|



1

2

N








is consequently true. The result is therefore available with a defined accuracy. The accuracy can be increased by increasing the sampled values N.


The value n at the time of the zero crossing of the reference signal in that period in which i=0 is preferably set to zero and is thus synchronized. This simplifies the calculation, since Idx(i) is thus in each case based on the zero crossing of the reference signal and, during the calculation of the relative phase shift, the phase difference between the zero crossings of the test signal and the zero crossing of the reference signal is calculated directly. The method is particularly suitable in the case of sinusoidal test signals and sinusoidal reference signals. In these, the zero crossing is particularly well suited for the measurement, while minima and maxima are difficult to detect. At the maximum and at the minimum, the derivative is 0, and thus the sensitivity is low. Measuring the maximum and the minimum would therefore be very susceptible to noise.


The invention also relates to a measuring device for measuring the relative phase shift between a periodic digital test signal and a periodic digital reference signal. The measuring device contains an input connection for receiving a test signal and an input connection for receiving a reference signal.


Furthermore, a sampling unit is provided, which samples M periods of the test signal. To this end, use is made of N sampled values having a sampling frequency fs=1/Ts. The sampled values are synchronized in time with the reference signal, that is to say they have a fixed phase relationship relative to the reference signal.


In this case, it is true of the ratio of N and M that N*Ts=M*Tsig. Tsig is equal to the period of the test signal and equal to the period of the reference signal. M is a natural number greater than 1, and N is a natural number greater than M. The sampling unit has a counter which counts the number n of the sampled values progressively from 0 to N−1 and of which the counter reading indicates the number n of sampled values. Here, 0≦n≦N−1. The N sampled values are thus distributed over a plurality of periods of the test signal. As a result, it is advantageously possible to sample with a low sampling frequency fs, which makes the measuring method simpler and thus less expensive.


The testing device also has a calculation unit, which calculates the phase shift Tφ between the test signal and the reference signal by using the term










i
=
0


M
-
1




Idx


(
i
)



+

K
.





K is a constant and Idx(i) corresponds either to the counter reading at the time of the first sampled value after a zero crossing of the test signal during the ith period of the reference signal or the counter reading at the time of the last sampled value before a zero crossing of the test signal during the ith period of the reference signal. In this case, either only rising or only falling zero crossings are taken into account.


The measuring device is able to determine the relative phase shift with a simple computational rule. In this case, the counter is reset to zero again only after the value N−1 has been reached, since resetting is complicated.


M and N preferably are coprime, in order to avoid simple repetitions of samples.


In one embodiment of the measuring device, K is determined by means of the term (N*M)−N+M, by which means K is determined independently of Tsig and Ts. Tsig and Ts are generally not integers and are therefore not very suitable for further digital processing. Tφ can also be calculated by means of one of the formulas












T
ϕ


T
sig


=


1
N



(





i
=
0


M
-
1








Idx


(

i
+

)



-



NM
-
N
+
M

2

±

1
2



)



,








T
ϕ


T
sig


=


1
N



(





i
=
0


M
-
1




(






Idx


(

i
+

)


-

N
2


)


+



N
-
M

2

±

1
2



)











T
ϕ


T
s


=


1
M



(





i
=
0


M
-
1








Idx


(

i
+

)



-



NM
-
N
+
M

2

±

1
2



)



,








T
ϕ


T
s


=


1
M



(





i
=
0


M
-
1




(






Idx


(

i
+

)


-

N
2


)


+



N
-
M

2

±

1
2



)











T
ϕ


T
vs


=

(





i
=
0


M
-
1








Idx


(

i
+

)



-



NM
-
N
+
M

2

±

1
2



)


,








T
ϕ


T
vs


=

(





i
=
0


M
-
1




(






Idx


(

i
+

)


-

N
2


)


+



N
-
M

2

±

1
2



)









where Tvs=Ts/M and Idx(i+) is the number n of that sampled value which is the first sampled value after a positive zero crossing of the test signal during the ith period of the reference signal. It is also possible to calculate the relative phase shift by means of a transformation of one of the above formulas, for example by the negative zero crossings being used as reference points.


The measurement error is noted during the measurement by means of the method according to the invention and, during the measurement of the value, is









T
ϕ


T
sig




:




F






1

2

N


.





The counter reading of the counter at the time of the zero crossing of the reference signal in the first period, which is defined by i=0, is preferably set to zero. As a result, the value for the relative phase shift, based on the zero crossings of the test signal and of the reference signal, can be determined directly from one of the abovementioned formulas.


The measuring device is particularly well suited as part of a BIST (built in self test), since it can be implemented by a simple and thus space-saving hardware implementation. The measuring device can be constructed as part of a phase correction circuit, which permits high resolution even at high test frequencies.



FIG. 1 shows, in two graphs, test signals with sampled values. In both graphs, in each case the amplitude of the test signal for three periods is plotted against a normalized time. The time in this case is based on the period of the test signal Tsig. The amplitude of the sinusoidal test signal has values in the range [−1; +1]. The periods are identified by means of the value i, which numbers the periods from 0 to 2.


For each period, the test signal is sampled 20 times in the upper graph. The sampled values are in each case identified by the circles with associated numbers 0 to 19. The sampling frequency fs is 20/Tsig.


In the lower graph, the same test signal is shown as in the upper graph. However, the graphs differ with regard to the sampling. As compared with the upper graph, sampling points have been removed, so that there are now only N=20 sampling points, which are distributed over the M=3 periods. The number of sampled values is designated N, and the number of sampled periods is M. The sampling frequency fsis thus 20/(3*Tsig). In the upper graph, the sampled values are repeated from period to period. In the lower graph, the 20 sampled values are all different, since the number of sampled values N and the number of periods M are prime in relation to each other.



FIG. 2 shows a test signal and a reference signal, as applied to a testing device according to the invention. The reference signal is represented by means of the continuous curve, while the test signal is depicted by means of the dashed curve. The amplitude of the reference signal and the amplitude of the test signal are plotted against the time t/Tsig normalized with respect to the period of the test signal Tsig.


The test signal is sampled with 20 sampled values. The sampled values are identified progressively with 0 to 19, the sampled value 0 being read at the time of the zero crossing of the reference signal. Two sampled values following each other have a time interval of Ts/Tsig. The reference signal has a positive zero crossing at t/Tsig =0. In the present example, the test signal is displaced by Tφ=Tsig/7=0.14*Tsigwith respect to the reference signal. The numbers on the markings represent the indices of the sampled values. Counting begins with the first zero crossing of the reference signal. In order to determine the phase shift, the indices of the M sampled values which directly follow a positive zero crossing are used. These indices are designated Idx(i+).


The phase shift Tφ/Tsig is obtained in the form of a time normalized to the signal frequency by the sum being formed via the above-described M indices, the result being divided by the number N of sampled values and a constant being subtracted. The corresponding formula is








T
ϕ


T
sig


=


1
N




(





i
=
0


M
-
1








Idx


(

i
+

)



-



NM
-
N
+
M

2

±

1
2



)

.







The phase shift determined from the indices of the sampled values is given in this way as:











T
ϕ


T
sig


=



1
20



(

1
+
8
+
15

)


-




20
·
3

-
20
+
3


2
·
20


±

1

2
·
20










=



24
20

-


43
40

±

1
40



=


5
40

±

1
40











If the phase shift is specified in fractions of the period Tsig, this leads to







4
40




T
ϕ


T
sig





6
40






0.1




T
ϕ


T
sig




0.15
.






If the phase shift is specified in fractions of the sampling time Ts, this leads to






0.667



T
ϕ


T
s




1.0
.






FIG. 3 shows a testing device in which a measuring device according to the invention is used. A testing device 1 contains offset correction 2, phase detection 3, amplitude correction 4, phase correction 5, a differential element 6 and noise analysis 7.


The offset correction 2 receives a test signal, while the amplitude correction 4 receives a reference signal. The test signal and the reference signal are time-discrete signals and the test signal is a digitized analog signal. The test signal and the reference signal are both sinusoidal. The offset correction outputs an offset-free test signal to the phase detection 3 and the amplitude correction 4. In the offset correction 2, the DC component of the signal is determined and subtracted from the test signal, so that an average-free signal is produced.


The phase detection 3 also receives the reference signal 4 and contains a measuring device according to the invention for determining a relative phase shift. In this case, the phase shift between the offset-free test signal and the reference signal is determined. In the amplitude correction 4, the amplitude of the reference signal is matched to the amplitude of the test signal.


The amplitude correction 4 outputs an amplitude-corrected reference signal which, in the phase correction 5, has its phase changed on the basis of the output value from the phase detection and is output to the inverting input of the differential element 6. In the phase correction 5, the phase shift of the reference signal is matched to the phase shift of the test signal.


After the amplitudes and the phases have been matched to those of the test signal and of the reference signal, the difference between the two signals is formed in the differential element 6. The difference signal at the output from the differential element 6 then contains only the noise components of the test signal. In the noise analysis 7, the input of which is connected to the output of the differential element 6, the noise signal is analyzed and the result of the analysis is output.


The accuracy of the noise analysis depends substantially on the quality of the noise signal. If the phase shift between the two signals has not been compensated for completely, the noise signal still contains components of the test signal, which results in an erroneous determination of the signal to noise ratio.


The testing device 1 determines the signal to noise ratio of the test signal. The evaluation is carried out in real time in the time domain. The advantage of this procedure consists firstly in the fact that the evaluation can be carried out extremely quickly in real time and secondly in the fact that the device can be integrated into a semiconductor module in the form of a BIST. It exhibits a very simple hardware implementation, which demands only a few resources and is thus particularly well suited to a BIST implementation.



FIG. 4 shows details of the phase detection 3 in a schematic representation. The phase detection 3 contains a delay element 31, a first comparator 32, a second comparator 33, a sample counter 34, an AND gate 36, a first store 35, a second store 37, an adder 38 and an output flip-flop 39.


The offset-free and time-discrete test signal is led to the delay element 31 and to the second comparator 33. The delay element 31 also receives a sampling clock and, at its output, outputs a delayed, offset-free test signal to the first comparator 32.


The outputs from the first comparator 32 and from the second comparator 33 are led to the inputs of the AND element 36, of which the output is connected to the enable signal of the adder 38. The sample counter 34 receives the cycle start signal on its Reset input and outputs the sampling clock at its clock input. The sample counter 34 outputs the counter reading to the In input of the adder 38. The first store 35 contains the value for −N/2 and is connected to the Offset input of the adder 38. The second store 37, on the other hand, contains the value (N−M)/2, which is connected to the Init input of the adder 38.


The adder 38 additionally receives the cycle start signal, which is generated from the reference signal by a circuit not shown here and which, in addition, is led to the First input of the adder 38 and to the Enable input of the output flip-flop 39.


The time-discrete test signal Sn is fed in on the upper input path. The test signal passes through two paths. The first path leads into the delay element 31, in which the test signal Sn is delayed by one sampling cycle.


After that, the delayed test signal Sn−1 is led to the first comparator 32, which checks whether the delayed test signal Sn−1 has a negative amplitude.


The second path leads directly to the second comparator 33, which checks whether the test signal has a non-negative amplitude. The results of the comparisons are fed to a logic AND element.


If both comparisons turn out to be positive, then the zero crossing of a rising flank has been detected. On the other hand, if the output from the AND element 36 is positive, then the data input of the adder 38 is activated.


The sampling clock in the lower signal path drives both the delay element 31 and a sample counter 34 as well as the adder 38. With each clock signal, the counter reading of the sample counter 34 is increased by one.


If the data input In of the adder 38 is activated by the signal on the Enable input, then the counter reading is added to the current value in the adder 38, taking the offset into account.


If the cycle start signal is activated, the current sum is output by the adder 38 to the output flip-flop 39 and the adder 38 is re-initialized with the Init value. With the cycle start, the sample counter 38 is also reset to zero. If the sampled values are distributed over M periods, then the error limit, based on the sampling rate fs, is






±


1

2

M


.





The exemplary embodiment is an advantageous hardware depiction of the formula (4.6). It exhibits a very simple hardware implementation, which demands only a few resources and is thus particularly well suited to a BIST implementation. In this example, it should be emphasized in particular that neither multipliers nor dividers are needed for the implementation.


By means of the transformations according to formulas 4.1 to 4.5, further advantageous hardware implementations can be obtained.


In summary, it is possible to state that a method and an algorithm are described which make it possible to use a periodic digitized analog signal, such as a sinusoidal signal, to determine the phase shift with respect to a reference signal in the time domain in real time with the maximum time resolution.


LIST OF DESIGNATIONS




  • 1 Testing device


  • 2 Offset correction


  • 3 Phase selection


  • 4 Amplitude correction


  • 5 Phase correction


  • 6 Differential element


  • 7 Noise analysis


  • 31 Delay element


  • 32 First comparator


  • 33 Second comparator


  • 34 Sample counter


  • 35 First store


  • 36 AND gate


  • 37 Second store


  • 38 Adder


  • 39 Output flip-flop


Claims
  • 1. A method for measuring a relative phase shift between a periodic digital test signal and a periodic digital reference signal, the method comprising: receiving at a sampling unit M periods of the test signal and M periods of the reference signal, each of the M periods of both the test signal and the reference signal having a period length Tsig, M being a natural number greater than 1;sampling, by the sampling unit, the test signal to generate N sampled values at a sampling frequency fs=1/Ts, whereby Ts, is a period such that Ts=(M*Tsig)/N, N being a natural number greater than M;assigning each of the sampled values a different index value n, for which 0≦n≦N−1;calculating, by a calculation unit, a relative phase shift Tφbetween the test signal and the reference signal based on a value
  • 2. The method according to claim 1, in which M and N are coprime with respect to each other.
  • 3. The method according to claim 1, wherein at least one of the formulas is true:
  • 4. The method according to claim 1, in which the index value n is set to zero at the time of the zero crossing of the reference signal during one of the periods of the reference signal in which i=0.
  • 5. The method according to claim 1, in which the test signal and the reference signal are each a sinusoidal signal.
  • 6. The method according to claim 1, in which, following the calculation of the relative phase shift Tφ, the phase of the test signal is changed and the relative phase shift Tφof test signal and reference signal is then measured again.
  • 7. The method according to claim 1, in which the received test signal is a digitized analog signal.
  • 8. The method of claim 1, wherein the zero crossings are only rising zero crossings and not falling zero crossings.
  • 9. The method of claim 1, wherein the zero crossings are only falling zero crossings and not rising zero crossings.
  • 10. A measuring device for measuring the relative phase shift between a periodic digital test signal and a periodic digital reference signal, the measuring device comprising: an input connection configured to receive a test signal;an input connection configured to receive a reference signal;a sampling unit configured to sample M periods of the test signal so as to generate N sampled values at a sampling frequency fs=1/Ts, where Ts is a period such that Ts=(M*Tsig) /N and Tsig is a period length of the test signal and a period length of the reference signal, M being a natural number greater than 1 and N being a natural number greater than M, wherein the sampling unit comprises a counter configured to indicate a different index number n to each of the sampled values, where 0<n<N−1, the sampled values being synchronized with respect to the reference signal;a calculation unit configured to determine a relative phase shift Tφbetween the test signal and the reference signal based on a value
  • 11. The measuring device according to claim 10, in which Tφis calculated by means of one of the formulas
  • 12. The measuring device according to claim 10, in which M and N are coprime.
  • 13. The measuring device according to claim 10, in which the counter reading of the counter is set to zero at the time of the zero crossing of the reference signal during one of the periods of the reference signal in which i=0.
  • 14. The measuring device according to claim 10, the measuring device being constructed as part of a built in self test (BIST).
  • 15. The measuring device according to claim 10, which is constructed as part of a phase correction circuit.
  • 16. The measuring device of claim 10, wherein the zero crossings are only rising zero crossings and not falling zero crossings.
  • 17. The measuring device of claim 10, wherein the zero crossings are only falling zero crossings and not rising zero crossings.
  • 18. A measuring device comprising: an input connection configured to receive a test signal;an input connection configured to receive a reference signal;a sampling unit configured to sample M periods of the test signal so as to generate N sampled values at a sampling frequency fs =1 Ts, where Ts is a period such that Ts=(M* Tsig) /N and Tsig is a period length of the test signal and a period length of the reference signal, M being a natural number greater than 1 and N being a natural number greater than M, wherein the sampling unit comprises a counter configured to indicate a different index number n of each of the sampled values, where 0<n<N−1, the sampled values being synchronized with respect to the reference signal;a calculation unit configured to determine a relative phase shift Tφbetween the test signal and the reference signal based on a value
  • 19. The measuring device according to claim 18, at least one of the formulas is true:
  • 20. The measuring device according to claim 18, in which M and N are coprime with respect to each other.
  • 21. The measuring device according to claim 18, in which the value of index number n, as indicated by the counter, is set to zero at the time of the zero crossing of the reference signal of one of the periods of the reference signal in which i=0.
  • 22. The measuring device according to claim 18, wherein the measuring device is part of a built in self test (BIST).
  • 23. The measuring device according to claim 18, wherein the measuring device is part of a phase correction circuit.
  • 24. The measuring device of claim 18, wherein the zero crossings are only rising zero crossings and not falling zero crossings.
  • 25. The measuring device of claim 18, wherein the zero crossings are only falling zero crossings and not rising zero crossings.
Priority Claims (2)
Number Date Country Kind
10 2005 043 208 Sep 2005 DE national
10 2005 044 194 Sep 2005 DE national
US Referenced Citations (5)
Number Name Date Kind
5535252 Kobayashi Jul 1996 A
5874725 Yamaguchi Feb 1999 A
6028503 Preishuberpflugl et al. Feb 2000 A
7046298 Kuzumoto et al. May 2006 B2
7149269 Cranford et al. Dec 2006 B2
Foreign Referenced Citations (1)
Number Date Country
19630917 Mar 1998 DE
Related Publications (1)
Number Date Country
20070226602 A1 Sep 2007 US