0% found this document useful (0 votes)
49 views

Using The FFT As An Arbitrary Function Generator

1) The inverse fast Fourier transform (IFFT) can be used to generate arbitrary waveforms by transforming a spectral description into a time series. 2) Overlapping and windowing successive IFFT outputs allows seamless extension of the time series to any length without discontinuities. 3) This process is analogous to traditional spectral analysis using overlapping windows, and can generate signals not possible with conventional arbitrary function generators which only produce periodic repetitions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Using The FFT As An Arbitrary Function Generator

1) The inverse fast Fourier transform (IFFT) can be used to generate arbitrary waveforms by transforming a spectral description into a time series. 2) Overlapping and windowing successive IFFT outputs allows seamless extension of the time series to any length without discontinuities. 3) This process is analogous to traditional spectral analysis using overlapping windows, and can generate signals not possible with conventional arbitrary function generators which only produce periodic repetitions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

USING THE FFT AS AN ARBITRARY FUNCTION GENERATOR

Robert Wade Lowdermilk fred harris


BAE Systems San Diego State University
16250 Technology Drive San Diego, 5500 Campanile Drive City, San Diego,
CA 92127 CA 92182
(858) 675-2912 (619) 594-6162
[email protected] [email protected]

Abstract – The inverse fast Fourier transform non periodic extensions of the time series formed
(IFFT) forms a time series from its spectral by a sequence of successive IFFTs can also
description. The time data formed by the IFFT formed without boundary discontinuities. This is
represents a single cycle of a periodic accomplished by suppressing the discontinuities
waveform which can be accessed periodically with a window and then merging successive time
to form an arbitrary length version of the series by the sum of overlapped and windowed
signal. This property is similar to the periodic time series. Wide dynamic range signals require
memory access used by arbitrary function 75% overlap of the windowed time segments.
generators. A sequence of windowed, This is seen to be the inverse of the process
overlapped IFFTs can be used to seamlessly called a sliding windowed FFT applied in
extend the time series to obtain any arbitrary traditional spectral analysis to analyze time
non-periodic time series. This option is not varying spectra. This set of operations for both
available from traditional arbitrary function the analysis process and the synthesis process is
generators. illustrated in Figure 1.
Input Tim e Line
INTRODUCTION Frequenc y

N
Arbitrary waveform generators, available from Point
FFT
many suppliers, permit the user to design and Suc c essive

generate any waveform in addition to the standard Overlapped


Windowed
function generator signals such as sine waves Segm ents
Analysis
Tim e
and square waves. These generators form
sampled data waveforms off line which are stored
Frequenc y Output Tim e Line
in deep digital memory. The content of this
memory is presented to a digital-to-analog
N
converter and an analog smoothing filter to form Point
IFFT
the desired analog representation of the arbitrary Suc c essive

waveform. Dual output channels are easily Overlapped


Synthesis Windowed
formed with a pair of synchronized, memory- Tim e Segm ents
based systems. The time series formed by
arbitrary waveform generators are simply periodic Figure 1. Analysis and Synthesis of Arbitrary
extensions of the stored time series. The Time Series by Succession of Overlapped and
extension is often likened to a snake biting its tail. Windowed Time Segments
Unless care is exercised in forming the initial time
series, the periodic extension is likely to contain The merging of windowed overlapped inverse
time discontinuities at the frame boundaries. As a transform segments has been used successfully
consequence of the sampling theorem, a time in shaker control systems that form time signals to
series formed from the output of an inverse FFT is drive a shaker table from power spectra that has
always periodic and is continuous at the been shaped and adaptively modified in the
boundaries of its periodic extension. Arbitrary, frequency domain.

0-7803-9101-2/05/$20.00 ©2005 IEEE 408

Authorized licensed use limited to: Renesas Electronics America. Downloaded on December 20,2022 at 07:39:43 UTC from IEEE Xplore. Restrictions apply.
WINDOW DESIGN cosine components of the 50% shifted terms are
phase shifted 180 degrees. Due to this phase
The first question addressed is the structure of the shift, the cosine terms from the indicated partition
window that will ensure artifact free reconstruction sum to zero and the steady state sum is simply
of the time series formed by the merging process. twice a0, the DC term. Note: If the window
The merged overlapped sum of window segments contains a second harmonic term, as do the
is expected to exhibit a constant envelope. This Blackman and 3-term Blackman-harris windows,
envelope can be thought of as the reconstruction the half interval time delay does not phase shift
of a DC input signal which has been partitioned the second harmonic and the sum of these offset
and windowed and then reassembled by the windows would contain a DC component of 2 a0
merging process. Figure 2 illustrates an example and a second harmonic term of 2 a2. The
of the incidental envelope scalloping that may surviving harmonic term is the envelope
occur as a result of the merging operation. scalloping that must be suppressed by proper
window design. This example shows that
Artifac t of Merged Sum windows with 50% overlap cannot contain spectral
components which are even harmonics of the
fundamental time interval.
T

