Spectrum Software has released Micro-Cap 11, the eleventh generation of our
SPICE circuit simulator.
For users of previous Micro-Cap versions, check out the
new features available in the latest version. For those of you who are
new to Micro-Cap, take our
features tour to see what Micro-Cap has to offer.
Fourier Theory and Phase
A general misconception about Fourier theory is that a Fourier analysis returns the magnitude and phase of the waveform as it would be represented by pure sine waves. However, true Fourier representation of a waveform consists of both sine and cosine waves which will give much different results, especially for phase, than if it consisted of just sine waves. The following article discusses the expressions and theory that MC5 uses for its Harm and Phase operators in DSP analysis.
The general expression for a Fourier series is as follows:
where w is the fundamental frequency in radians/sec and is equal to 2*PI/T. In MC5, T will be the specified simulation time. The above equation can also be represented as:
V(t) = SUMMATION(An*Cos(n*w*t) + Bn*Sin(n*w*t))
V(t) = SUMMATION(Mn*Cos(n*w*t + Pn))
The magnitude and phase values in the above equation are calculated by the equations:
Mn = sqrt(An*An + Bn*Bn)
Pn = -Tan-1(Bn/An)
As can be seen from the equations, both the An coefficients of the cosine terms and the Bn coefficients of the sine terms are used to calculate the magnitude and phase of the Fourier series.
The circuit below consists of a single nonlinear function voltage (NFV) source. This circuit is available as the example circuit FFT1.CIR in the DATA directory. The NFV source has its VALUE attribute defined as:
This equation will produce a voltage waveform which has a DC term, a pure sine term at 1MHz, a pure cosine term at 2MHz, and a pure sine term again at 3MHz.
The transient analysis of this voltage source appears below. The three waveforms plotted were V(1), the voltage waveform, HARM(V(1)), the harmonics of the V(1) waveform, and PHASE(FFT(V(1))), the phase of the FFT spectrum of the V(1) waveform. The harmonics waveform returns the expected 1.5V at DC, 1V at 1MHz, 2V at 2MHz, and 3V at 3MHz. For the phase waveform, the sine terms return -90 degrees at 1MHz and 3MHz and the cosine term returns 0 degrees at 2MHz. The -90 degrees for the sine terms is due to the fact that the Fourier phase calculation will divide the sine wave magnitude by 0 producing an infinite value for the inverse tangent operation.
The PHASE operator was not used in conjunction with the HARM operator because the HARM operator will return the absolute value of the magnitude which will always produce positive phases. If the waveform PHASE(HARM(V(1))) was used, it would have returned the incorrect value, in terms of Fourier theory, of 90 degrees at 1MHz and 3MHz instead of -90 degrees.