Two-Sided (DC-Centered) Fast Fourier Transforms

Most introductory textbooks that discuss the Fourier transform and its properties present a table of two-sided Fourier transform pairs. You can use the frequency shifting property of the Fourier transform to obtain a two-sided (the DC component in the middle of the buffer) representation. If x(t) ¤ X(f) is a Fourier transform pair, then

let

is the sampling frequency

in the discrete representation of the time signal, and set to the index corresponding to the Nyquist component fNyq

because that is how much frequency shifting is required for the DC component to appear in the location of the Nyquist component.

The discrete representation is

where n is the number of elements in the discrete sequence.

Expanding the exponential term in the time sequence

which means that to obtain an FFT whose DC component appears in the center of the sequence, you need only negate the odd elements of the original sequence. Thus, if

is the original input sequence, then the sequence

generates a two-sided FFT.

In the following VI implementation, notice that you can implement this calculation in place without extra buffers.

The following block diagram is one of many possible implementations. In this particular implementation, the For Loop includes a shift register with two left terminals. The constants wired to the shift register terminals initialize them with the values -1.0 and 1.0. When the For Loop executes, the first element of the array does not change because the element is multiplied by 1.0. The next iteration swaps the contents of the left terminals of the shift register and multiplies the second element of the array by -1.0, negating the original value. The For Loop repeats until it processes the whole array, at which time the contents of the output array are ready to generate a two-sided FFT.

Finally, the following illustration shows the input and output terminals of the Nyquist Shift VI. You can use this VI in an application that requires two-sided information.

The following block diagram shows one way to use the Nyquist Shift VI.

The upper branch of this block diagram graphs the raw data. The data is shown in the following graph.

In the previous block diagram, the Nyquist Shift VI preprocesses the raw data by negating every other element in it. The Power Spectrum VI then analyzes the data. To display the processed data correctly, you must supply the index corresponding to the harmonic in question. In this case, the initial value for this graph must be

The following graph displays the result of processing the data in this manner to obtain two-sided FFTs. Notice that the DC component appears in the center of the display indicated by the zero index and that the overall format is just like that commonly found in tables of Fourier transform pairs.

You can apply this technique to sequences that generate real and complex FFTs, even-sized real and complex DFTs, power and cross power spectra, fast Hartley transforms (FHTs), and all functions related to these functions. You cannot apply this technique directly to odd-sized arrays because leakage will occur. However, you can derive a similar technique for odd-sized arrays.