Skip to content

17.7 Fourier Analysis with PSpice

← Back to Fundamentals of Electric Circuits Overview

17.7 Fourier Analysis with PSpice

Fourier analysis is usually performed with PSpice in conjunction with transient analysis. Therefore, we must do a transient analysis to perform a Fourier analysis.

To perform the F ourier analysis of a w aveform, we need a circuit whose input is the waveform and whose output is the Fourier decomposition. A suitable circuit is a current (or v oltage) source in series with a 1-Ω resistor as sho wn in Fig. 17.33. The waveform is inputted as vs(t) using VPULSE for a pulse or VSIN for a sinusoid, and the attributes of the waveform are set over its period T. The output V(1) from node 1 is the dc level (a0) and the first nine harmonics (An) with their corresponding phases ψn; that is,

vo(t)=a0+βˆ‘n=19Ansin⁑(nΟ‰0t+ψn)v_o(t) = a_0 + \sum_{n=1}^{9} A_n \sin(n\omega_0 t + \psi_n)

(17.73)

where

An=an2+bn2,ψn=Ο•nβˆ’Ο€2,Ο•n=tanβ‘βˆ’1bnan(17.74)A_n = \sqrt{a_n^2 + b_n^2}, \qquad \psi_n = \phi_n - \frac{\pi}{2}, \qquad \phi_n = \tan^{-1} \frac{b_n}{a_n} \quad (17.74)

Notice in Eq. (17.74) that the PSpice output is in the sine and angle form rather than the cosine and angle form in Eq. (17.10). The PSpice output also includes the normalized F ourier coefficients. Each coefficient an is normalized by di viding it by the magnitude of the fundamental a1, so that the normalized component is anβˆ•a1. The corresponding phase ψn is normalized by subtracting from it the phase ψ1 of the fundamental, so that the normalized phase is ψn βˆ’ ψ1.

There are tw o types of F ourier analyses of fered by PSpice for Windows: Discrete Fourier Transform (DFT) performed by the PSpice

Figure 17.33 Fourier analysis with PSpice using: (a) a current source, (b) a voltage source.

program and Fast Fourier Transform (FFT) performed by the PSpice A/D program. While DFT is an approximation of the exponential Fourier series, FTT is an algorithm for rapid ef ficient numerical computation of DFT. A full discussion of DFT and FTT is beyond the scope of this book.

17.7.1 Discrete Fourier Transform

A discrete F ourier transform (DFT) is performed by the PSpice pro gram, which tab ulates the harmonics in an output file. To enable a Fourier analysis, we select Analysis/Setup/Transient and bring up the Transient dialog box, sho wn in Fig. 17.34. The Print Step should be a small fraction of the period T, while the Final Time could be 6T. The Center Frequency is the fundamental frequenc y f0 = 1βˆ•T. The particular variable whose DFT is desired, V(1) in Fig. 17.34, is entered in the Output Vars command box. In addition to filling in the Transient dialog box, DCLICK Enable Fourier. With the F ourier analysis enabled and the schematic sa ved, run PSpice by selecting Analysis/Simulate as usual. The program executes a harmonic decomposition into Fourier components of the result of the transient analysis. The results are sent to an output file which can be retrieved by selecting Analysis/Examine Output. The output file includes the dc value and the first nine harmonics by default, although you can specify more in the Number of harmonics box (see Fig. 17.34).

17.7.2 Fast Fourier Transform

A fast Fourier transform (FFT) is performed by the PSpice A/D program and displays as a PSpice A /D plot the complete spectrum of a t ransient expression. As explained above, we first construct the schematic in Fig. 17.33(b) and enter the attrib utes of the w aveform. We also need to enter the Print Step and the Final Time in the Transient dialog box. Once this is done, we can obtain the FFT of the waveform in two ways.

One way is to insert a v oltage marker at node 1 in the schematic of the circuit in Fig. 17.33(b). After saving the schematic and selecting Analysis/Simulate, the w aveform V(1) will be displayed in the PSpice A /D window. Double clicking the FFT icon in the PSpice A /D menu will automatically replace the w aveform with its FFT . From the FFT- generated graph, we can obtain the harmonics. In case the FFT generated graph is crowded, we can use the User Defined data range (see Fig. 17.35) to specify a smaller range.

Data RangeUse Data
C Auto RangeFF Full
C User DefinedC Restricted [analog]
OHz
to 10Hz10Hz
10Hz
to TKHz
ScaleProcessing Options
C Linearβˆ‡\nabla Fourier
CC LogPerformance Analysis

Figure 17.35 X axis settings dialog box.

Transient
Transient Analysis
Print Step:0.01
Final Time:12s
No-Print Delay:
Step Ceiling:10ms
Detailed Bias Pt.
Skip initial transient solution
Fourier Analysis
β…£ Enable Fourier
Center Frequency:0.5
Number of harmonics:
Output Vars.: V(1)
OKCancel

