OpenFilters Open-Source Software For The Design, Optimization, and Synthesis of Optical Filters
OpenFilters Open-Source Software For The Design, Optimization, and Synthesis of Optical Filters
The design of optical filters relies on powerful computer-assisted methods. Many of these methods are
provided by commercial programs, but, in order to adapt and improve them, or to develop new methods,
one needs to create his own software. To help people interested in such a process, we decided to release
our in-house software, called OpenFilters, under the GNU General Public License, an open-source
license. It is programmed in Python and C⫹⫹, and the graphical user interface is implemented with
wxPython. It allows creation of multilayer and graded-index filters and calculation of reflection, trans-
mission, absorption, phase, group delay, group delay dispersion, color, ellipsometric variables, admit-
tance diagram, circle diagram, electric field distribution, and generation of reflection, transmission, and
ellipsometric monitoring curves. It also provides the refinement, needle, step, and Fourier transform
methods. © 2008 Optical Society of America
OCIS codes: 310.0310, 310.1620, 310.4165, 310.5696, 310.6805.
冋 册
sign methods; we present only the main equations
used by OpenFilters and give references for inter- cos i (i兾i)sin i
Mi ⫽ , (1)
ested readers to learn more. We then present a very ii sin i cos i
short user guide and the structure of the implemen-
tation of OpenFilters. Finally, we outline some plans where
for the future development of OpenFilters and indi-
再
cate how one can collaborate in its development.
Ni cos i s polarization
i ⫽ (2)
Ni兾cos i p polarization
2. GNU General Public License
The GPL [4] is an open source license, or free software is the pseudoindex of the layer,
license. It gives the user the freedom to access the
source code of the program and to modify it to suit its 2
needs. The user does not need to distribute the mod- i ⫽ N d cos i (3)
ifications made to OpenFilters. But, if one decides to i i
do so, the derived work must also be released under
the GPL. One should carefully read the GPL before is the phase shift of the wave inside the layer, i is the
distributing any work derived from OpenFilters. angle of propagation in the layer, and is the wave-
The GPL does not apply to the results obtained length of light in vacuum.
with OpenFilters. It can be used to design filters for According to the Snell–Descartes’ law, ␣ ⫽ Ni
commercial applications, and the results can be pub- sin i is constant [7]. To avoid computer intensive
lished under different conditions. However, we would trigonometric function calculations, the pseudoindi-
be grateful if you refer to this article or our website ces and phase shift can be calculated using
when publishing results obtained with OpenFilters.
Optical Filters
2 2
In this section we provide basic information to un- i ⫽
冑Ni ⫺ ␣2di (5)
derstand how OpenFilters designs, optimizes, syn-
thesizes, and calculates the optical properties of
interference filters. instead of Eqs. (2) and (3), respectively.
The characteristic matrix describing the multi-
A. Calculation of the Optical Properties layer is
冋 册
As shown in Fig. 1, a classical optical filter consists of
m11 m12 1
a stack of layers of thicknesses di and indices of re- M⫽ ⫽ 兿 Mi, (6)
fraction Ni between an incidence and an exit media of m21 m22 i⫽q
indices of refraction Ninc and Nex, respectively.
OpenFilters calculates the filter properties using where q is the number of layers, and the product is
the characteristic matrix approach developed by taken in reverse order since the matrices of upper
Abelès [5] and presented in detail in most optical layers must be multiplied on the left.
coating textbooks such as Macleod’s [6]. In this exact The amplitude reflection and transmission coeffi-
approach, the ith layer is represented by cients of the multilayer are
where ⫽ 2c兾 is the angular frequency and c is the where RF and TF are the reflectance and transmit-
speed of light in vacuum. There are analytical formu- tance of the front side, RFR and TFR are the reflectance
las to calculate the GD and GDD, but it is impossible to and transmittance of the front side in reverse direc-
calculate them analytically from the characteristic ma- tion, RB and TB are the reflectance and transmittance
trix of a multilayer. For that reason, OpenFilters cal- of the backside,
i ⫽ Im 冉 2 2
冑Nsub ⫺ ␣2dsub 冊 (20)
multiple points in each index interval. Then, for each
index interval, linear interpolation is used to deter-
mine the points a and b, where the index profile
crosses the predefined index levels nj and nj⫹1, defin-
is related to the absorption in the substrate, and Nsub
ing a small section of the index profile. Finally, that
is the index of refraction of the substrate.
section of the index profile is replaced by two sublay-
The different reflection and transmission coeffi-
ers of thicknesses dj and dj⫹1 so that
cients can be calculated from Eqs. (9) and (10) while
considering appropriate incidence and exit media. It
should also be noted that, since the characteristic dj ⫹ dj⫹1 ⫽ b ⫺ a, (21)
matrices Eq. (6) are persymmetric, the product
兿i⫽1 Mi can be obtained from 兿i⫽q
冕
q 1 b
Mi by simply inter-
changing the diagonal elements. njdj ⫹ nj⫹1dj⫹1 ⫽ n(z)dz, (22)
The situation is more complicated for ellipsometry a
since the incoherent effect of the front side and back-
side phase shifts must be considered. In that case, where the integral is evaluated using the trapezoidal
OpenFilters uses the formalism of Yang and Abelson rule. This guarantees that the discretized filter pre-
[13]. serves both the physical thickness and the optical
thickness of the original index profile.
C. Graded-Index Filters
The index of refraction of graded-index filters varies D. Optimization of Multilayer Filters
continuously throughout the thickness. It is possible It is often difficult, or even impossible, to manually
to treat some simple cases analytically, but this ap- design a filter respecting all the specifications for a
proach is very limited. A more general approach con- given application. However, it is possible to optimize a
sists in approximating the index gradient by a series filter using refinement [1]. In this method, the designer
of very thin sublayers [14]. The thickness of the sub- provides a starting design whose properties are suffi-
layers must be small enough to correctly represent ciently close to the specifications. Then, an optimiza-
the index profile, but large enough to limit calculation tion algorithm is used to adjust the thickness of the
time and avoid numerical errors. layers and eventually their index of refraction.
The discretization of the index profile is usually In addition to the starting design, the designer
accomplished by a series of sublayers with constant must provide targets describing the specifications.
physical or optical thickness. This approach is simple The targets can be any property computable from the
since the software needs to calculate only the function parameters of the filter; usually, these are the reflec-
generating the index profile at equally spaced points. tion, the transmission, phase properties, or the color
However, when one wants to calculate the properties defined for some polarization and angle of incidence.
of a filter made of real materials with dispersive re- Depending on the application, it may be necessary to
fractive index, it is necessary to calculate the disper- define a target at a single wavelength or over a range
sion of the index for every sublayer. To avoid these of wavelengths. In the latter case, the target must in
repeated calculations, OpenFilters discretizes the in- fact be discretized and defined at a finite number of
dex profile using predefined index levels. wavelengths. Using the targets, it is possible to define
The discretization process is shown in Fig. 3. First, a merit function (MF), representing the quality of a
the index profile n共z兲 is calculated at a large number design, that the refinement must minimize. OpenFil-
of points with a thickness interval chosen to provide ters uses
i⫽1
冉 Bi ⫺ B
⌬Bi 冊
i
,
2
(23)
According to Eq. (6), the derivative of the matrix of
the multilayer relative to a parameter ak of the jth
layer is
where m is the number of targets, Bi is a property of
i is the target value for that property, and dM j⫹1 dMj 1
interest, B ⫽ 兿 Mi 兿 Mi. (31)
⌬Bi is the tolerance for that property. dak i⫽q dak i⫽j⫺1
The optimization algorithm used by OpenFilters is
the Levenberg–Marquardt algorithm [15]. The prop- If parameter ak is the thickness dj of the layer, Eqs.
erties of a filter that are optimized, the thickness and (1) and (5) give
the index of refraction of the layers, are represented
by a vector a ⫽ 关a1, a2, . . .兴. The Levenberg– dMj dMj dj
Marquardt algorithm calculates the first derivatives ⫽ , (32)
ddj dj ddj
of the merit function with regard to every parame-
ter ak, where
d2
dak
⫽ 2兺
m
冋
i⫽1 (⌬Bi)
i dBi
Bi ⫺ B
2 da
k
, 册 (24)
dMj
dj
⫽
i 冋
⫺sin j (i兾j)cos j
j cos j ⫺sin j
, 册 (33)
冦
dak Re(Nm) dak Nj
s polarization
dj 冑N 2
⫺ ␣2
冉 冊
j
According to Verly [17], the derivative of the am- ⫽ ,
plitude reflection coefficient r relative to the param- dNj Nj Nj2
2⫺ p polarization
eter ak can be calculated using 冑Nj2 ⫺ ␣2 Nj2 ⫺ ␣2
冉 冊
dr dM (37)
⫽ Tr , (27)
dak dak r dj 2 Nj
⫽ d. (38)
where Tr is the trace and dNj 冑N2 ⫺ ␣2 j
j
r ⫽
t
冋 Ninc(1 ⫺ r) ⫺(1 ⫹ r)
2Ninc NincNex(1 ⫺ r) ⫺Nex(1 ⫹ r)
. 册 (28)
Note that the index of refraction of a layer is usually
defined by its real part nj,0 ⫽ Re共Nj,0兲 at a reference
wavelength 0. In that case,
Using a similar formalism, the derivative of the am-
plitude transmission coefficient can be calculated us- dMj dMj dNj
⫽ , (39)
ing dnj,0 dNj dnj,0
dt
dak
⫽ Tr
dM
,
dak t 冉 冊 (29)
where dNj兾dnj,0 is determined from the dispersion of
the refractive index of the material.
OpenFilters also offers the possibility to refine the
where index of refraction of a layer while keeping its optical
thickness constant [18]. Details will be published in
an upcoming article.
t ⫽ ⫺
t2 Ninc
冋 1
2Ninc NincNex Ninc
. 册 (30)
Finally, the effect of the backside must be consid-
ered. According to Eqs. (18) and (19), the derivatives
冉
dR dRF TFTFRRB exp 4i 1 dTF 1 dTR index Nn and infinitesimal thickness dn is, therefore,
⫽ ⫹ ⫹
dak dak 1 ⫺ RFRRB exp 4i TF dak TR dak
⫹
RB exp 4i dRFR
1 ⫺ RFRRB exp 4i dak
, 冊
(40)
dMj
ddn 冏dn⫽0
⫽ Mj,2
dMn
ddn 冏
dn⫽0
Mj,1. (42)
dT
dak
⫽T 冉
1 dTF
⫹
RB exp 4i dRFR
TF dak 1 ⫺ RFRRB exp 4i dak
. 冊 (41)
To speed up the calculations, Eq. (42) can be rewrit-
ten as
Fig. 4. Schematic representation of (a) the needle method and (b) the step method.
冏 冋 冉
dMj 1 dMj d⌬j dMj(⌬j) 1 ers the dispersion of the index of refraction in the
⫽ ⫹ ⫹ (cos j Fourier transform method using a method we devel-
d⌬Nj ⌬Nj⫽0
2 dj dNj dj j oped [34].
⫺ cos ⌬j) 冋 ⫺1 0
0 1 册冊 册
dj
dNj
, (45) 2. Rugate Filters
A direct application of the Fourier transform method
is the design of single- or multiple-wavelength reflec-
where dMj共⌬兲兾dj is identical to Eq. (36), where j is tors called rugate filters [26]. It can easily be under-
replaced by ⌬j. stood that the Fourier transform of a Q function
If the index of refraction of the layer where the step defined for a single wavelength gives a sinusoidal
is added is at a limit of the available index range, it index profile. Furthermore, a multiband rugate filter
is impossible to distribute the change of index can easily be designed by multiplying multiple sinu-
equally, and the calculation must be slightly modi- soidal profiles:
fied. Details about the step method will be published
in an upcoming article. n(x)
ln i sin(2x兾i ⫹ i)w(x),
⫽兿 Q (49)
F. Design of Graded-Index Filters nm i
冕
⬁ viding apodization is the Kaiser function,
n(x) 2 Q()
⫽ sin(⌿() ⫺ x)d,
I0(冑1 ⫺ 4x2)
ln (46)
nm
0 w(x) ⫽ ⌸(x), (51)
I0()
where x is the double-centered optical thickness, ⫽
2兾 is the wavenumber, is the wavelength, and where I0 is the modified Bessel function of the first
kind and zeroth order, ⌸共x兲 is a rectangular function,
nm ⫽ 冑nminnmax (47) and  is a parameter that controls the amount of
apodization.
The bandwidth of a band, ⌬i, is related to the
is the geometric mean index of the filter. The double- amplitude of its index profile, while the reflecting
centered optical thickness power is related to the amplitude of the index profile
and the number of periods. According to Bovard [30],
冕
z
x⫽2
0
n(u)du (48)
⌬n ⫽ 2nm sin 冉 冊
⌬i
4 i
, (52)