The Analysis limits dialog box looks like this:
Step 1: tmax ≥ 1/fmin
Step 2: Min DT ≤ .001/fmin
Step 3: Set X expression to F
Step 4: Set X Range to 5*DF
Figure 24-2 The FFT1 Analysis Limits dialog box
Step 1:
The DSP functions depend upon a good choice of the sampling frequency, DF, and a sufficient number of data points, N. The value of DF is
DF = F1 = 1 / tmax
The format of the Time Range field is:
<tmax>[,<tmin>]
If tmin is zero, as it usually is, then <tmax> is just the value of the Time Range field. Then,
DF = F1 = 1 / Time Range value.
This requires that:
tmax ≥ 1/FMIN where FMIN is the smallest expected harmonic.
This necessity is embodied in Step 1:
Step 1: Set tmax ≥ 1/FMIN
If you're unsure of what FMIN is, assume it is equal to the lowest frequency of any input signal sources present in the network. If there are no sources present, as for example, in an oscillator, use the expected oscillator frequency.
Step 2:
The accuracy of the DSP will be controlled by the minimum time step. The smaller the better, but the smaller the DT the longer the analysis will take. As a good rule of thumb make DT 0.1% of the period of the FMIN. This leads to Step 2.
Step 2: Set the Minimum Time Step to 0.001 / FMIN.
Step 3:
For any DSP with a time domain argument, such as FFT and HARM, you must have F (frequency) for the X expression: This leads to Step 3.
Step 3: Set the X expression to F.
Step 4:
If N is large, then the horizontal axis automatically scales to:
N*DF
This is usually too compressed to see the frequencies of interest. This leads to Step 4.
Step 4: Set the X Range to a small multiple of DF, say 5*DF to 20*DF.
Step 5:
DSP functions assume that the waveform is periodic. If the circuit has non-peri- odic initial transients, they will generate errors in the DSP calculations. Remove these by using the DSP dialog box. Since this circuit has no capacitors or inductors, there are no initial transients, so the precaution is not necessary here.
Step 5: Set the Lower Time Limit in the DSP Parameters dialog box to exclude initial transients.
608 Chapter 24: Fourier Analysis and Digital Signal Processing
Press F2 to run the simulation. The results look like this:
Figure 24-3 The graph with tmax = 1u
The second graph, showing the HARM(V(1)), produces the expected results:
DC |
0 |
1.5 |
1 |
1Mhz |
1.0 |
2 |
2Mhz |
2.0 |
3 |
3Mhz |
3.0 |
To illustrate the impact of changing tmax, change Time Range to 10u and change the X Range of the first waveform, V(1) to 10u. Press F2 to run the analysis:
Figure 24-4 The graph with tmax = 10u
Notice that the HARM() function still correctly plots the 0Mhz, 1MHz, 2MHz, and 3Mhz values, but the THD function has changed. As specified the THD function uses the first harmonic or reference frequency. Because we changed tmax from 1u to 10u, the first harmonic frequency changed:
Old first harmonic = 1Meg = 1/1u.
New first harmonic = 100K = 1/10u.
The reference frequency shifted from 1Mhz to 100Khz.
To avoid this problem, you can specify the optional second parameter, FR. For example, in this case we would use:
THD(HARM(V(1)),1MEG)
The program scans the N*DF values and finds a match at N=10 because
10*DF = 10*100Khz = 1Mhz.
It then uses the 10th harmonic (1Mhz) as the THD reference frequency. The plot then looks like this:
Figure 24-5 The graph with tmax = 10u and FR = 1Mhz
Notice that the THD now shows the expected values of 100% at 1Mhz, 200% at 2Mhz, and so on.
610 Chapter 24: Fourier Analysis and Digital Signal Processing
The DSP Parameters dialog box
Normally the FFT parameters N and DF are obtained implicitly from the analysis dialog box. That is, DF = 1/ <tmax> and N = the binary number closest to the actual number of data points used in the analysis.
To obtain more control, use the DSP dialog box. This dialog box is accessed from the Transient or AC menu. The transient analysis version looks like this:
Figure 24-6 FFT7 transient analysis DSP dialog box
The AC analysis version looks like this:
Figure 24-7 FFT7 AC analysis DSP dialog box
Each of these dialog boxes lets you specify the time or frequency range to apply the DSP function to and the number of data points to use in the FFT routine. The ability to limit the time range is useful in transient analysis, where it is used to eliminate initial transients in the waveform being analyzed.
To illustrate how this is done, load the file FFT7. Run transient analysis. The screen looks like this:
Figure 24-8 The graph with the initial transients
The plot of V(B) includes initial, non-periodic transients. The FFT is meant to be applied to periodic waveforms and any lack of periodicity shows up as spurious low frequency harmonics. To eliminate the transients and the attendant harmonics, open the DSP dialog box. Select the DSP Parameters item from the Transient menu and click the On button in the dialog box. Click on the OK button. This enables the settings already stored there, shown in Figure 24-6. These values specify that all DSP functions are to be windowed from 200ms to 400ms. This means that the portion of the waveform prior to 200ms is to be discarded. The portion from 200ms to 400ms is to be retained. The DSP dialog box also specifies the value of N, the number of data points to be used in the FFT routines.
Press F2 to rerun the analysis. The results look like Figure 24-9.
612 Chapter 24: Fourier Analysis and Digital Signal Processing
Figure 24-9 The graph without the initial transients
With the DSP dialog box enabled, the procedure used is this:
1.Remove the 0-200ms portion of the V(B) waveform.
2.Create a new waveform, by interpolating 1024 equally spaced points from the old waveform.
3.Apply the HARM function to this new waveform.
The top part of the graph shows the truncated, interpolated V(B) waveform with its 0-200ms portion removed. The bottom part shows the HARM(V(B)). With the removal of the waveform transient and its spurious harmonics, the true harmonic content can now be clearly seen.
614 Chapter 24: Fourier Analysis and Digital Signal Processing
What's in this chapter
This chapter describes the various libraries found in Micro-Cap. It explains how they are created, edited, and used:
This chapter describes:
•The Shape library
•The Component library
•The Model library
•The Package library
Features new in Micro-Cap 7
• The use of internal paths (folders) for data and libraries
The Shape library
The Shape library contains the graphical shapes used in schematics to represent components. Each shape is comprised of one or more graphical primitives. Shapes are created, edited, and maintained by the Shape editor. The name of the file that holds the standard Shape library is called STANDARD.SHP. This file is found on the same directory as the MC7.EXE program.
It is possible to have more than one shape library. Multiple libraries can be maintained and viewed with the Shape editor, but it is recommended that the original shape library, STANDARD.SHP, be left unmodified in its original state.
The Package library
The Package library contains the pin and package information needed to create netlist files for interfacing with external PCB packages. For each component that is included in a PCB netlist file, there must be an entry in the Package library. These entries are created, edited, and maintained by the Package editor. The name of the file that holds the original Package library supplied with MC7 is called STANDARD.PKG.
The Component library
Component libraries provide the circuit parts used in MC7 schematics. A component library stores the name of each component, the shape it uses, the electrical definition, component text placement, and pin information. All components, from resistors to macros and SPICE subcircuits are selected from a component library. There can be more than one component library file. The name of the original component library file supplied with MC7 is STANDARD.CMP. It is found on the same directory as the MC7.EXE program.
The library itself is organized hierarchically into these groups:
Analog Primitives
Analog Library
DigitalPrimitives
Digital Library
616 Chapter 25: Libraries