• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Advertise
  • Subscribe

Test & Measurement Tips

Oscilloscopes, electronics engineering industry news, how-to EE articles and electronics resources

  • Oscilloscopes
    • Analog Oscilloscope
    • Digital Oscilloscope
    • Handheld Oscilloscope
    • Mixed-signal Oscilloscope
    • PC-based Oscilloscopes – PCO
  • Design
  • Calibration
  • Meters & Testers
  • Test Equipment
  • Learn
    • eBooks/Tech Tips
    • FAQs
    • EE Training Days
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Video
    • EE Videos
    • Teardown Videos
  • Resources
    • Design Guide Library
    • Digital Issues
    • Engineering Diversity & Inclusion
    • Leap Awards
    • White Papers
  • Subscribe
You are here: Home / Featured / Why does the Fourier transform provide apparently inaccurate results, and what can I do about it? part 2

Why does the Fourier transform provide apparently inaccurate results, and what can I do about it? part 2

February 1, 2024 By Rick Nelson Leave a Comment

A bare-bones implementation of the Fast Fourier Transform helps illuminate how to extract frequency information from input data samples.

In part 1 of this series, we reviewed the discrete Fourier transform (DFT) and manually calculated one DFT shown in Table 1.

Table 1. Manual DFT results

DFT input Complex DFT |DFT|
3 12 + j0 12
4 -1.5 + j0.866 1.732
5 -1.5 – j0.866 1.732

The point of the DFT is to extract frequency content from an input function of time, and as you pointed out, frequency information is not apparent in our result. We concluded part 1 by beginning to set up an Excel worksheet to perform a Fast Fourier Transform (FFT) on the time-domain signal in Figure 1.Didn’t you mention that the preferred tool for running the DFT on a computer would be engineering software such as MATLAB or LabVIEW?
Right, but the bare-bones nature of the Excel implementation makes it useful for examining some details that take place behind the scenes in more elegant solutions.

Figure 1. This function of time represents 512 data samples in 1-ms increments.

We defined six worksheet column headings last time. What goes into each column?

Figure 2 provides the details; just follow the nine steps listed in red. Note that in column B, we enter the times for our data samples, thereby mapping sample n to time t. Then we insert our 512 sample data points into column C, which serves as the DFT input.

Figure 2. Follow the steps listed in red to initiate the DFT.

We reserve column D for the FFT complex output. For column E, we calculate the magnitude of column D using the Excel IMABS() function, which returns the absolute value of a complex number. In addition, to normalize the FFT magnitude so that a frequency pulse with a magnitude of 1 corresponds to a sinusoid with a peak value of 1, we multiply the column E values by 2/N.
Now we can develop our frequency scale. Note that the sampling interval is

Δt = tn– tn-1

or 1 ms in this example, and Δt appears explicitly in cell B3. In step 5, we calculate the sampling frequency fS, and in step 6, we calculate Δf, or 1.95 in this case. Beginning with 0 in F2, successive cells in F will increase by Δt until we reach cell F513. A convenient way to fill F2 through F513 is simply to multiply n by 1.95 (step 7).

Continue with steps 8 and 9, and Data Analysis box appears (Figure 3 top). Continue with steps 10 and 11, which will open the Fourier Analysis box (Figure 3, bottom), where you can complete initiation of the FFT using steps 12 through 15.

Figure 3. Follow steps 10 through 15 to run the FFT.

After a few seconds, Excel will write the complex FFT into column D, and the FFT magnitude will appear in column E (Figure 4).

Figure 4. The FFT engine writes the complex DFT into column D, and the DFT magnitude appears in column E.

Now we can plot the FFT magnitude in column E vs. frequency in column F (Figure 5). The FFT shows noise throughout the frequency range but with distinct peaks at a 39.1-Hz fundamental frequency plus the third, fifth, and seventh harmonics. Note that the FFT creates a mirror image of these pulses above the 500-Hz Nyquist, or folding, frequency. These aliases may be discarded, and in subsequent charts I will only include frequencies up to the Nyquist frequency.

Figure 5. The DFT reveals that the sample signal has a 39.1-Hz fundamental plus third, fifth, and seventh harmonics.

Interesting. How much confidence can we have in these results?

To answer such questions, it can be useful to apply a clean signal to the DFT and then alter it in various known ways to determine how the DFT responds. Let’s take a quick look. In Figure 6, in place of the Figure 1 waveform data I have substituted a clean cosine wave of the Figure 5 signal’s 39.1-Hz fundamental frequency. As expected, the FFT produces a pulse of magnitude 1 at 39.1 Hz.

Figure 6. The FFT of a 39.1-Hz cosine wave shows the expected result.

Now, let’s tweak our cosine wave—we won’t add any interference but just reduce the frequency by about 2.5% to 38.12 Hz. Now, take a look at the FFT in Figure 7.

Figure 7. Changing the Figure 6 signal’s frequency to 38.12 Hz results in an FFT with peak magnitude reduced from 1 to 0.667.

The peak frequency still appears at 39.1 Hz, but its magnitude is reduced to 0.667, What happened? (Hint: Figure 7 contains a small clue.) We’ll take a closer look in part 3.

You may also like:


  • Why does the Fourier transform provide apparently inaccurate results, and…

  • Why does the Fourier Transform provide apparently inaccurate results, and…

Filed Under: Communication Test, FAQ, Featured, Test Equipment Tagged With: FAQ

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Featured Contributions

Why engineers need IC ESD and TLP data

Verify, test, and troubleshoot 5G Wi-Fi FWA gateways

How to build and manage a top-notch test team

How to use remote sensing for DC programmable power supplies

The factors of accurate measurements

More Featured Contributions

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE TRAINING CENTER

EE Learning Center

EE ENGINEERING TRAINING DAYS

engineering
“test
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.
“bills

RSS Current EDABoard.com discussions

  • Right Half Plane Zero
  • dc-dc converter in series
  • Single ended measuring ports and balanced antenna
  • Thermal modelling of repetitive power pulse
  • Permittivity and Permealibility in CST

RSS Current Electro-Tech-Online.com Discussions

  • Microinverters and storeage batteries?
  • Fun with AI and swordfish basic
  • FFC connector white
  • Is AI making embedded software developers more productive?
  • Can I make two inputs from one??
Search Millions of Parts from Thousands of Suppliers.

Search Now!
design fast globle

Footer

EE World Online Network

  • 5G Technology World
  • EE World Online
  • Engineers Garage
  • Analog IC Tips
  • Battery Power Tips
  • Connector Tips
  • DesignFast
  • EDA Board Forums
  • Electro Tech Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips

Test & Measurement Tips

  • Subscribe to our newsletter
  • Advertise with us
  • Contact us
  • About us

Copyright © 2025 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy