The inverse transform can create a time-domain waveform where no waveform has been before.
In part 2 of this series, we used the discrete Fourier transform to convert a waveform from the time domain to the frequency domain, operated on the frequency-domain data, and used the inverse transform to reconstruct the altered time-domain waveform. That’s a typical use case for the Fourier and inverse Fourier transforms. Still, we can also define data in the frequency domain without initially converting anything from the time domain. Then, we can transform our frequency data to the time domain.
How do we get started?
Figure 1 shows how we can set up a spreadsheet in Excel. Note that with Excel’s implementation of the fast Fourier transform (FFT), we are constrained to datasets with the number of data points N equal to a power of 2, and here we’re choosing N equals 512. In column A, we enter the sample number n, from 0 to 511, and in column B, we’ll enter our frequency base instead of a time base as we did in part 2 of this series, starting with zero in B2 and proceeding with 2-Hz increments up to 1,022 Hz in B513.

Column C will contain our frequency-domain description of the waveform we want to synthesize. For now, we’ll fill it out with 0s. The IFFT engine expects to see complex numbers in column C, so we’ll use Excel’s COMPLEX command, as shown in the formula bar. Excel will write the complex inverse FFT (IFFT) result to column D, and we will extract the real and imaginary parts in columns E and F, respectively.
How do we enter our frequency-domain description?
Let’s say we want to create a 100-Hz sinusoid. We scroll down column B until we reach 100 Hz in column B, line 52. In the adjacent cell C52, we will enter a complex number representing amplitude and phase information (Figure 2). In this example, we’re using 181-181i. Note that instead of j, I am using i as the default for Excel.

Why 181?
In part 2, when we calculated the FFT magnitude, we needed to include a scaling factor of 2/N to get a normalized output. To calculate the IFFT and get a normalized output, we need to multiply the IFFT input by N/2, or 256 in our case. 181-181i has a magnitude of 256.
Now, can we run the IFFT?
Not yet. Recall from part 2 of our earlier series on the Fourier transform that the transform creates a mirror image of our frequency content above the Nyquist frequency, which is sometimes called the folding frequency, with the mirror images containing the complex conjugates of the frequency components below the Nyquist frequency. In our case, 100 Hz is 412 Hz below the 512-Hz Nyquist frequency, so we will need to add the complex conjugate 412 Hz above the Nyquist frequency, as shown in line 464 of the figure, where we can use the IMCONJUGATE function. Now, we can run the IFFT and get the waveform in Figure 3.

The period looks to be about 10, but 10 what?
Oh, we forgot to create a time base, so Excel is using line numbers. In part 2, we started in the time domain, moved to the frequency domain, and then went back to the time domain, where we could rely on the original time base. Here, we must create it. Here is Equation 1 from part 2:
We just solve for Δt:
Now, we can create a column for time — column G in Figure 4 — where each entry is Δt times n. We can plot waveform vs. time waveform from Figure 3.

The red trace in Figure 5 shows the result, as well as results for other complex numbers in cell C52 in Figure 2, including 256+0i (blue cosine wave), 0-256i (gray sine wave), and 0+128i (orange inverted sine wave with a peak amplitude of 0.5).

I notice that the imaginary parts of the complex FFT are all 0.
Right. If we are dealing with real signals and include the complex conjugate in the mirror image above the Nyquist frequency, the imaginary parts should be 0.
How do we know the Nyquist frequency is 512 Hz?
The Nyquist frequency is half our sampling frequency fS:
So, the Nyquist frequency is 512 Hz.
What else can we do with the IFFT?
We’ll have a look next time in part 4 of this series.
Related EE World content
Numbers for engineering: Complex numbers, rational numbers, and primes
Why does the Fourier transform provide apparently inaccurate results, and what can I do about it? part 2
The difference between signal under-sampling, aliasing, and folding
Subtleties of math functions in digital storage oscilloscopes
Understanding and displaying the J operator
Characterizing sinusoidal signals with equations
Leave a Reply
You must be logged in to post a comment.