In part 3 of this series, we used the inverse fast Fourier transform (IFFT) to create 100-Hz time-domain waveforms of various amplitudes and phases. We can also use the IFFT to create waveforms containing multiple frequencies. If you look closely at Figure 1 in part 1 of this series, you’ll notice that the time-domain waveform contains the musical note A220 and its even harmonics A440 and A880.
How can we set up a spreadsheet to create multifrequency waveforms?
Figure 1a shows the setup for Excel, similar to part 3. Recall that above the Nyquist frequency fN, the discrete Fourier transform contains mirror images consisting of the complex conjugates of the frequencies below fN. To simplify data entry, you can populate the cells above fN using the =IMCONJUGATE function, with each entry referencing its low-frequency counterpart.

Could you provide an example?
Figure 1b shows entries for our N=512 example, with fN = 512 Hz (highlighted in yellow) in line 258. The next line, 259, contains the equation =IMCONJUGATE(257), referring to the line immediately above fN. This mirroring process continues until line 513, which refers to line 3.
Can Excel automatically enter the descending row numbers for each cell as we fill column C?
No, Excel is not good at countdowns. The typical workaround for reordering datasets is to append an adjacent “helper” column populated with integers in ascending order. Then sort the helper column from highest to lowest, and then delete the helper column. But this approach doesn’t work well for equations.
Is there a workaround?
Yes. Open a new spreadsheet and enter “X=IMCONJUGATE(C” into column A from lines 1 to 255 (the X tells Excel not to treat the entries as equations). Next, enter integers ascending from 3 to 257 into column B and closed parentheses into column C (Figure 2a). Then select cells A1 through C255 and perform a custom sort on column B from highest to lowest (Figure 2b).

We could use search and replace to delete the X, but our “equation” is now spread across three columns.
We can paste cells A1 through C255 as plain text into Word (Figure 2c) and use Word’s search-and-replace function to delete the X and tab characters (Figure 2d). Then we have a clean text for our equations that we can paste into column C of our original spreadsheet, beginning with cell C259.
Let’s try an example — create a square wave.
A square wave consists of odd harmonics, with the amplitude of each harmonic attenuated by its reciprocal:
We’ll choose a fundamental of 10 Hz, with odd harmonics at 30 Hz, 50 Hz, etc. For this example we’ll stop at the 13th harmonic. We enter the appropriate amplitudes in our spreadsheet at each frequency point, keeping in mind that to obtain a normalized IFFT output, we must multiply the IFFT input by N/2=256. Figure 3 shows all the nonzero frequency entries in our spreadsheet.

Figure 4 shows the results, with the red trace representing the fundamental and third harmonic and the blue trace representing the fundamental and all harmonics up through the 13th.

What else can we do with the IFFT?
In part 4 we have looked at adding frequencies, but the FFT/IFFT combination can also subtract them — that is, the FFT/IFFT can serve as a filter. In fact, for implementing a finite-impulse-response (FIR) filter, FFT/IFFT can be more computationally efficient than convolution, a technique applicable to tasks including edge detection, smoothing, and blurring in computer vision; echo suppression in audio applications; and cross-correlation in radar. Perhaps we’ll take a closer look in a subsequent series on filtering.
For further reading
FFT Convolution (Analog Devices)
FIR Digital Filter Design (Stanford University)
Related EE World content
Choosing the right amplifier
The FFT and the Universal Wavefunction
Six oscilloscope features I wish I knew before graduation
Autonomous technology and the compute environment
5G and AI: How they complement each other
Basics of harmonics