Thick films : Fast Fourier Transform (FFT) Method

Thick films : Fast Fourier Transform (FFT) Method#

When the spectrum contains a large number of peaks (> 15), the most suitable method is to make an FFT. Theoritical details will be provided in an upcoming publication.

Assuming the previous procedure has been followed and the resulting peak plot is as follows :

[13]:
from pathlib import Path
from optifik.io import load_spectrum
from optifik.analysis import plot_spectrum
from optifik.analysis import smooth_intensities
from optifik.analysis import finds_peak

# Define the path to the folder containing your .xy file
datafile_path = Path('../../data/basic/003582.xy')

# Load wavelengths and intensities from the file
wavelengths, intensities = load_spectrum(datafile_path,
                                         wavelength_min=450,
                                         wavelength_max=1000)

# Smoothing the intensity
intensities_smoothed = smooth_intensities(intensities)

# Peak detection function
# min_peak_prominence and min_peak_distance can be adjusted.
finds_peak(wavelengths, intensities_smoothed,
           min_peak_prominence=0.018,
           min_peak_distance=10,
           plot=True)
../_images/notebooks_2_FFT_3_0.png
[13]:
(array([ 21,  45,  72, 102, 136, 175, 220, 271, 330, 401], dtype=int64),
 array([  9,  32,  58,  88, 119, 156, 197, 244, 298, 363, 441], dtype=int64))

For this case, 21 peak have been successfully identified. To derive the film thickness \(h\), we use the thickness_from_fft function from the optifik.fft module. Here an exemple of plot you can obtain.

[12]:
from optifik.fft import thickness_from_fft

# Determine the film thickness by Fast Fourier Transform
thickness_from_fft(wavelengths, intensities_smoothed,
                   refractive_index=1.33,
                   num_half_space=None,
                   plot=True)
[12]:
 thickness: 3562.947001650467
../_images/notebooks_2_FFT_5_1.png

The thickness_from_fft function automatically determines the film thickness.

The console output shows the film thickness \(h\), which is 3562.947 nm in this example.

  • You can specify the medium’s refractive index using the refractive_index parameter.

  • You can also provide a refractive index array \(n(\lambda)\) as an refractive_index input.

  • Even if peak detection occasionally fails, it has no impact on the FFT since the transform is applied to the entire dataset.

In the following, we will see the case where the spectrum contains only few peaks.