Threephase voltage or current harmonics generator.
 The outputs are marked with an arrow.

The internal common wye point (NUL) may be left floating if not used, depends on the schematic, but it's usually safer to add some connexion to ground.

The three pins at the bottom allow external frequency (FM), amplitude (AM), and phase (PM) control. All have R_{in}=1GΩ.

Anything connected to FM and AM pins overrides internal settings for f and amp.

The PM pin is treated differently: the general displacement is given by V(PM)+phase, where phase is either phi, for the harmonics, or phi[1:3] for each of the fundamentals.

The added/subtracted harmonics with h[1:3] obey the spectrum shape, e.g. if amp=1, N=0, h1=100 (default for the rest) ⇒ 100Hz@10mV_{pk}. The phase affected by any of the h[1:3] is like in the previous point: if the value is 1 (fundamental), then phi controls the phase, else through phi[1:3] for each phase.

sym=<0,1> 
 
Sets the symmetry between phases:
 0 ⇒ asymmetric, i.e. sin(nωt+φ)
 1 ⇒ symmetric, i.e. sin(nωt+nφ) (default)

f 
Hz 
Frequency of the fundamental, default 50 
amp 
V 
Amplitude of the fundamental, default 325 
phi 
rad 
Phase of the harmonics, default 0 
Ro 
Ω 
Output resistance, zero means current source, default 1 
N=±<0:51> 
 
Sets the number of harmonics:
 N>0, N=2k+1 ⇒ odd harmonics, only
 N>0, N=2k ⇒ even harmonics, only
 N<0 ⇒ odd+even harmonics (default 51)
 N=0 ⇒ null output

dc1, dc2, dc3 
V 
Per phase voltage offset, defaults <0,0,0> 
A1, A2, A3 
V 
Per phase amplitude modifier, relative to either amp or V(AM) , defaults <1,1,1> 
phi1, phi2, phi3 
rad 
Per phase fundamental displacement modifier, defaults <0,0,0> 
h1, h2, h3 
 
The values assigned to them represent a harmonic's number. When set, they will:
 subtract the harmonic, if already present
 add the harmonic, if not present
The indices have no meaning except to differentiate the parameters between themselves. Only their values matter. Defaults <0,0,0>

a, b, c,
d, e,
p, q,
xp, xq,
ma, mb 
 
Parameters for the spectrum shaper (see below), defaults <0,0,0,0,0,1,0,1,1,0,0>


tripdv, tripdt 
V,s 
LTspice's specific for Bsources, defaults <100,1u> 
lim 
V 
Internal limits to avoid clipping, default 1g 
The harmonics are generated based on this formula:
s_{n} sets the signum on a cycle basis, where mb determines the period, and ma the offset. Setting both to zero disables the whole signum function. Noninteger values also work. The fundamental is not affected. Here are the outputs, from the 2^{nd} harmonic up, for various settings (low means 1 and high means 1):
And here are a few predefined settings to achieve some commonly found waveforms ("~" means "don't care", and "#" means the ones listed below are for ma=0, mb=0, but variations are possible for mb>1):

N 
a 
b 
c 
d 
e 
p 
q 
xp 
xq 
ma 
mb 
Square wave
All defaults for the rest, set amp=π/4 for unity amplitude 
2n+1 
0 
~ 
~ 
0 
0 
1 
0 
1 
1 
# 
# 
Reverse sawtooth
All defaults, N>0 ⇒ symmetric waveform, N<0 ⇒ asymmetric waveform. For zero starting sawtooth, set d=1/2, p=1/2, even or odd N

±2n 
0 
~ 
~ 
0 
0 
1 
0 
1 
1 
# 
# 
UPS square wave
Variable width x=(0..0.5) 
2n+1 
0 
~ 
~ 
x 
0 
1 
0 
1 
1 
# 
# 
Trapezoidal
Fixed slope, variable amplitude x=[2..∞) 
2n+1 
0 
~ 
~ 
1/x 
π/2 
1 
0 
2 
1 
# 
# 
Hilbert transform of a square wave 
2n+1 
0 
~ 
~ 
1/2 
π/4 
1 
0 
1 
1 
# 
# 
Alternating sinc impulses
Single (x=2), or variablyspaced double (x>2)

2n+1 
0 
~ 
~ 
1/x 
π/2 
1 
0 
0 
1 
# 
# 
Two steps square sine
x=(1..2) varies lower step's amplitude, y=(0..0.5) upper step's width

2n+1 
1 
2 
π/x 
y 
0 
1 
0 
1 
1 
# 
# 
Lightning 
~ 
1.618 
0.123 
0.321 
0.333 
0.258 
1 
0 
1 
1 
0.618 
2.718 

