2. How to Calculate the Data
Step 1: Perform a Forward DFT
If the data is real valued, then its transform has
complex-valued Hermitian symmetry in the spec-
tral domain, so we only need to save the positive
part of the transformed data. For complex-valued
Time Domain data, this step is optional if the integer portion of
the number of cycles in the capture M is known
DFT
(7.75 in this example).
Step 2: Locate the Fundamental Bin M 0
The DFT will round this number to the closest inte-
0 ger (8 in this example).
Frequency Domain
Step 3: Perform Inverse DFT
DFT−1
For real-valued original data, perform an inverse
Fourier transform on the positive half of the previ-
ous transform to obtain an N/2 complex-valued
data set in the same domain as the original data.
This new set of data contains all the information of
the original data set. For complex-valued data, skip
this step and use the original data instead. Save this
data set for later use.
Time Domain
Step 4: Demodulate by Waveform of M 0 Periods
Multiply each complex-valued sample by complex
function
M0
e−j2π N
i
Only the fractional period remains in the waveform
I after this operation (–0 .25 in this example). Only
R
the phase of each sample has been changed; the
amplitude is unchanged.
tan−1
Step 5: Compute the Phase
The simplest version just needs the phase at the
ϕ beginning and the end of the waveform while the
phase of each sample will be needed if a linear
regression method will be used. The phase of a
complex number can be calculated by arctangent
function. Most of the math library resources use the
“atan2” function.
30 IEEE Instrumentation & Measurement Magazine February 2007
3. ϕ Step 6: Calculate the Phase Difference P
∆P and slope P = 2π M1
The phase difference is the fractional portion of the
sine wave’s number of cycles, which is 2π for a
complete cycle of original data (–0 .25 in this exam-
ple); the slope is the remaining frequency of that
fraction. (Remember the signal can be only the half
size if the real-to-complex Fourier transform is
used.)
Time Domain
Step 7: Application of Complex Window Function
I This step is a signal twiddle operation by fraction
R
portion of M cycles (0.25 in this example). Simply
multiply each complex-valued i th sample saved at
Step 3 by
e−j2π
P
N
i
At this point, there will be exactly an integer num-
ber of periods in the data set. (8 in this example).
Final Step: Perform a Complex-Valued Fourier
Time Domain Transform
DFT
The fundamental will be free of leakage in the fre-
quency domain.
0
Frequency Domain
In very rare applications, such as magnetic resonance, we tally in instrumentation and measurement, we need to record
would measure a physical phenomenon, which is represent- a series of samples of that signal, which we refer to as a cap-
ed by complex numbers. Since magnet resonance systems tured waveform. A captured waveform is just the portion of
are so complex, there is even a separate Society within the a signal that we can observe through a rectangular window.
IEEE to deal with those issues. Complex numbers have been As a matter of fact, a rectangular window function is always
more widely used in telecommunication, in which ampli- applied whether intentionally or unintentionally.
tude and phase of the sine wave are modulated. Modern
information coding schemes apply complex numbers to How to Calculate Waveform Data
items we use in our daily life, such as a cell-phone, a wireless The discrete Fourier transform (DFT) is a widely used pow-
LAN, etc. However, we do not realize the fullest potential of erful signal analysis method. The discrete nature of the
complex numbers until we extend the application of com- method implies that the captured waveform being analyzed
plex numbers to window functions in which only real num- is a portion of a periodic signal, and the transform is per-
bers have been traditionally used. formed on a whole period or an integer multiple of periods.
Historians may tell us in which epoch the first building We call this procedure coherent sampling in which, no mat-
window was built by our ancestors. Rectangular windows ter when the capture starts, the end point of the captured
are undoubtedly more ancient than curved windows. The waveform could be connected to the first sample in the cap-
sky and the landscape that we see through a window take the tured waveform in the same fashion as the next noncaptured
shape of the window. We can take this word picture and sample (Figure 1). Thus, the rectangular window will inter-
apply it to a measurement problem. To analyze a signal digi- fere with neither the captured waveform nor the DFT.
February 2007 IEEE Instrumentation & Measurement Magazine 31
4. On the other hand, if we cap- We do not realize the In window functions, the
ture a nonperiodic signal or if we shapes of the windows are
capture a periodic signal without fullest potential of designed in such a way that the
capturing an integer number of height reaches maximum at the
periods, the captured waveform complex numbers until center and gradually reduces to
would be incoherently sampled, we extend their zero towards the edges (Figure 3).
and, consequently, the end point of When this shape is multiplied by a
the captured waveform could not application to window captured signal, no matter what
be connected to the first sample in the original signal looks like, its
the captured waveform in the functions in which only amplitude will progressively
same way as the next noncaptured real numbers have been reduce to zero from the center to
sample (Figure 2). This would sub- the side As a result, the sample at
sequently lead to truncation by the traditionally used. the end could be connected to the
rectangular window, which vio- sample at the beginning in the
lated the condition under which modified waveform in the same
the DFT can be applied. In this situation, a special window way as to the next noncaptured sample if it is considered as
function needs be applied to the captured waveform before a repetition of the first sample in an artificial periodic signal.
applying the DFT. Time-domain multiplication is equivalent to a convolution in
the frequency domain—the convolution created by the
Fourier transform into a window function. The side effect of
this operation is the introduction of an artificial structure to
the original signal being transformed and a reduction of
Rectangular Window spectrum resolution. To minimize this effect, the window
function is also designed in such a way that its first deriva-
tive tends to be zero in the center and at both ends.
Commonly used window functions include the Hamming
window, Hanning window, and Blackman window. Now,
we have witnessed the evolution of window functions from
rectangular shapes to curved shapes.
Like building windows, both the rectangular and curved
windows still share a common planar structure. If our imagi-
nation can stretch beyond this two-dimensional structure,
we can obtain solutions that will not be limited by the shape
Fig. 1. Use of the discrete Fourier transform implies that the captured
waveform being analyzed is a portion of a periodic signal and the transform is
of windows. As an example, add a third dimension. In the
performed on a whole period or an integer multiple of periods. The end point case of window functions, the initial real-valued functions
of the captured waveform (black dot) could be connected to the first sample in
the captured waveform (red square) in the same fashion as the next
noncaptured sample (blue triangle).
Rectangular Window
Window Applied
Fig. 3. When using window functions, the shape of the windows are
designed in such a way that the height reaches maximum at the center and
reduces progressively to zero towards the edges. When this shape is
multiplied by a captured signal, no matter what the original signal looks like,
Fig. 2. If we capture a nonperiodic signal or if we capture a periodic signal its amplitude will progressively reduce to zero from the center to the side. As
without capturing an integer number of periods, then the end point of this a result, the sample at the end (black dot) could be connected to the sample at
incoherently captured waveform (black dot) could not be connected to the first the beginning (red square) in the modified waveform in the same way as to
sample in the captured waveform (red square) in the same way as the next the next noncaptured sample (blue triangle) if it is considered as a repetition
noncaptured sample (blue triangle). of the first sample in an artificial periodic signal.
32 IEEE Instrumentation & Measurement Magazine February 2007
5. versus time will become complex- We have witnessed Conclusions
valued functions versus time. Real- Although this algorithm has
valued window functions are the evolution of window opened a new horizon to solve an
limited to performing amplitude old problem, more research is need-
modulation, whereas complex-val-
functions from ed to provide a more comprehen-
ued window functions have the rectangular shapes to sive understanding as to how FXT
advantage of being able to perform forms a new orthonormal base and
both amplitude and phase modula- curved shapes. how it relates to 3-parameter or 4-
tions. Following this logic, we parameter sine wave fitting methods
should be able to find complex-val- [3], [4]. In the case of a multitone
ued window functions and apply them to noncoherently application or when a sine wave application has a high level of
captured waveforms without the side effects that are associ- harmonic components, will the algorithm published in the orig-
ated with real-valued window functions. inal paper be sufficient or is a better method available?
Such a window function has been found and has been In essence, there is a need to identify other areas where
successfully applied to captured sine waves that include a real values can be replaced by complex values because it
fractional period of a sine wave and it produces no artifacts. may lead to new solutions and ideas. Once these areas have
If the usual direct application of the DFT is applied, it will been identified, we will be confronted with another chal-
result in artifacts, or spectrum leakage. The first application lenge: how should we teach our children to think beyond the
of this complex-valued window function is to test it in high- two-dimensional structure to include the complex number
performance analog-to-digital converters in which frequency dimension when they are learning to count? Would we ask,
error due to limited frequency resolution, or drift of instru- “How many people are there in the picture?” If the response
ment, could cause significant spectrum leakage. The solution is “Two!” then would we ask, “Can you see if there are any
to that problem usually includes either investment of a costly other people behind them?”
high-performance frequency synthesizer or using a high
spectral purity oscillator, the frequency of which could not References
be easily controlled. [1] F.J. Harris, “On the use of windows for harmonic analysis with the
discrete Fourier transform,” Proc. IEEE, vol. 66, pp. 51–83, Jan. 1978.
The Complex-Valued Window Function:
[2] F. Xu “Algorithm to remove spectral leakage, close-in noise, and
Extended Fourier Transform
its application to converter test,” in Proc. IEEE Instrumentation
As mentioned earlier, the DFT could be directly applied to a
Measurement Technology Conf., Sorrento, Italy, Apr. 2006, pp.
coherently captured waveform in which the end point of the
1038-1042.
signal could be connected to the next noncaptured sample in
the same way as the first sample in the captured waveform. [3] I. Kollar and J. Blair, “Improved determination of the best fitting
When the captured waveform has a factional period of sine sine wave in ADC testing,” IEEE Trans. Instrum. Meas. vol. 54,
wave, the previous condition will not be satisfied; that is, no. 5, pp. 1978–1983, 2005.
either the sine wave frequency is too low or too high com- [4] T.Z. Bilau, T. Megyeri, A. Sarhegyi, J. Markus, and I. Kollar, “Four
pared to the time interval required to capture the signal If parameter fitting of sine wave testing result: Iteration and
we can change the angular velocity of the captured sine convergence,” Comput. Standards Interfaces, vol. 26, pp. 51–56, 2004.
wave, we can make a sine wave with an integer number of
periods. This operation is very simple if we decompose a Fang Xu (fang.xu@teradyne.com) received the License en
sinusoidal function of a sine wave into a complex expression Science in electronique electrotechnique et automatique and
(Step 3 in How to Calculate the Data). Then, we can round Diplôme d’étude approfondie in instrumentation from the
the number of periods of that complex waveform to the next Université Paris Sud, France, in 1983 and 1985, respectively, and
integer number by considering a multiplication of a twiddle the Docteur en Science from the same university in 1990. He
function, which we refer to as the complex-valued window worked at Drusch SA from 1985 to 1994 and designed nuclear
function (Step 7 in How to Calculate the Data). The twiddle magnetic resonance spectrometer and imaging systems. He is
function could be determined according to the actual fre- currently the senior technologist at Teradyne’s semiconductor
quency of the captured waveform by allowing the utilization test division. He has been an invited speaker at multiple interna-
of free running crystal oscillators as in the application of test- tional semiconductor test conferences. He holds multiple
ing high-performance analog-to-digital converters. Then, patents in instrumentation techniques and architectures. He is a
apply the complex-valued Fourier transform (Final Step in committee member of IEEE TC-10, working on standards 1057,
How to Calculate the Data). We call this method the extend- 1241, and p1658. His recent publication of “Algorithm to
ed Fourier transform (FXT) for a noncoherently captured remove spectral leakage, close-in noise, and its application to
waveform. The details of the original algorithm have been converter test” received the best paper award at the 2006 IEEE
presented in [2]. Instrumentation Measurement Technology Conference.
February 2007 IEEE Instrumentation & Measurement Magazine 33