How to Plot FFT for Matlab?

5 views (last 30 days)
Matthew Jacobs
Matthew Jacobs on 14 Nov 2018
Answered: Star Strider on 14 Nov 2018
I'm kind of confused on what exaclty I'm expected to plot as the frequency domain kinda confuses me.
I'm given Vout from the circuit in Simulink:
Screen Shot 2018-11-13 at 9.07.28 PM.png
From there I'm told to:
  • Parametrize the provided Simulink model
  • Extract Vout to workspace
  • Include a section in your script to find the peak value of the fundamental of Vout (Fourier decomposition)
  • Find Vout/ (Vin/2)
  • Use a "for" loop to create at least 10 points for the final plot (5 values of ma < 1 and 5 > 1). Make sure saturation is visible.
My problem is with the 3rd step in the bullitin. How do I find the fundamental? My professor gave a hint of using fft in matlab on Vout. I tried max(fft(Vout)) and got the result
=-4.0000e+01 + 2.5465e+07i But I don't think is is right as there is an imaginary value but I need it as a voltage. Any help would be great. Thanks!

Answers (1)

Star Strider
Star Strider on 14 Nov 2018
The result of the Fourier transform will be complex. Use the abs() (absolute value) function to recover the amplitude from the complex quantities.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!