# What's the formula for the FFT spectrum?

## Recommended Posts

I want to create a 2D curve with the values of the first harmonic of TorqueElecMag(ROTOR)  to see how it changes with an I/O Parameter. Is that possible?

##### Share on other sites

Hi,

When you draw the curve of the torque, you can get the FFT of this curve. To do it:

• Select the curve
• Right click
• Select Spectrum analysis (FFT)

From this curve you get the first harmonic of the torque. And if you want of see the effect of I/O parameters you need to draw the FFT.

Best regards.

##### Share on other sites

But I was wondering if theres a way to create a 2d curve with the first harmonic module on the Y axis and different values of an I/O parameter on the X axis.

Right now I can do the fft spectrum separately for each value of the I/O parameter but I don't know how to do a 2d curve with the values I mentioned earlier.

##### Share on other sites

Hi,

To get the first harmonic from a curve you can use this python script:

print  Curve2d['SPECTRUM_V1'].y[0].values[0]

Where :

• SPECTRUM_V1' : the name of the FFT that you get from the 2D curve
• y[0] : allows to select the amplitude
• values[0] : allows to select the first harmonic

To draw the curve, you can create an I/O parameter:

b= Curve2d['SPECTRUM_V1'].y[0].values[0]

print b

lastInstance = VariationParameterFormula(name='First_harmonic',

formula=str(b))

Hope this will help.

Best regards.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.