Examples of windows containing only odd


Figure 2. Illustration of Undesired Scalloping harmonic spectral components are the Rectangle,
Formed by Merging Process Triangle, Hann, and Hamming windows. These
windows exhibit limited peak side lobe level of
The window can be visualized as a time series -13, -26, -32, and -44 dB, respectively. Windows
formed as the inverse discrete cosine Fourier with deep side lobe levels have a wider main lobe
transform containing a small number of terms. which means they contain additional spectral
The Hann and Hamming windows are examples terms. These additional terms must be cancelled
of windows formed by two spectral terms as in the merging summation process. If the main
indicated in (1). lobe width is increased to obtain spectral side lobe
2S levels approximately 100 dB below main lobe
h ( n ) a0  a1 cos( n ), n 0,1, 2, , N  1 (1) level, the main lobe width contains five spectral
N
terms (DC and 4 harmonics). The existence of
these spectral terms means that 75% overlap is
The merged summation for 50% overlap is
required to suppress their contributions in the
described in (2) and illustrated in Figure 3.
merging process. Figures 4 and 5 show the time
N
s(n ) ¦ h(n  m ) and spectral response of a Kaiser-Bessel window
m 2 (2) and of a 4-term Blackman-harris window with 90
N N dB side lobes. The figures also show envelope
h(n )  h(n  )  h(n  2 )  
2 2 scalloping in the reconstruction obtained from the
Figure 3 shows the spectral components of the Kaiser window and the spectral artifacts due to
window terms offset by 100%, separately from the that scalloping.
spectral component terms offset by 50%. The
a0 a0 a0 a0

a1 a1 a1 a1
H(n) H(n-N) H(n-2N) H(n-3N)
Sp e c tra l
Co m p o nents a0 a0 a0
in
Suc ce ssive
Wind ow a1 a1 a1
Inte rva ls
H(n-N/2) H(n-3N/2) H(n-5N/2) H(n-7N/2)
Artifa c t Free
Sum a1
2a 0
a1

Figure 3. Summation of Overlapped Window Components

409

Authorized licensed use limited to: Renesas Electronics America. Downloaded on December 20,2022 at 07:39:43 UTC from IEEE Xplore. Restrictions apply.
hw ( n ) h ( n ) ˜ w( n )
(4)
H w (T ) H (T ) W (T ); T mod(2S )

When the time series is a sampled sinusoid of


unbounded extent, the spectrum, as shown in (5),
is an impulse at the center frequency T = T0.
When the window is applied to the sampled
sinusoid, its spectrum is convolved with the
window’s transform as shown in (6).

f
H (T ) ¦ exp( jT n ) exp(  jT n)
0 G (T  T 0 ) (5)
n f

H w (T ) G (T  T0 ) W (T ) W (T  T 0 ) (6)

Figure 4. Time and Spectral Response of Merged


When the transform is evaluated by a discrete
Kaiser Windows with Residual Scallop
Fourier transform (DFT), the results are samples
of the continuous periodic function at the sample
positions k*2S/N. This is shown in (7).

N 1
2S 2S
HW (k ) ¦ w(n) exp( j N k0n ) exp(  j kn )
n 0 N (7)
N 1
2S
¦ w( n ) exp(  j (k  k0 )) W ( k  k0 )
n 0 N

What affect the time shifts of the successive


window intervals have on the transform samples
also must be addressed. This is examined in (8)
where the shifts s of length N/4 is accounted for.
This shows that the transform weights are not only
translated to the index of the desired center
frequency but that the weights must be rotated by
Figure 5. Time and Spectral Response of Merged the indicated phase shift to account for the time
4-Term Blackman-harris Windows with no offsets of the windows. This aligns the continuous
Residual Scallop phase of the windowed time series with the
discontinuous phase of the DFT which resets to
APPLYING THE TIME DOMAIN zero each time it operates.
WINDOW IN THE FREQUENCY
N N 1
2S N 2S
DOMAIN HW (k , s ) ¦ w(n) exp( j N k0 ( n  s )) exp(  j kn )
4 n 0 4 N
N 1
(8)
2S 2S
The window used in standard spectral analysis is exp( j sk0 ) ¦ w(n ) exp(  j (k  k0 ))
4 n 0 N
applied multiplicatively in the time domain which is
2S
equivalent to applying the window’s transform as exp( j sk0 ) W (k  k0 )
a convolution in the frequency domain. This 4
relationship is shown in (3) for the continuous time
series and in (4) for the sampled data time series. (8) translates the frequency domain weights of the
Remember that the sampled data version of the window to the DFT bin center, applies the
convolution is circular convolution. appropriate phase rotation, and then performs the
IDFT to obtain the windowed time series. If the
bin center corresponds to a DFT index (i.e., if k0 is
hw (t ) h (t ) ˜ w(t ) an integer), the translation simply places the DFT
(3)
H w (Z ) H (Z ) W (Z ) coefficients symmetrically about the desired
center frequency as shown in Figure 6, which

