There is no such thing as a "frequency domain" there is only dv/dt. This artificial notion was born in 1807, when mathematician Joseph Fourier announced to the French Academy a discovery so remarkable it was not believed by many in that distinguished audience. He claimed that any real periodic function F(θ), no matter how erratic its graph (including discontinuities!), may be decomposed into a sum of sinusoidal waves. For example, with a period of 2π, the Fourier series is
where
The function's period, 2π in this case, is the fundamental period of the Fourier series, and the other fractionally related components, with periods of 2π/n in this case, are the harmonic periods. Fourier's discovery of how to decompose virtually any waveform into a collection of tractable cos(x) and sin(x) leads to a lot of useful engineering analysis.

Square wave decomposed into Fourier series approximations.
For instance, let's say you have a circuit block with some nonlinear operation. Fourier's discovery guarantees that when you apply a sinusoidal wave to the input, the output signal will contain only some DC offset, a fundamental sinusoid at the same period as your input, and harmonic sinusoids at integral fractions of the input period, and nothing in between. Furthermore, since the input signal has its own Fourier series, virtually no matter how wild the signal is, if it is periodic then the output will be composed of only these components at exactly these periods. Of course, the reciprocal of period is frequency, and graphing Fourier components along an x-axis labeled "frequency," which is more convenient than the same graph labeled "period," leads to the utterly artificial notion of a "frequency domain" representation of a periodic signal.
To the scientist, harmonic balance is an analytic technique for solving nonlinear ordinary differential equations with periodic solutions. In the classic pendulum problem, for example, we assume its steady-state motion will have a fundamental period combined with "deviations" having harmonic periods simply assume this formula (a Fourier series) and solve for the coefficients.
To an electrical engineer, the numeric version of harmonic balance is a quicker solution for many circuit simulation problems. Since real circuits have an upper frequency limit, their operating waveforms also have an upper limit, which limits the number of Fourier components needed to accurately represent them. For circuits in steady-state operation, the "time domain" and "frequency domain" are merely two sides of the same coin, equivalent representations of the evolution of signals. Even the electrical laws of Ohm and Kirchoff are maintained; E = I * R becomes Erms = Irms * R for each Fourier component.
So why be bothered to use harmonic balance techniques? Two pretty good reasons: accuracy and speed. The accuracy advantage increases as circuits get more linear, as these circuits use fewer and fewer Fourier components to describe their operation. At the limit you only need one component, and its coefficient is called "gain." To describe the same output signal in the time requires an infinite set of time-voltage pairs tracing the sinusoid anything less would be inaccurate.
Also, tedious operations like integrating the current in a capacitor becomes simple arithmetic, calculated exactly using Fourier components. Speed comes in two forms, the first being a byproduct of accuracy manipulating only a few Fourier components instead of many, many voltage samples. Speed also comes from classes of circuits for which we desire the steady-state result for example, the steady mode of an oscillator after being powered up. Since the Fourier series relies on periodic operation, a harmonic balance solution zooms to the "time goes to infinity" answer without having to wade through the start-up gyrations that a time-based solution would.
Furthermore, the higher the oscillator's "quality factor" Q (higher Q means more stability, lower phase noise), the smaller the divisions of each cycle a simulator would need to process to maintain accuracy (Q represents the fraction of energy lost over each cycle of oscillation). Yet increasing Q also increases the number of cycles until the circuit reaches steady state. These factors combine so that the "wall clock" time taken by Spice increases proportionately to the square of Q for oscillator problems.
So what is the quantitative difference between harmonic balance and Spice? The error in their respective solutions comes from different trade-offs. The error in a harmonic balance solution is energy above some cut-off frequency, while the error in a Spice-type transient solution is a tolerance on the waveform at any point in time. Both Spice and harmonic balance are sampled-data systems. Spice varies its sample rate to "work around the corners" of waveforms. Harmonic balance increases its sample rate, by increasing the number of Fourier components, to do the same.
Between the samples, each method has an interpolation function to assume the shape of the waveform. Spice's interpolating function is a straight line, or low-order polynomial. This is appropriate for waveforms with corners and straight segments, but continuously varying waveforms need more samples for Spice to be accurate. Harmonic balance uses trigonometric interpolation, provided by the Fourier series, to give the smallest mean-squared error for the waveform up to the cut-off frequency. Of course, harmonic balance relies on there being a fundamental period to the stimulus of the circuit, whereas Spice allows arbitrary stimulus.
From these differences we can see that what is difficult for Spice is easy for harmonic balance, since the techniques take complementary approaches to solving the circuit response. Since the error in Spice-type transient solution is a tolerance on the waveform, there is actually a bit of error in every data point once you sample data with error you are stuck with that error forever.
At best, transient data will have a small, random error at every point, which equates to an error "noise floor" in the "frequency domain." This limits your ability to extract useful signals, as design information, from the noise introduced by transient errors. To lower the noise floor, you need more samples, which Spice will gladly generate. But often you can't wait for the simulation to finish, nor have enough disk space to hold the raw data, nor enough computer memory to extract the detail. In this respect, harmonic balance has a clear advantage.
Beyond what Fourier discovered, harmonic balance has been extended in two important ways to benefit the electrical engineer. First, more than one fundamental period is allowed (called "multi-tone" simulation) and the math still holds. The fundamentals don't even need to be integral multiple of a common period. Accuracy is maintained by accounting for harmonics and products (desired components at sum and difference frequencies, and undesired responses or "spurs") generated by nonlinear operation.
This allows simulating circuits, such as mixers, that translate signals and noise from one frequency range to another. Second, the steady-state "requirement" can be relaxed to include Spice-type transient methods. These hybrids can be though of as using harmonic balance for the carrier and Spice for the modulation envelope of circuit operation. It's actually more complicated than that, but this description imparts the essence of the beast.
One of the troublesome points of developing and using harmonic balance techniques is modeling the devices we use in our circuits. Linear devices such as resistors and capacitors are simple. Likewise transmission lines, which cause so much trouble in Spice-type simulators, have simple representations in the "frequency domain" because their distributed operation is succinctly described by complex exponentials, which leads directly to trigonometry using Euler's formula. It's the nonlinear devices, like diodes and transistors, that are a headache. We need the Fourier transform of the device equations, but in general these are unknown for arbitrary nonlinear functions. For example, the IV relation for a semiconductor junction is:
where nf is the forward emission coefficient and Vth is the thermal voltage. The nth harmonic response to a narrowband input is found by calculating the Fourier series term for this frequency:
The function In(*) is the modified Bessel function of the first kind, which is defined via imaginary arguments of Bessel function
In(z) = i-nJn(iz)
which has many equivalent integral representations and an equivalent convergent series that turns out to be computationally useless for real arguments x >> 1. The answer to our integral problem is yet another integral with a name! What a headache. And this is for the lowly diode, let alone the complicated MOS models like BSIM.
How this has been handled in harmonic balance simulators, traditionally, is to convert "frequency domain" signals to their "time domain" equivalent. These signals are applied to the Spice model equations to generate a "time domain" response, which is then converted back to the "frequency domain" for the simulator's use.
Usually a numerical algorithm called the fast Fourier transform (FFT) is used, with care taken to maintain accuracy during the conversions, which, like any sampled-data system, suffers from signal aliasing. When more than one fundamental period is involved (multi-tone simulations), the dimensionality of the Fourier transforms increase to cover the new degree of mathematical freedom. Unfortunately, the computational cost of a 2D transform is the square of normal FFT, a 3D transform is a cube of the cost, and so on.
But there is hope. For the past few months I have been developing an algorithm to process the Spice models, extracting a kernel formula that directly gives their "frequency domain" response. This kernel comes from a mathematical equivalence I noticed in April of this year and seems to be just one of those things that maybe others had noticed, too, but I was also primed to know how to exploit it for circuit simulation.
For traditional "single tone" harmonic balance, this advance is just a speed and accuracy improvement over current techniques. The bigger win is anticipated for multi-tone simulation, where formulas exist for directly calculating frequency conversion products without resorting to multi-dimensional FFTs. I am currently building this algorithm into a customized version of U.C. Berkeley Spice, thereby extending the traditional DC, AC, noise, and transient analyses to handle the modulated signals that are found in modern, digital communications circuits.
Paul Tuinenga was a founder of MicroSim Corp. and Avista Design Systems. He was most recently a senior staff services applications engineer at Cadence Design Systems.