-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docs and Implement Interference Hologram
1. Add docs to introduce all kinds of holograms 2. Implement Interference Hologram
- Loading branch information
Showing
23 changed files
with
839 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
# Before Read | ||
|
||
注:此文档分中英文撰写,根据需要跳转到相应位置阅读 | ||
|
||
Note: This document is written in Both Chinese and English, skip to the corresponding location to read if necessary | ||
|
||
# 迂回位相型全息图 | ||
|
||
## 什么是迂回位相型全息图? | ||
|
||
1960年,布朗恩( Brown)和罗曼应用迂回位相技术制成二元计算全息图,现在习惯称之为迂回位相型全息图。这种全息图有三个特点: | ||
|
||
1. 全息图的透过率是二元的,即只取0或1。 | ||
2. 应用迁回位相编码物光波的位相,全息图可以同时记录复值函数的振幅和位相。 | ||
3. 全息图记录时没有用到参考光波或加偏分量。 | ||
|
||
这种迁回位相编码制作的二元计算全息图是计算全息的开创篇,正是它的特点使得它在后来的很多编码技术中得到了广泛的使用。 | ||
|
||
## 原理 | ||
|
||
二元付里叶变换计算全息图的制作过程一般分为四个步骤: | ||
|
||
### 物面和全息面的抽样 | ||
|
||
在把物面信息输入计算机作离散付里叶变换之前,要先对物面和全息面分别按抽样定理进行抽样,求出各样点的幅值和位相信息。 | ||
|
||
物面函数: | ||
$$ | ||
f(x, y)=a(x, y) \exp [j \phi(x, y)] | ||
$$ | ||
傅里叶变换: | ||
$$ | ||
F(\mu, v)=A(\mu, v) \cdot \exp [j \Phi(\mu, \nu)] | ||
$$ | ||
即物函数$f(x,y)$在空间中大小是有限的。同时从物理意义上来说,它在空间域频率也是近似有限的。可以这样来理解,即物函数在空间是缓慢变化的,故其空间频率域中的高频部分可近似为零。 | ||
|
||
具体的抽样过程如图所示: | ||
|
||
![](../../Images/doc_fourier_p1.png) | ||
|
||
### 计算离散傅里叶变换(DFT) | ||
|
||
由于制作的是付里叶变换全息图,故要算出全息图面上谱的复振幅分布$F(\mu, v)$,必须进行离散的付里叶变换。离散的付里叶变换可写成下式: | ||
$$ | ||
F(u, v)=1 / M N \sum_{x=0}^{M-1}\left[\sum_{y=0}^{N-1} f(x, y) \exp (-j 2 \pi v / N)\right] \exp (-j 2 \pi c x / M) | ||
$$ | ||
|
||
### 编码 | ||
|
||
即将算出的全息图面上样点处的幅值和位相,仍在计算机内进行编码处理,然后把编码后的信息输给绘图仪绘图,或由微密度计显示产生计算全息原图。由编码理论,可知编码的目的是要把复数值转变为实的非负函数。在迂回位相二元全息图中,罗曼等人是用下述精巧的方法分別编码振幅和位相的。在全息图的每个抽样单元中,放置一个通光孔径,改变此通光孔径的面积来调制波面的幅值,改变通光孔径中心距抽样单元中心的位置来编码波面的位相。通光孔径的形状可以是多种多样的,这主要依据绘图仪的作图能力和数学描述的方便来取定。在罗曼等人的工作中,选择了矩形孔径。矩形孔的可变参数可以有好几个,但由于只编码幅值和位相,故孔径的变参数仅取两个。罗曼编码方式分为Ⅰ型、Ⅱ型、Ⅲ型。 | ||
|
||
以罗曼Ⅲ型为例,处理方法如图: | ||
|
||
![](../../Images/doc_fourier_p2.png) | ||
|
||
### 绘图显示 | ||
|
||
当计算机已经完成幅值和位相编码后,下一步就是制作计算全息原图并把它缩小到合适的尺寸。绘图仪、阴极射线管、或计算机控制的微密度计都可用来制作原图。光学缩版后就变成实际可用的计算全息片了。如果采用特殊的输出(如电子束)直接把全息图记录在胶片上,就可省去制作原图和缩版的步骤,这样全息图的制作再现精度会更高些。 | ||
|
||
|
||
|
||
## 如何制作迂回位相型全息图? | ||
|
||
在这个实验中,我们使用这个图像进行测试: | ||
|
||
![64×64-test.bmp](../../Res/image64/test.bmp) | ||
|
||
这里提供了两种进行实验的方法,Matlab或Python,您可以选择熟悉的方法来运行代码。 | ||
|
||
- 运行[`fourier_hologram.m`](../../Matlab/fourier_hologram.m) 或 [`fourier_hologram.py`](../../Python/fourier_hologram.py),它们分别在Python和Matlab文件夹中。 | ||
|
||
- 然后你会在下面得到Circuitous Phase Type Hologram/Fourier Hologram。 | ||
|
||
![](../../Matlab/result/fh_test_CGH.bmp) | ||
|
||
+ 最后,运行程序后,可以得到复现的图像,并将其与原始图像进行比较。 | ||
|
||
![](../../Matlab/result/fh_test_recover.bmp) | ||
|
||
|
||
|
||
|
||
|
||
# Circuitous Phase Type Hologram | ||
|
||
## What is Circuitous Phase Type Hologram? | ||
|
||
In 1960, Brown and Roman used devolution phase technology to make binary computed holograms, now commonly known as devolution phase holograms. This hologram has three characteristics: | ||
|
||
1. The transmittance of holograms is binary, that is, 0 or 1. | ||
|
||
2. The hologram can record both the amplitude and the phase of the complex function by reverting to the phase of the object light wave. | ||
|
||
3. No reference light wave or offset component is used in hologram recording. | ||
|
||
This kind of binary CGH is the first part of CGH. It is its characteristic that makes it widely used in many coding technologies. | ||
|
||
## Principle | ||
|
||
The production process of binary Fourier transform CGH is generally divided into four steps: | ||
|
||
### Sampling of object and holographic surfaces | ||
|
||
Before input the information of object plane into computer for discrete Fourier transform, the object plane and holographic plane should be sampled respectively according to sampling theorem, and the amplitude and phase information of each point can be obtained. | ||
|
||
Object surface function: | ||
|
||
$$ | ||
f(x, y)=a(x, y) \exp [j \phi(x, y)] | ||
$$ | ||
|
||
Fourier transform: | ||
|
||
$$ | ||
F(\mu, v)=A(\mu, v) \cdot \exp [j \Phi(\mu, \nu)] | ||
$$ | ||
|
||
That is, the matter function $f(x,y)$is finite in space. At the same time, in a physical sense, its frequency in the space domain is approximately finite. It can be understood that the matter function changes slowly in space, so the high frequency part of its spatial frequency domain can be approximately zero. | ||
|
||
The specific sampling process is shown in the figure: | ||
|
||
![](../../Images/doc_fourier_p1.png) | ||
|
||
### Compute the Discrete Fourier Transform (DFT) | ||
|
||
A discrete Fourier transform is necessary to calculate the complex amplitude distribution $F(\mu, v)$of the hologram. The discrete Fourier transform can be written as follows: | ||
|
||
$$ | ||
F(u, v)=1 / M N \sum_{x=0}^{M-1}\left[\sum_{y=0}^{N-1} f(x, y) \exp (-j 2 \pi v / N)\right] \exp (-j 2 \pi c x / M) | ||
$$ | ||
|
||
### Codes | ||
|
||
The amplitude and phase of the sample point on the hologram plane to be calculated are still coded in the computer, and then the coded information is transferred to the plotter for drawing, or the original cHOLogram is generated by the micro-densitometer display. From coding theory, we know that the purpose of coding is to transform complex values into real non-negative functions. In a roundabout phase binary hologram Roman et al. coded the amplitude and phase separately in the following ingenious way. In each sampling element of the hologram, an aperture is placed, the amplitude of the wave surface is modulated by changing the area of the aperture, and the phase of the wave surface is encoded by changing the position between the center of the aperture and the center of the sampling element. The shape of aperture can be various, which is mainly based on the plotting ability of plotter and the convenience of mathematical description. In the work of Roman et al., rectangular apertures were chosen. There can be several variable parameters of rectangular hole, but only two variable parameters of aperture are selected because only amplitude and phase are encoded. Romanesque coding is divided into type ⅰ, type ⅱ and type ⅲ. | ||
|
||
Taking Roman ⅲ type as an example, the treatment method is shown as follows: | ||
|
||
![](../../Images/doc_fourier_p2.png) | ||
|
||
### Drawing and Display | ||
|
||
Once the computer has encoded the amplitude and phase, the next step is to make the CGH original and reduce it to the right size. Plotters, cathode-ray tubes, or computer-controlled microdensitometers can be used to make original drawings. The optical version is reduced to a practical CGH. If a special output (such as an electron beam) is used to record the hologram directly on the film, the process of making the original image and reducing the size of the hologram can be eliminated and the reproduction of the hologram will be more accurate. | ||
|
||
## How to make Circuitous Phase Type Hologram? | ||
|
||
Circuitous Phase Type Hologram/Fourier Hologram is Binary hologram. | ||
|
||
For this experiment we used this image for testing | ||
|
||
![64×64-test.bmp](../../Res/image64/test.bmp) | ||
|
||
Two ways to do experiments are provided here, Matlab or Python, and you can choose the familiar way to run the code. | ||
|
||
- Run the `fourier_hologram.m` or `fourier_hologram.py`, They are in the Python and Matlab folders respectively. | ||
- Then you will get Circuitous Phase Type Hologram/Fourier Hologram below. | ||
|
||
![](../../Matlab/result/fh_test_CGH.bmp) | ||
|
||
+ Finally, after running the program, you can get the reproduced graph and compare it with the original image. | ||
|
||
![](../../Matlab/result/fh_test_recover.bmp) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
# Before Read | ||
|
||
注:此文档分中英文撰写,根据需要跳转到相应位置阅读 | ||
|
||
Note: This document is written in Both Chinese and English, skip to the corresponding location to read if necessary | ||
|
||
# 计算全息干涉图 | ||
|
||
## 什么是计算全息干涉图? | ||
|
||
干涉是光学中的基本现象,相干的双光束或多光束叠加就形成干涉条纹。以往的干涉都是应用光学方法来实现,但光学的干涉图却完全可用计算来仿真( simulation),即计算机产生的干涉图。全息摄像主要经历光学全息,数字全息,和计算全息这样几个过程,其基本原理都是通过干涉纪录及衍射重建。当两束光波进行干涉时,记录物体的振幅和相位信息,通过衍射计算,重构物体的振幅和相位信息。 | ||
|
||
用计算机模拟产生光学干涉图,只预先知道干涉图样的数学模式即可。但是一般的光学干涉图,其透过率是连续变化的函数,而用计算机输出的数字讯号经绘图仪或CRT显示来制作的计算全息,干涉图,常常希望只得到二元透过率(取0或1值),即二元计算全息干涉图。为了达到这一目的,就必须把连续透过率函数进行非线性变换,转化成二元形式,而且此二元形式的干涉图仍应保存物波的全部信息,在再现时能得到所需的物光波。 | ||
|
||
## 原理 | ||
|
||
普通的离轴型光学全息图,可以把它看成是物光和参考光“双光束”相叠加而形成的干涉图,其透过率为 | ||
$$ | ||
\begin{aligned} | ||
h(x, y) &=|R \exp (j 2 \pi x / T)+A(x, y) \exp (j \phi(x, y))|^{2} \\ | ||
&=R^{2}+|A(x, y)|^{2}+2 R A(x, y) \cos (2 \pi x / T-\phi(x, y)) | ||
\end{aligned} | ||
$$ | ||
其中,$R \exp (j 2 \pi x / T)$为参考光复振幅,$A(x, y) \exp (j \phi(x, y))$为物光复振幅。 | ||
|
||
当物光仅仅只有相位变化时,上式可简化为: | ||
$$ | ||
h(x, y)=\frac{1}{2}(1+\cos \{2 \pi x / T-\phi(x, y)\}) | ||
$$ | ||
根据上式可以得出振幅最大值和最小值位置,得到干涉条纹。但是透过率是连续的,干涉条纹的对比是不高的。如果只是为了要提高条纹的对比,以致在极端的情况下能产生二元值化(0,1)的条纹,一种方法是可以用多光束相干涉,当参加干涉的光束数越多时,条纹就越锐,逐渐趋向于二元形式,这时的透过率函数可写成多光束迭加求和的形式。另一常规的方法是用高反差的胶片来记录此干涉条纹,这种高反差胶片的硬限幅特性能把连续色调的干涉条纹变成二元干涉图。后一种方法启示我们,若要计算机来制作二元计算全息干涉图,可以借用电讯系统中的非线硬限幅器的模型来进行处理。 | ||
|
||
我们举三个例子来说明二元计算全息图的制作技术及其再现情况。这三个例子都是记录的位相型波面,它们在光学干涉量度中有很大的应用价值。其中第一个例子是球面波,它通常在光学中是由透镜或波带板状得到的;第二个例子是锥形波面,也可由光学的旋转三棱镜获得;而第三个例子是螺旋形波面,其位相在方位方向上是线性变化的,这种波面用通常的光学元件却是得不到的。故最后一个例子说明了,由于计算机仿真干涉图的灵活性大,我们完全可以得到用光学制作技术难以得的特殊位相型变化波前。这使得计算全息干涉图很适用于光学的量度术中去检特殊的光学波面。 | ||
|
||
**球面波** | ||
|
||
球面波的位相变化为: | ||
$$ | ||
\phi(x, y)=\frac{k}{2 f}\left(x^{2}+y^{2}\right) | ||
$$ | ||
其中,$k=\frac{2 \pi}{\lambda}$,$f$是球面波曲率半径。 | ||
|
||
计算得到条纹数: | ||
$$ | ||
N_{p}=\left.\phi(x, y)\right|_{\max }=\frac{\pi \cdot \frac{D^{2}}{4}}{\lambda \cdot f \cdot 2 \pi}=\frac{D^{2}}{8 \lambda f}=\frac{N}{16} | ||
$$ | ||
**锥形波面** | ||
|
||
锥形面波的位相变化为: | ||
$$ | ||
\phi(x, y)=2 \pi r / r_{0} | ||
$$ | ||
其中,$r=\left(x^{2}+y^{2}\right)^{1 / 2}$。 | ||
|
||
计算得到条纹数: | ||
$$ | ||
N_{\mathrm{p}}=\frac{D}{2 \cdot r_{0}}=\frac{N}{8} | ||
$$ | ||
**螺旋形波面** | ||
|
||
相对变化: | ||
$$ | ||
\phi(x, y)=2 \pi \theta / \theta_0 | ||
$$ | ||
其中,$\theta=\tan ^{-1} y / x$ | ||
|
||
|
||
|
||
## 如何制作计算全息干涉图? | ||
|
||
在这个实验中,我们使用这个图像进行测试: | ||
|
||
<img src="../../Res/imageO/pku.jpg" style="zoom:50%;" /> | ||
|
||
这里提供了两种进行实验的方法,Matlab或Python,您可以选择熟悉的方法来运行代码。 | ||
|
||
- 运行[`offaxis_interference_hologram.m`](../../Matlab/offaxis_interference_hologram.m) 或 [`offaxis_interference_hologram.py`](../../Python/offaxis_interference_hologram.py),它们分别在Python和Matlab文件夹中。 | ||
|
||
- 然后你会在下面得到Off Axis Interference Hologram。 | ||
|
||
![](../../Python/result/oaih_pku_CGH.bmp) | ||
|
||
- 最后,运行程序后,可以得到复现的图像,并将其与原始图像进行比较。 | ||
|
||
![](../../Python/result/oaih_pku_recover.bmp) | ||
|
||
|
||
|
||
# Computational Interference Holograms | ||
|
||
## What is Computational Interference Holograms? | ||
|
||
Interference is a basic phenomenon in optics. Interference fringes are formed when two or more coherent beams are superimposed. In the past, interference is realized by optical method, but the optical interferogram can be completely simulated by calculation, that is, the interferogram generated by computer. Holography mainly goes through optical holography, digital holography and computational holography. The basic principle of holography is interference recording and diffraction reconstruction. When two light waves interfere, the amplitude and phase information of the object are recorded, and the amplitude and phase information of the object are reconstructed by diffraction calculation. | ||
|
||
To produce optical interferograms by computer simulation, only the mathematical pattern of interference pattern is known in advance. However, the transmittance of general optical interferogram is a function of continuous change, while the computed hologram (CGH), which is made by using the digital signal output by computer and displayed by plotter or CRT, usually hopes to get only binary transmittance (0 or 1), namely binary CGH interferogram. In order to achieve this goal, it is necessary to transform the continuous transmittance function into a binary form by nonlinear transformation, and the binary interferogram should still preserve all the information of object wave, so as to obtain the desired object wave when reproducing. | ||
|
||
## Principle | ||
|
||
The common off-axis optical hologram can be regarded as an interferogram formed by the superposition of object light and reference light "double beam", and its transmittance is | ||
|
||
$$ | ||
\begin{aligned} | ||
h(x, y) &=|R \exp (j 2 \pi x / T)+A(x, y) \exp (j \phi(x, y))|^{2} \\ | ||
&=R^{2}+|A(x, y)|^{2}+2 R A(x, y) \cos (2 \pi x / T-\phi(x, y)) | ||
\end{aligned} | ||
$$ | ||
|
||
Where,$R \exp (j 2 \pi x / T)$is the reference light recovery amplitude and i$A(x, y) \exp (j \phi(x, y))$s the object light recovery amplitude. | ||
|
||
When the object light only changes in phase, the above equation can be simplified as: | ||
|
||
$$ | ||
h(x, y)=\frac{1}{2}(1+\cos \{2 \pi x / T-\phi(x, y)\}) | ||
$$ | ||
|
||
According to the above formula, the position of the maximum and minimum amplitude can be obtained, and the interference fringe can be obtained. But the transmittance is continuous and the contrast of interference fringes is not high. If only in order to improve the contrast of stripe, so that in extreme cases can generate binary value (0, 1) stripes, a kind of method is you can use multiple beam interference, when attend the more the number of beam interference stripe is more sharp, gradually tend to be binary form, the transmittance function can be written in the form of multiple beam superposition summation. Another conventional method is to record the interference fringes on high-contrast film. The hard limiting property of this high-contrast film can transform the continuous tone interference fringes into binary interferograms. The latter method suggests that the model of non-linear hard limiter in telecommunication system can be used to make binary CGH interferogram by computer. | ||
|
||
Three examples are given to illustrate the fabrication and reproduction of binary CGH. These three examples are all recorded phase type wavefronts which have great application value in optical interferometry. The first example is spherical waves, which are usually obtained in optics by lenses or waveband plates; The second example is the conical wavefront, also obtained by optical rotating prisms; A third example is a helical wave surface, whose phase varies linearly in orientation, which is not available with ordinary optical elements. Therefore, the last example illustrates that, due to the flexibility of computer simulation interferogram, we can get special phase change wavefront which is difficult to obtain by optical fabrication technology. This makes CGH very suitable for optical measurement to detect special optical wavefronts. | ||
|
||
**Spherical wave** | ||
|
||
The potential transformation of spherical waves is transformed into: | ||
|
||
$$ | ||
\phi(x, y)=\frac{k}{2 f}\left(x^{2}+y^{2}\right) | ||
$$ | ||
|
||
Where, $k=\frac{2 \ PI}{\lambda}$, $f$is the radius of spherical wave curvature. | ||
|
||
Calculate the number of fringe: | ||
|
||
$$ | ||
N_{p}=\left.\phi(x, y)\right|_{\max }=\frac{\pi \cdot \frac{D^{2}}{4}}{\lambda \cdot f \cdot 2 \pi}=\frac{D^{2}}{8 \lambda f}=\frac{N}{16} | ||
$$ | ||
|
||
**Conical wave surface** | ||
|
||
The potential phase transformation of the conical surface wave transforms into: | ||
|
||
$$ | ||
\phi(x, y)=2 \pi r / r_{0} | ||
$$ | ||
|
||
Where,$r= left(x^{2}+y^{2})^{1/2}$ | ||
|
||
|
||
|
||
Calculate the number of fringe: | ||
|
||
$$ | ||
N_{\mathrm{p}}=\frac{D}{2 \cdot r_{0}}=\frac{N}{8} | ||
$$ | ||
|
||
**Spiral wave surface ** | ||
|
||
|
||
|
||
Relative change: | ||
|
||
$$ | ||
\phi(x, y)=2 \pi \theta / \theta_0 | ||
$$ | ||
|
||
Where,$\theta=\tan ^{-1} y/x$ | ||
|
||
## How to make Computational Interference Holograms? | ||
|
||
For this experiment we used this image for testing | ||
|
||
<img src="../../Res/imageO/pku.jpg" style="zoom:50%;" /> | ||
|
||
Two ways to do experiments are provided here, Matlab or Python, and you can choose the familiar way to run the code. | ||
|
||
- Run the `offaxis_interference_hologram.m` or `offaxis_interference_hologram.py`, They are in the Python and Matlab folders respectively. | ||
- Then you will get Off Axis Interference Hologram below. | ||
|
||
![](../../Python/result/oaih_pku_CGH.bmp) | ||
|
||
- Finally, after running the program, you can get the reproduced graph and compare it with the original image. | ||
|
||
![](../../Python/result/oaih_pku_recover.bmp) | ||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.