/DFT-cpp

A naive DFT calculation program in C++

Primary LanguageC++

DFT-cpp

A naive DFT (Discrete Fourier Transform) calculation program in C++

The program calculates the DFT of either a sample sine-wave signal or of a user-supplied signal (.txt file). The result is printed out by the program. An example of output is given below


Computing DFT sample data: sine wave at 1 Hz

  • Number of samples: 8
  • Sampling frequency [Hz]: 8
  • Frequency resolution [Hz]: 1
  • Maximum detectable frequency [Hz]: 4

  • Array of DFT:
  • F [Hz] Value
  • 0 (3.31701e-007,0)
  • 1 (3.317e-007,-0.5)
  • 2 (3.31699e-007,1.94308e-007)
  • 3 (3.31697e-007,3.31704e-007)
  • 4 (3.31693e-007,5.49582e-007)
  • 5 (3.31683e-007,9.95102e-007)
  • 6 (3.31651e-007,2.45928e-006)
  • 7 (-1.02826e-005,0.499999)