Analog Filter Design Linear
Filters and Active Feedback
(2007-06-08) Complex Pulsatance and Complex Amplitudes
Confusingly, complex pulsatance is often called complex frequency.
Technically, a (real) pulsatance is a rate of phase change per unit of time.
It's expressed in angular units (radians or degrees) per unit of time (second).
Pulsatance is also commonly called angular frequency.
On the other hand, frequency
is what pulsatance becomes when phases are expressed in cycles
(one cycle is a phase change of 360° or
2p radians).
The modern convention is to express a pulsatance
(preferably denoted by the symbol w)
in radians per second (rad/s) and the corresponding frequency
(preferably denoted by the symbol n) in hertz
(Hz, or "cycle per second").
w = 2p n
In electrical engineering, the letter "i" is often used to denote
a current intensity. It's thus unavailable as a name for
the unit vector along the imaginary axis
of the complex plane.
So, the letter "j" is used instead for that purpose.
The square of that imaginary number is -1.
It's to the number 1 (unity) what a step sideways
to the left is to a step
forward. Refrain from calling this "the"
square root of -1.
j^{ 2} = -1
The value at time t of a pure sinewave signal of frequency
n
and/or of pulsatance
w = 2pn
can be conveniently represented as the real part of the following expression, where
s is equal to the imaginary pulsatance
jw.
|A| exp ( jq + s t )
=
|A| cos ( q + wt ) + j (...)
In this, A is a positive real number and
q is called the
phase of the signal.
The number A = |A| exp(jq)
is called the complex amplitude of the signal and the value of
the signal at time t is therefore simply the real part of:
A exp ( s t )
Therefore, the complex amplitude of the signal's
derivative is A s.
Likewise, the complex amplitude of the second derivative is
A s^{ 2}, etc.
A slight generalization can be made
by considering that the above remains true even if
s is a complex number with a nonzero real part
s.
s = s + jw
= -p + jw
s is called the damping constant.
A negative value of s (a positive p)
does translate
into a signal which is a damped sinewave, like
e^{ -pt }cos(wt).
This observation may be construed as the basis for
Oliver Heaviside's
operational calculus, which characterizes circuits by their reaction to
nonoscillatory decaying signals (p>0, w=0).
This approach rests on the co-called
Laplace transform
(and its inverse). From a mathematical standpoint,
such an analysis (which may be quite convenient)
is just as sound as the more "physical" one based on sinewave
signals, involving the Fourier transform
(and its own inverse).
Either approach yields results applicable to any signal whatsoever.
(2007-06-10) Resistance, Reactance, Complex Impedance The complex number characterizing a linear dipole at a fixed frequency.
A dipole is defined as a current-conserving two-terminal device
(the total electric charge inside the
device does not change).
Each terminal may also be referred to as an electrode
or a pin.
One of them is (somewhat arbitrarily) called "input", the other is the "output" terminal.
Whatever current enters the input goes out the output; this quantity is the
current (i) through the dipole.
The difference between the tension (voltage) of the input electrode and the output
tension is called the voltage (u) across the dipole.
A dipole for which u is proportional to i, is called a
linear dipole.
The coefficient of proportionality
between u and i is the impedance (Z).
u = Z i
In this, Z is a complex number which may depend
on the operating complex pulsatance (s) defined above.
For example, Z may be equal to s multiplied by a (real) constant L
when the voltage is proportional to the derivative
of the current
(such is the case for a perfect inductor of inductance L,
as discussed below).
Operating at a given imaginary pulsatance
s = jw,
the dipole's resistance is defined as the real part
of its impedance Z (the aforementioned perfect inductor
has zero resistance). The imaginary part of an impedance
is called reactance.
A nonzero reactance at (imaginary) pulsatance s indicates that
the current and the voltage are out of phase at the corresponding operating
frequency.
Resistor
A linear dipole whose impedance is a real number R which does not depend
on the frequency of the signal is called a pure resistor
of resistance R.
Practical resistors are never quite ideal,
because any conducting element has a nonzero inductance which
may become noticeable at very high frequencies.
Also, there may be a tiny dependence of
R on the amplitude of the signal
(Ohm's law is a very good
practical approximation, but it's not a strict law of nature).
For completeness, we may also mention that resistance may vary greatly with
temperature, so that a high current (which heats up the resistor)
may give the apparence of a change in resistance with the amplitude of
"large signals".
Capacitor
Ideally, a capacitor (or electrical condenser)
is a two-terminal device which stores opposite charges (q and -q)
on two opposing armatures, connected to each terminal.
That charge (q) is proportional to the voltage (U) across the terminals and the
coefficient of proportionality is the condenser's capacity (C).
q = C u
We discuss elsewhere the physical basis for that
relation and how the capacity (C) can be computed from geometric parameters
and/or from the characteristics of the dielectric material separating
the conducting plates (armatures).
Strictly speaking, the charge on each armature is proportional to its
absolute voltage (with respect to an "infinitely distant" ground)
so there may be a bias in the actual charges stored on each armature.
However, the only important practical quantities are
variations in the charges (i.e., currents) and/or
differences in voltage, so the above fiction is an adequate description.
Inductor
(2007-06-07) Quality factor (Q)
The ratio of maximal energy stored to power dissipated.
The quality factor Q of a system reacting to a periodic excitation
is the ratio of its maximum energy to the average energy it
dissipates (per radian of phase change).
(2007-06-09) Nullators and Norators
Strange dipoles embodied by active electronic components.
I first heard about the following approach to elementary analog electronic design
in the late 1970's at Ecole Polytechnique (X).
It was a novelty at the time.
In an electronic circuit, a dipole is defined as a two-terminal component;
whatever current enters one terminal goes out the other.
Normally, such a dipole is characterized by how
the current through it varies with time
as a function of the voltage across it (or vice-versa).
The characteristic
of an ordinary dipole thus imposes one
constraint between current and voltage...
However, two types of extraordinary dipoles may be considered which
greatly simplify the design of some active systems which could not otherwise
be modelized by dipoles alone... One such beast is called a
nullator (symbol -o-)
and imposes two constraints: Zero current, zero voltage.
On the other hand, a so-called
norator dipole
(symbol -¥-)
imposes no constraints at all: Any current, any voltage.
Neither of those can be realized by itself but they can appear in
complementary pairs which make the total number of constraints just right
(i.e., one constraint per dipole connecting two nodes).
For example, a short-circuit (zero voltage, any current) can be considered to
consist of a nullator and a norator in parallel.
An open circuit (zero current, any voltage) consists of a nullator and a
norator in series.
Less trivially, a properly polarized high-gain
transistor is approximately equivalent to a norator from collector (C)
to emitter (E) and a nullator from base (B) to emitter (E).
A nearly perfect embodiment of a useful nullator-norator combination
is the popular type of subsystem known as an operational amplifier.
The gain of an operational amplifier is normally so large that
some feedback must somehow occur which forces the
two high-impedance inputs of the amplifier to be at nearly the same voltage
(or else the output "saturates" at either the lowest or the highest value allowed).
The amplifier's inputs may thus be construed as the
two extremities of a nearly perfect nullator.
Conversely, the amplifier's output can be viewed
as one extremity of a norator connected to the system's ground.
In practice, of course, the circuit will only be stable with the proper choice
of amplifier inputs for the extremities of the nullator
("inverting" vs. "non-inverting" input).
Nevertheless, the nullator-norator approach allows a quick preliminary design
before final stability issues are addressed.
(2007-06-07) Corner Frequency & first-order rolloff (20 dB / decade)
First-order low-pass RC filter and its half-power bandwidth.
At left is the standard first-order passive RC low-pass attenuator
(usually, G = 0).
At zero output current, the input voltage
u is to R+Z what the output v is to Z. In other words:
u / v = 1 + R/Z =
1 + R (G+jwC)
The ratio v/u = H(s)
expressed as a function of the complex pulsatance (s)
is called the transfer function.
In this case, it's equal to
1 / (1+RG+RC s).
Introducing the DC attenuation
A = 1 / (1+RG)
and the circuit's characteristic pulsatance
w_{0} = ARC,
we obtain:
H = A / (1 + j x)
The normalized variable is
x = w / w_{0}
= 2pn ( 1/RC + G/C ).
The normalized gain (in dB) of the first-order low-pass filter
is obtained by plotting 20 log(|H|/A) as a function
of x, using a logarithmic scale for x, as shown above.
This diagram is called a Bode plot and is commonly
used to chart the frequency response of any filter.
The above shape is the main reason why
bandwidth is usually defined as the range of frequencies for which
the signal's amplitude is attenuated by no more than a factor of
Ö2 (-3 dB)
from a reference gain (corresponding to low-frequency signals and/or DC
in the case of a low-pass filter).
As the power is the square of the amplitude, such an attenuation
means that the power is divided by 2, so the above is
best called "half-power bandwidth".
This definition does gives directly
the "corner frequency" of any low-pass
Butterworth filter,
including the above first-order lowpass, which is
the simplest Butterworth filter...
The relation isn't so simple in other cases.
(2007-06-07) Second-order low-pass filters
Second-order rolloff is 40 dB per decade
(roughly 12 dB per octave).
The second-order passive RLC low-pass filter at left is like its
first order counterpart, except that
the resistor R becomes the impedance
R+jwL.
Therefore, u/v is
1+(R+jwL)(G+jwC)
u / v = (1+RG)
+ jw (RC+LG)
- w^{2} LC
We may cast this in a normalized form:
v / u = A / [ 1 + l
j w/w_{0} - (w/w_{0 })^{ 2 }]
A =
1 / (1+RG)
2pn_{0} =
w_{0}
=
Ö
1+RG
LC
A = 1 / (1+RG)
is the low-frequency attenuation,
used as the 0 dB reference level in
the above normalized Bode amplitude plot
which charts the variations
of the gain |v/u| in decibels, against the ratio of the pulsatance
w to the nominal pulsatance
(w_{0 })
on a logarithmic horizontal scale.
So normalized, the response of a second-order lowpass filter is
characterized by the so-called damping l.
For the above actual circuit,
it's useful to express l
by introducing the characteristic resistance
R_{0} = Ö(L/C).
l ^{ } =
w_{0}
RC+LG
=
R/R_{0} + R_{0 }G
1+RG
( 1+RG )^{½}
For the common case where G = 0,
this means that l
is simply R/R_{0}.
In the normalized lowpass transfer function
1 / ( 1 + l s + s^{ 2 }) different
values of the damping l
make the corresponding
second-order filter a member of one of the general families discussed
elsewhere on this page:
Damping_{ }
l = 0
Perfect (ideal) resonator, no damping.
R = 0 and G = 0.
Linkwitz-Riley filter:
Two cascaded identical first-order filters.
l > 2
Two first-order filters with distinct
corner frequencies
(whose geometric mean is 1 and
whose sum is l).
To clarify some of the technical literature pertaining to Chebyshev filters,
it's important to distinguish the "corner" frequency (compatible with
the above "nominal" frequency) from what's best called the "cutoff" frequency...
The cutoff frequency of a lowpass "equiripple" Chebyshev filter is defined
as the highest frequency for which the gain is equal to one of the bandpass minima
(all such minima are equal in a Chebyshev filter).
The cutoff frequency coincides with the corner ("nominal") frequency
only in the case of a "natural" Chebyshev filter
(like the 1.25 dB second-order Chebyshev filter plotted above).
For high-ripple Chebyshev filters, the cutoff frequency is higher than the corner
frequency. For low-ripple Chebyshev filters, it's lower
(and the term "cutoff frequency" is not recommended in that case).
(2014-05-20) Two cascaded passive first-order filters
The resulting second-order filter can almost achieve critical damping.
For future reference (and for easy comparison with the
next section) we present this filter with a buffered output.
If the opamp used as a voltage-follower has JFET inputs
(featuring impedances measured in teraohms)
this circuit can effectively be used to hold a voltage for a very long time when
the input goes into a high-impedance state
(as the charges in the capacitors have nowhere to go, then).
The impedance of a capacitor C at pulsatance w
is equal to 1 / (jw).
Using that, it's left as an exercise for the reader to verify the following
relation (HINT: obtain w from v and u from w):
Critical damping is almost achieved when the first two bracketed terms are equal
(R_{1 }C_{1 = }R_{2 }C_{2 })
and the third bracketed term (R_{1 }C_{2 }) is very small compared to that common value
(i.e, the impedance of the first stage ought to be much lower than the impedance of the second one).
This illustrates a fairly general principle:
To cascade several RC filters, we usually want the early stages to
work in a low impedance regime (fairly high current)
so that they can feed small currents to later stages without being significantly affected.
This is a key advantage of active filters; they can always have a low impedance output.
So does the above filter when endowed with its voltage-follower.
Without some active section like this, the output of the filter would be of limited use.
(2007-06-16) The Sallen-Key lowpass filter
Active second-order filters and/or resonators without inductors.
When active components are used for signal processing,
the DC gain of a lowpass filter should be kept close to unity.
A larger gain would impose limitations on the input amplitudes
(in order to prevent saturation of the output signal)
whereas a much smaller gain would worsen the
signal-to-noise ratio
(SNR or S/N).
This second-order active lowpass filter of unity gain
was among the designs introduced in 1955 by
R.P. Sallen and E. L. Key (Lincoln Labs of MIT).
"A Practical Method of Designing Active Filters"
by R.P. Sallen and E.L. Key. IRE Transactions on Circuit TheoryCT-2, 74 -85 (1955)
It can be used as a building block (along with a first-order stage)
to realize all the lowpass filters described on this page,
without using any inductor.
2pn_{0} =
w_{0}
= 1 / RC
l
= _{ } ( x + 1/x )^{ } y
v = u / [ 1 + l
j w/w_{0} - (w/w_{0 })^{ 2 }]
The value of l in a normalized second-order
factor 1/(1+ls+s^{ 2 })
may thus be obtained from any convenient combination of the
parameters x and y.
For example, with equal resistors (x=1) we have
l = 2y
and a second-order Butterworth filter
(l=Ö2)
is obtained for y=1/Ö2
(i.e., C_{1} = 2 C_{0 }).
In practice, capacitors may only be available in a few standard values.
Picking coarse values for the capacitors, we may
use the following formula to compute precise matching values
for the two resistors R_{-}
and R_{+}.
R_{±}^{ } = R ( z
±
Ö
z^{ 2 }-1
^{ })
where ^{ } R =
^{1 /} w_{0}
Ö
C_{0}^{ }C_{1}
and ^{ } z_{ } =
(½ l)
Ö
C_{1} / C_{0}
We just have to choose capacitor values so that z > 1.
The voltage response does not depend on which resistor goes where, but
you may want to make the
input impedance larger (and/or reduce the
power involved) by placing the larger resistance
R_{+} on the input side.
Numerically,_{ } when z is large, the above
expression yields a mediocre way to compute
R_{-} with ordinary
floating-point arithmetic (because subtracting nearly
equal quantities entails a great loss of precision)._{ }
Instead, we compute R_{+} first_{ }
(full precision
is retained when quantities of like signs are added)_{ }
then obtain R_{-} from the
following formula (no precision is lost in multiplications or divisions).
R_{-}
= R^{ 2} / R_{+}
(2007-06-09) Low-pass Butterworth filters
The lowpass filters with the flattest low-frequency responses.
Such filters are named after the British radio engineer
Stephen Butterworth
(1885-1958) who first described them in 1930.
"On the Theory of Filter Amplifiers" (1930) by
Stephen Butterworth Experimental Wireless and the Radio Engineer,
vol. 7, pp. 536-541.
Little is known
[ 1 | 2 ] about the life of Stephen Butterworth (MSc,
OBE).
He served in the British National Physical Laboratory (NPL)
and joined the Admiralty scientific staff in 1921.
He retired from the Admiralty Research Laboratory in 1945 and passed away in
1958.
The normalized transfer function of an order-n
lowpass Butterworth filter
is of the form 1/B_{n}(s) where B_{n}
is a Butterworth polynomial of order n.
n
Normalized Butterworth Polynomial B_{n}(s)
0
1
1
1 + s
2
1 + s Ö2 + s^{ 2}
3
( 1 + s ) ( 1 + s + s^{ 2 })
4
( 1 + s Ö(2-Ö2) + s^{ 2 })
( 1 + s Ö(2+Ö2) + s^{ 2 })
5
( 1 + s )
( 1 + s (Ö5-1)/2 + s^{ 2 })
( 1 + s (Ö5+1)/2 + s^{ 2 })
6
( 1 + s (Ö6-Ö2)/2 + s^{ 2 })
( 1 + s Ö2 + s^{ 2 })
( 1 + s (Ö6+Ö2)/2 + s^{ 2 })
2m
m
[ 1 + 2 s sin
p(2k-1)/2n
+ s^{ 2} ]
Õ
k=1
2m+1
(1+s)
m
[ 1 + 2 s sin
p(2k-1)/2n
+ s^{ 2} ]
Õ
k=1
For any n, | B_{n }(x) | is
Ö2, so the attenuation
of a Butterworth filter at
its corner frequency is always -3 dB
(well, -3.0103 dB, to be more precise).
Cascading two identical lowpass Butterworth filters of order n gives a lowpass
filter of order 2n with a 6 dB attenuation at the corner frequency.
This is particularly useful in combination with a similar highpass filter
tuned to the same frequency...
Since both output amplitudes are halved at that crossover frequency,
their sum remains at the 0 dB level.
Such a feature is desirable in the
design of audio systems, where low frequencies are directed to one loudspeaker
and high frequencies to another.
Modern professional active audio crossovers are often based on a fourth-order
Linkwitz-Riley design (LR-4).
With digital signal processing (DSP)
Linkwitz-Riley crossovers of order 8 are available (LR-8).
The basic idea was credited to Russ Riley
in a paper published by Siegfried Linkwitz in 1976
(both Linkwitz and Riley were HP R&D engineers).
"Active Crossover Networks for Non-coincident Drivers"
Siegfried H. Linkwitz, J. Audio Eng. Soc., vol. 24, pp. 2-8
_{ }(1976).
Linkwitz-Riley active crossovers were first made commercially available by
Sundholm and Rane in 1983.
Nowadays, this may well be the most popular design for professional audio crossovers.
(2007-06-11) Chebyshev and inverse Chebyshev filters
The basic properties of
Chebyshev polynomials can be put to good use
in filter design, by explicitly allowing ripples of amplitude
e in the frequency response.
Those filters are named after the German scientist
Wilhelm Cauer
(1900-1945). They're also called
elliptic filters,
complete Chebyshev filters or Zolotarev filters
to honor the work of
Egor
Zolotarev (1847-1878) whose
results
were applied to filter theory by Wilhelm Cauer in 1933.
(2007-06-12) Legendre filters
"Optimum L filters".
The Optimum "L" filter, or Legendre filter, was introduced in 1958
by Athanasios
Papoulis (1921-2002).
Among all filters with a monotonic frequency response,
the Legendre filter has the maximal roll-off rate.
Its features are thus intermediate between the slow roll-off of a
Butterworth filter (which is
monotonic with unimodal derivatives)
and the faster roll-off of a (non-monotonous) Chebyshev filter.
The Gegenbauer
polynomials are a generalization of the Legendre polynomials (which correspond
to the special case l = ½).
They are named after
Leopold
Gegenbauer (1849-1903).
For a given value of l,
the Gegenbauer polynomials are recursively defined:
(2007-06-10) Bode phase plot. Bayard-Bode relations.
The correlation between phase delay and attenuation slope
If G = |G| exp(jj)
is the complex gain
of a discrete low-pass filter, the following approximative relation holds,
far from its corner frequencies, because it
holds far from the corner frequency of every elementary such filter
(the transfer function of higher-order filters is the product of
transfer functions of order 1 or 2).
j
»
^{p}/_{2}
d ( Log |G| ) / d ( Log w )
The Bayard-Bode relations where developed in 1936 by
Marcel Bayard
(1895-1956, X1919-S).
(2007-06-10) Group delay and Bessel-Thomson filters
Optimizing phase linearity and group delay to preserve signal shape.
The class of
orthogonal polynomials
named after the German mathematician and astronomer
(Friedrich) Wilhelm
Bessel (1784-1846) was only introduced in 1948 by
H.L. Krall and O. Fink.
The filters themselves were first presented by W.E. Thomson in 1949 and are
best called Bessel-Thomson filters (BT for short).
"Delay Networks Having Maximally Flat Frequency Characteristics"
W.E. Thomson. Proc. IEEE, part 3, vol. 96, pp. 487-490 (Nov. 1949).
The group delay of a filter whose gain is
G = |G| exp(jj)
is defined to be:
t_{g} =
- dj / dw
The transfer function is
q_{n}(0)/q_{n}(s)
where q_{n} is the n-th
reverse Bessel polynomial, as tabulated below:
q_{0}(s)
=
1
q_{1}(s)
=
1
+ s
q_{n} =
(2n-1) q_{n-1} +
s^{2 }q_{n-2}
q_{2}(s)
=
3
+ 3 s
+ s^{2}
q_{3}(s)
=
15
+ 15 s
+ 6 s^{2}
+ s^{3}
q_{4}(s)
=
105
+ 105 s
+ 45 s^{2}
+ 10 s^{3}
+ s^{4}
q_{5}(s)
=
945
+ 945 s
+ 420 s^{2}
+ 105 s^{3}
+ 15 s^{4}
+ s^{5}
q_{6}(s)
=
10395
+ 10395 s
+ 4725 s^{2}
+ 1260 s^{3}
+ 210 s^{4}
+ 21 s^{5}
+ s^{6}
(2007-06-11) Gaussian Pulses and Gaussian Filters
Preserving digital pulses in the "time domain".
(2007-06-13) Linear Phase Equiripple Filters
Ripples allow better group delay flatness than with Bessel filters.
These filters are to Bessel filters with respect to
group delay what Chebyshev filters are to
Butterworth filters with respect to
amplitude gain.
In either case,
better pass-band flatness of the frequency response for the desired property
is achieved by allowing some ripples,
foregoing the strict monotonicity featured
in Butterworth filters (for amplitude gain) or
Bessel filters (for group delay).
(2007-06-14) DSL filters (ADSL over POTS)
Allowing POTS bellow 3400 Hz and blocking digital data above 25 kHz.
"Plain Old Telephone Service" (POTS) requires only the voiceband
(300 Hz to 3400 Hz) corresponding to the spoken human voice.
PCM digitalized voice corresponds to
the 0-4 kHz range (8 kHz sampling rate).
This is strictly for standard telephony (voice).
By contrast, "CD quality" digital audio involves a 44.1 kHz
sampling rate, corresponding to an upper audio limit of 22.05 kHz.
The "audio range" is most often quoted as going from 20 Hz
to 20 kHz, although you've certainly not heard a 20 kHz tone since you were
an infant (and never will again, if you ever did)...
The highest vocal note in classical repertoire is G7 (3136 Hz).
The last key on an 88-key grand piano is at 4186 Hz.
The final "twisted pair" which goes to the telephone subscriber is able to carry
a much broader signal, up to 1.1 MHz or more.
ADSL service makes use of that entire 0-1104 kHz band
by dividing it into 256 channels, each 4.3125 kHz wide.
Those channels are numbered from 0 to 255.
The lowest one is the voiceband reserved for POTS.
Next are 5 silent channels which provide a wide gap (from 4 kHz to 25 kHz)
so a simple so-called "DSL filter" can safely block the digital frequencies
(above 25.875 kHz) for POTS devices (telephone and/or FAX).
The remaining 250 channels, from 25.875 kHz to 1104 kHz,
are used specifically for digital service.
With ADSL, there's typically much
more traffic downstream (downloading) than upstream (uploading).
Only a small portion of the bandwidth is allocated to upstream traffic
(normally, the 26 channels from 25.875 kHz to 138 kHz, but this can be increased
to 276 kHz per "Annex M" of the ADSL2 standard).
This explains the "A" for "asymmetric" in the
ADSL acronym;
Such an Asymmetric Digital Subscriber Line is nominally
8.92 times faster
one way (223+1 download channels) than the other (25+1 upload channels).
In practice, a 4 to 1 ratio seems more common nowadays
A third-order lowpass filter with a nominal corner frequency of 3243.375 Hz
will produce an attenuation at 25.875 kHz roughly equal to the
cube of the frequency ratio (1/8).
This means an amplitude ratio of less than 0.002 (-54 dB).
A typical fourth order filter will provide -72 dB.
The characteristic impedance of a telephone line is 600 W.
(2014-05-14) Switched Capacitors
A capacitor C switched between A and B at frequency
n is like a resistor
R = 1 / n.C between A and B.
It's not necessary to have an SPDT switch (single pole, double throw)
as in the conceptual sketch show above.
Instead, we can drive two ordinary switches (SPST) by two non-overlapping signals
which never turn on both switches at the same time.
This allows a charge C(u-v) to be transferred at each switching cycle,
which yields an average current equal to n.C (u-v).
This is precisely the current that would flow if the switched capacitor assembly
was replaced by a resistor of value 1 / n.C
More generally, a single capacitor can be connected via switches to any number of points.