The two-sided, DC-centered FFT provides a method for displaying a spectrum with both positive and negative frequencies. 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, DC-centered representation. In a two-sided, DC-centered FFT, the DC component is in the middle of the buffer.
If
is a Fourier transform pair, then
![]() |
(A) |
Let
| Δ(t) = 1/fs | (B) |
where fs is the sampling frequency in the discrete representation of the time signal.
Set f0 to the index corresponding to the Nyquist component fN, as shown in the following equation:
| f0 = fN = fs/2 = 1/2Δt | (C) |
f0 is set to the index corresponding to fN because causing the DC component to appear in the location of the Nyquist component requires a frequency shift equal to fN.
Setting f0 to the index corresponding to fN results in the discrete Fourier transform pair shown in the following relationship:
![]() |
(D) |
where n is the number of elements in the discrete sequence, xi is the time-domain sequence, and Xk is the frequency-domain representation of xi.
Expanding the exponential term in the time-domain sequence produces the following equation:
![]() |
(E) |
Equation E represents a sequence of alternating +1 and –1. Equation E means that negating the odd elements of the original time-domain sequence and performing an FFT on the new sequence produces a spectrum whose DC component appears in the center of the sequence.
Therefore, if the original input sequence is
| X = {x0, x1, x2, x3, …, xn – 1} | (F) |
then the sequence
| Y = {x0, –x1, x2, –x3, …, xn – 1} | (G) |
generates a DC-centered spectrum.
You can modulate a signal by the Nyquist frequency in place without extra buffers. Refer to the Nyquist Shift VI in the labview\examples\analysis\dspxmpl.llb for an example of generating the sequence shown in Equation G.
The following figure shows the block diagram of the Nyquist Shift VI.

In the previous figure, the For Loop iterates through the input sequence, alternately multiplying array elements by 1.0 and –1.0, until it processes the entire input array.
The following figure shows the block diagram of a VI that generates a time-domain sequence and uses the Nyquist Shift and the Power Spectrum VI to produce a DC-centered spectrum.
![]() |
Note You can use the Power Spectrum VI only in the LabVIEW Full and Professional Development Systems. |

Refer to the DC Centered Spectrum VI in the labview\examples\analysis\dspxmpl.llb for an example of using the Nyquist Shift and Power Spectrum VIs.
In the VI in the previous figure, the Nyquist Shift VI preprocesses the time-domain sequence by negating every other element in the sequence. The Power Spectrum VI transforms the data into the frequency domain. To display the frequency axis of the processed data correctly, you must supply x0, which is the x-axis value of the initial frequency bin. For a DC-centered spectrum, the following equation computes x0.
| x0 = –n/2 | (H) |
The following figure shows the time-domain sequence and DC-centered spectrum the VI in the previous figure returns.

In the DC-centered spectrum display in the previous figure, the DC component appears in the center of the display at f = 0. The overall format resembles that commonly found in tables of Fourier transform pairs.
You can create DC-centered spectra for even-sized input sequences by negating the odd elements of the input sequence.
You cannot create DC-centered spectra by directly negating the odd elements of an input time-domain sequence containing an odd number of elements because the Nyquist frequency appears between two frequency bins. To create DC-centered spectra for odd-sized input sequences, you must rotate the FFT arrays by the amount given in the following relationship:
| (n – 1)/2 | (I) |
For a DC-centered spectrum created from an odd-sized input sequence, the following equation computes x0.
| x0 = –(n – 1)/2 | (J) |