Figure 17.34 Transient dialog box.

Another way of obtaining the FFT of V(1) is to not insert a voltage marker at node 1 in the schematic. After selecting Analysis/ Simulate, the PSpice A /D window will come up with no graph on it. We select Trace/Add and type V(1) in the Trace Command box and DCLICKL OK. We now select Plot/X-Axis Settings to bring up the X-Axis Setting dialog box shown in Fig. 17.35 and then select Fourier/ OK. This will cause the FFT of the selected trace (or traces) to be dis played. This second approach is useful for obtaining the FFT of any trace associated with the circuit.

A major advantage of the FFT method is that it pro vides graphical output. But its major disadvantage is that some of the harmonics may be too small to see.

In both DFT and FFT , we should let the simulation run for a lar ge number of cycles and use a small value of Step Ceiling (in the Transient dialog box) to ensure accurate results. The Final Time in the Transient dialog box should be at least five times the period of the signal to allo w the simulation to reach steady state.

Use PSpice to determine the Fourier coefficients of the signal in Fig. 17.1.

Solution:

Figure 17.36 shows the schematic for obtaining the Fourier coefficients. With the signal in Fig. 17.1 in mind, we enter the attributes of the volt age source VPULSE as shown in Fig. 17.36. We will solve this example using both the DFT and FFT approaches.

β–  METHOD 1 DFT Approach: (The voltage marker in Fig. 17.36 is not needed for this method.) From Fig. 17.1, it is evident that T = 2 s,

f0=1T=12=0.5Β Hzf_0 = \frac{1}{T} = \frac{1}{2} = 0.5 \text{ Hz}

So, in the transient dialog box, we select the Final Time as 6T = 12 s, the Print Step as 0.01 s, the Step Ceiling as 10 ms, the Center Frequency as 0.5 Hz, and the output variable as V(1). (In fact, Fig. 17.34 is for this particular example.) When PSpice is run, the output file contains the following result:

FOURIER COEFFICIENTS OF TRANSIENT RESPONSE V(1)

DC COMPONENT = 4.989950E-01

Example 17.12

Schematic for Example 17.12.

HARMONIC
NO
FREQUENCY
(HZ)
FOURIER
COMPONENT
NORMALIZED
COMPONENT
PHASE
(DEG)
NORMALIZED
PHASE (DEG)
15.000E-016.366E-011.000E + 00-1.809E-010.000E+00
21.000E+002.012E-033.160E-03-9.226E+01-9.208E+01
31.500E+002.122E-013.333E-01-5.427E-01-3.619E-01
42.000E+002.016E-033.167E-03-9.451E+01-9.433E+01
52.500E+001.273E-011.999E-01-9.048E-01-7.239E-01
63.000E+002.024E-033.180E-03-9.676E+01-9.658E+01
73.500E+009.088E-021.427E-01-1.267E+00-1.086E+00
84.000E+002.035E-033.197E-03-9.898E+01-9.880E+01
94.500E+007.065E-021.110E-01-1.630E+00-1.449E+00

Comparing the result with that in Eq. (17.1.7) (see Example 17.1) or with the spectra in Fig. 17.4 shows a close agreement. From Eq. (17.1.7), the dc component is 0.5 while PSpice gives 0.498995. Also, the signal has only odd harmonics with phase ψn = βˆ’90Β°, whereas PSpice seems to indicate that the signal has even harmonics although the magnitudes of the even harmonics are small.

β–  METHOD 2 FFT Approach: With voltage marker in Fig. 17.36 in place, we run PSpice and obtain the waveform V(1) shown in Fig. 17.37(a) on the PSpice A/D window. By double clicking the FFT icon in the PSpice A /D menu and changing the X-axis setting to 0 to 10 Hz, we obtain the FFT of V(1) as shown in Fig. 17.37(b). The FFTgenerated graph contains the dc and harmonic components within the selected frequency range. Notice that the magnitudes and frequencies of the harmonics agree with the DFT-generated tabulated values.

Figure 17.37 (a) Original waveform of Fig. 17.1, (b) FFT of the waveform.

Obtain the Fourier coefficients of the function in Fig. 17.7 using PSpice. Practice Problem 17.12

Answer:

FOURIER COEFFICIENTS OF TRANSIENT RESPONSE V(1)

DC COMPONENT = 4.950000E-01