410

Authorized licensed use limited to: Renesas Electronics America. Downloaded on December 20,2022 at 07:39:43 UTC from IEEE Xplore. Restrictions apply.
shows the spectrum and time series for the prior to applying the inverse synthesis processing.
options of forming un-windowed and windowed In the most general case, the index k0 contains an
time series. In successive transforms the window integer part and a fractional part. For example,
weights would acquire the phase shift shown in forming samples of the sinusoid with frequency
(8) which for an integer address turns out to be 0.1 in a 256 point DFT would correspond to a
simply multiples of S/2. center frequency of 0.1·fs, which is centered at
index 25.6. For this example, the integer part of
Real[H(k)] Real[h(n)]
N the index is 25 and the fractional part is 0.6 or
Point
IDFT
alternatively 26 and -0.4, respectively. The
Im ag[h(n)]
position of the translated window spectrum and
Im ag[H(k)]
K= k0
DFT corresponding to this example is shown in
k n
Figure 7.
Sa m pled
Real[H(k)] Spec tral Real[h(n)]
Wind ow Sam pled
N
Point Tim e Domain To compute the DFT coefficients of the base band
Window
IDFT window offset by -0.4, use the relationship shown
Im ag[H(k)]
K= k0
Im ag[h(n)] in the first 3-line for-loop of the MATLAB Script
(Figure 8), and apply the proper phase rotation to
k n the successive offset windowed transforms, using
the second 3-line for-loop of the same MATLAB
Figure 6. Spectrum and Time Series for the script. Readers can form their own MATLAB
Synthesis of Un-windowed and Windowed Time script for a Blackman-harris window, can access
Series the MATLAB script Window, or can request copies
from the authors.
When the selected center frequency index is not
an integer, there is one additional task to perform

W(k-k0)= W(k-25.6)

25.6
22 23 24 25 26 27 28 29 30 Translated DFTIndex

-4 -3 -2 -1 0 +1 +2 +3 +4 Base Band DFTIndex


-0.4

Figure 7. Window Samples of Base Band Window Translated -0.4 Bins and of Center Frequency Window
Translated 25.6 Bins

% call bkharris window


ww=bkharris(16)';
dk=+0.6;
wwf=zeros(1,9);

% DFT h(k+dk)
for kk=-4:4
wwf(kk+5)=ww*exp(j*2*pi*(0:15)*(kk-dk)/16)';
end

% add phase spinning to match frequency offset


for nn=1:40
f_dat=zeros(1,256);
f_dat(26+(-4:4))=wwf*exp(j*2*pi*(25+dk)*(nn-1)/4);
dat(nn,:)=16*ifft(f_dat);
end

Figure 8. MATLAB Script for Frequency Offset Window and Phase Rotator for Successive Windowed
and Overlapped Transforms

411

Authorized licensed use limited to: Renesas Electronics America. Downloaded on December 20,2022 at 07:39:43 UTC from IEEE Xplore. Restrictions apply.
The sequence of time series, formed by the non-integer number of cycles causes spectral
phase-rotated offset window terms of this leakage to all frequency bins of the DFT.
synthesis process, exactly match the sequence of Windows applied as spectral convolutions
windowed time series formed by windowing the suppress the time domain discontinuity and permit
original sinusoidal time series of frequency 0.1. compact spectral sinusoids of the arbitrary
Figure 9 shows the initial segment of the time frequency. By proper selection of the window, the
series and the spectrum of the steady state time merging by summation of overlapped time
series formed by this synthesized inverse analysis intervals forms time series with processing
process. Spectral artifacts associated with this artifacts suppressed by approximately 100 dB.
synthesis process are down 100 dB relative to the Any signal formed as a discrete set of arbitrary
full scale signal. center frequency sinusoids can be formed in this
manner. This method can also be used to form
CONCLUSION sinusoids with slowly time varying center
frequencies.
This paper describes a technique permitting the
synthesis of one or more complex sinusoids of REFERENCES
arbitrary frequency using windowed inverse DFTs.
At first glance, only sinusoids with an integer [1] f. j. harris, “Windows Harmonic Analysis and
number of cycles per interval can be synthesized the Discrete Fourier Transform,” IEEE
exactly by spectral descriptions of the sinusoid. Proceedings, Jan 1978
The time domain discontinuity of sinusoids with

Figure 9. Time Series and Spectrum Formed by Merging Windowed and Overlapped Synthesized Time
Series

412

Authorized licensed use limited to: Renesas Electronics America. Downloaded on December 20,2022 at 07:39:43 UTC from IEEE Xplore. Restrictions apply.

You might also like