Functions > Transforms and Filters > Example: DFT of Complex Functions
  
Example: DFT of Complex Functions
Use the dft and idft functions to compute the complex or real forward or inverse Fourier Transforms.
1. Create some simulated complex data with N data points.
Click to copy this expression
Click to copy this expression
2. Define the sampling spacing.
Click to copy this expression
Click to copy this expression
Click to copy this expression
3. Use the exp function to define the following signal.
Click to copy this expression
4. Define the sampling frequency and the frequency corresponding to the nth entry in the transformed vector.
Click to copy this expression
Click to copy this expression
5. Apply the dft function to transform the data to the frequency domain.
Click to copy this expression
6. Save the magnitude of elements of array D into a new array.
Click to copy this expression
7. Use the match and max functions to calculate the amplitude and frequency of the peak.
Click to copy this expression
Click to copy this expression
Click to copy this expression
8. Plot the magnitude of DFT as a function of frequency.
Click to copy this expression
9. Show that the frequency of the peak corresponds to ω0/2π.
Click to copy this expression
10. Use the idft function to show that the IDFT of DFT of a signal returns the signal itself.
Click to copy this expression