HARMONIC
NO
FREQUENCY
(HZ)
FOURIER
COMPONENT
NORMALIZED
COMPONENT
PHASE
(DEG)
NORMALIZED
PHASE (DEG)
11.000E+003.184E-011.000E+00-1.782E+020.000E+00
22.000E+001.593E-015.002E-01-1.764E+021.800E+00
33.000E+001.063E-013.338E-01-1.746E+023.600E+00
(continued)
(continued)
44.000E+007.979E-022.506E-03-1.728E+025.400E+00
55.000E+006.392E-012.008E-01-1.710E+027.200E+00
66.000E+005.337E-021.676E-03-1.692E+029.000E+00
77.000E+004.584E-021.440E-01-1.674E+021.080E+01
88.000E+004.021E-021.263E-01-1.656E+021.260E+01
99.000E+003.584E-021.126E-01-1.638E+021.440E+01

If vs = 12 sin(200 Ο€t)u(t) V in the circuit of Fig. 17.38, find i(t).

Solution:

    1. Define. Although the problem appears to be clearly stated, it might be advisable to check with the individual who assigned the problem to make sure he or she wants the transient response rather than the steady-state response; in the latter case the problem becomes trivial.
    1. Present. We are to determine the response i(t) given the input vs(t), using PSpice and Fourier analysis.
    1. Alternative. We will use DFT to perform the initial analysis. We will then check using the FFT approach.
    1. Attempt. The schematic is shown in Fig. 17.39. We may use the DFT approach to obtain the Fourier coefficents of i(t). Because the period of the input waveform is T = 1βˆ•100 = 10 ms, in the Transient dialog box we select Print Step: 0.1 ms, Final Time: 100 ms, Center Frequency: 100 Hz, Number of harmonics: 4, and Output Vars: I(L1). When the circuit is simulated, the output file includes the following:

FOURIER COEFFICIENTS OF TRANSIENT RESPONSE I(VD)

HARMONIC
NO
FREQUENCY
(HZ)
FOURIER
COMPONENT
NORMALIZED
COMPONENT
PHASE
(DEG)
NORMALIZED
PHASE (DEG)
11.000E+028.730E-031.000E+00-8.984E+010.000E+00
22.000E+021.017E-041.165E-02-8.306E+016.783E+00
33.000E+026.811E-057.802E-03-8.235E+017.490E+00
44.000E+024.403E-055.044E-03-8.943E+014.054E+00

With the Fourier coefficients, the Fourier series describing the current i(t) can be obtained using Eq. (17.73); that is,

i(t)=8.5833+8.73sin⁑(2Ο€β‹…100tβˆ’89.84∘)i(t) = 8.5833 + 8.73 \sin(2\pi \cdot 100t - 89.84^{\circ})
  • 0.1017 sin(2\pi \cdot 200t - 83.06^{\circ})
  • 0.068 sin(2\pi \cdot 300t - 82.35^{\circ}) + \cdots mA
  1. Evaluate. We can also use the FFT approach to cross-check our result. The current marker is inserted at pin 1 of the inductor as shown in Fig. 17.39. Running PSpice will automatically produce the plot of I(L1) in the PSpice A/D window, as shown

Figure 17.39 Schematic of the circuit in Fig. 17.38.

Figure 17.40 For Example 17.13: (a) plot of i(t), (b) the FFT of i(t).

in Fig. 17.40(a). By double clicking the FFT icon and setting the range of the X-axis from 0 to 200 Hz, we generate the FFT of I(L1) shown in Fig. 17.40(b). It is clear from the FFT-generated plot that only the dc component and the first harmonic are visible. Higher harmonics are negligibly small.

One final observation, does the answer make sense? Let us look at the actual transient response, i(t) = (9.549eβˆ’0.5*t* βˆ’ 9.549) cos(200Ο€t)u(t) mA. The period of the cosine wave is 10 ms while the time constant of the exponential is 2000 ms (2 seconds). So, the answer we obtained by Fourier techniques does agree.

  1. Satisfactory? Clearly, we have solved the problem satisfactorily using the specified approach. We can now present our results as a solution to the problem.

A sinusoidal current source of amplitude 4 A and frequency 2 kHz is applied to the circuit in Fig. 17.41. Use PSpice to find v(t). Practice Problem 17.13

Answer: v(t) = βˆ’150.72 + 145.5 sin(4Ο€ β‹… 103 t + 90Β°) + β‹― ΞΌV. The Fourier components are shown below:

Figure 17.41 For Practice Prob. 17.13.

FOURIER COEFFICIENTS OF TRANSIENT RESPONSE V(R1:1)

DC COMPONENT = -1.507169E-04
HARMONIC
NO
FREQUENCY
(HZ)
FOURIER
COMPONENT
NORMALIZED
COMPONENT
PHASE
(DEG)
NORMALIZED
PHASE (DEG)
12.000E+031.455E-041.000E+009.006E+010.000E+00
24.000E+031.851E-061.273E-029.597E+015.910E+00
36.000E+031.406E-069.662E-039.323E+013.167E+00
48.000E+031.010E-066.946E-028.077E+01-9.292E+00