Explosion Dynamics Laboratory Explosion Dynamics Laboratory Home Page

Spectral Analysis for Cell Size Measurement

Technique based on the Fourier analysis of cellular patterns,
with the use of Matlab and Photoshop

Implemented by Jean-Philippe Hébral
Under the supervision of Dr Joseph E. Shepherd
Detonation Physics Laboratory - GALCIT - Caltech

The context

The Detonation Physics Laboratory operates a 280 mm diameter, 7.3 meter long detonation tube, which is used to study detonations in combustible gaseous mixtures. Sooted foils, aligned with the axis of the tube, are used to record the detonation cell size. Those foils feature a cellular pattern, whose characteristic dimension (usually ranging from some mm's to some cm's) can be empirically related to dynamic parameters such as initiation energy and critical tube diameter.

General presentation of the tube and a soot foil
In front of the detonation tube, a soot foil after a shot, featuring the characteristic cellular pattern

If you want to know more about the detonation tube operated at Caltech, the Explosion Dynamics Laboratory web site is likely to provide you with the information you need.

Until now, the detonation cell size was measured manually: around 10 measurements were made for each foil and a minimum, maximum and average cell width were obtained. The inherent irregularity of some mixtures together with the subjectiveness of this technique resulted in uncertainties of +/- 50%.

Thus, it was important to find a systematic way to determine the cell size, that would be repeatable and independent of the user.

The principle

The idea of the implemented technique is to compute a 2-dimensional Fourier analysis of the digital picture of the foil, in order to highlight the dominant frequencies in the cellular pattern. The cells exhibit a periodicity, with which a relevant frequency and its harmonics can be associated. The Fourier Transform makes it possible to compute these frequencies.

Practically, this requires a digital picture to be taken under as uniform a light as possible. Edge detection is used on the image in order to highlight the cellular pattern, then a Power Spectral Density (PSD) calculation is made, and finally the relevant frequency information is extracted out of the PSD.
The image processing is implemented with Photoshop 5.5, and the computation with Matlab.

The procedure

Here's a quick and visual overview of the different steps involved in the Cell Size Measurement Programs.
For comparison purpose, the process has been applied to an actual soot foil photograph as well as to an idealized image, featuring a perfectly periodic cellular pattern.

Actual photographSynthesis cellular pattern
(ideal case)
The original digital picture, after turning it into Black & White, looks like this: original B&W picture of the shot #1331 No picture expected here
Working on a square image is more convenient, so we crop the original to keep only the most relevant area: cropped image No picture expected here
After a pre-processing aimed to eliminate the noise (scratches, stream lines, unevenness of the soot,...) and to emphasize the edges, we get this: cleaned picture Synthesis cellular pattern
The edge detection procedure produces this image: edge-enhanced picture edge-enhanced picture
The Power Spectral Density (PSD) of this pattern looks like this: Power Spectral Density Power Spectral Density
Plot of the intensity at a fixed radius around the crossing point of the legs in the PSD. Notice the 4 peaks, corresponding to the intersection of the circle with the legs. Angular scanning Angular scanning
The angular plot lets us know the angles of the legs. We can then compute a radial scanning along one of the legs. This plot shows the intensity variation along the leg which is at the angle -35 degrees Radial scanning Radial scanning
A zoom in the neighborhood of the DC peak shows the fundamental and harmonics frequencies. Radial scanning zoom in Radial scanning zoom in

One can prove that the spatial wave length, i.e. the cell width, is the size of the (square) image divided by the abscissa of the fundamental. Hence the cell width and its harmonics!

The results

Here's a set of results obtained from sooted foil pictures from J. E. Shepherd. This series of shots was performed in 1985 at Sandia National Laboratories, using a Hydrogen-Air mixture at T=20°C with equivalence ratio of 0.5.

Picture of the sooted foil HT95 (Sandia series #5) Cellular pattern edges before computation of the cell size
Original sooted foil
The square limit indicates the cropped region used to compute the cell size.
Cellular pattern edges before computation of the cell size

Chart of the results Hydrogen-Air mixture -- Equivalence ratio of 0.5 -- T=20 °C The size of the bubble is proportional to the energy of the corresponding harmonic.

The additional data point and error bar correspond to the cell width dimension obtained through manual measurement and statistical analysis by J. E. Shepherd & S. R. Tieszen at Sandia National Laboratories:
  • Lower Bound: 8.6 cm
  • Most Probable Value: 11.5 cm
  • Upper Bound: 14.4 cm

Note the multiplicity in the ordinates of the series of peaks (#1,#2,#5), (#3,#6), (#4,#7), highlighting the presence of some characteristic spatial wave lengths and their associated harmonics.
Recall that the harmonics of a fundamental frequency f are the frequencies 2f, 3f, 4f,... Therefore, the "harmonics" of a "fundamental" wave length λ are the wave lengths λ/2, λ/3, λ/4,...

In this case, the predominant wave length fundamental seems to be 10.4 cm (peak #7 at 5.1 cm is one of its harmonics). We will consider it as the dominant cell size of this foil. The coexistence of other frequencies will induce fluctuations around this "most recurrent" value.

The programs

Here's a brief description of the Matlab programs developped to achieve our goal. You can just browse through (the source code will appear in your web-browser window, you don't need Matlab to read them), or enjoy running them on your computer by downloading the source code.
If clicking on 'Download' opens the file instead of copying it to your hard-drive, right click on the link and select 'Save target as...' or 'Save link as...'; make sure that the file has the Matlab .m extension.

You can read them all, or use the links below if you want to go directly to a specific one...
  1. The main program:
  2. The image processing programs:
  3. The Fourier Transform Analysis programs:
  4. The data extraction programs:
  5. The multi-purpose programs:

The user guide

A user guide has been developed, documenting this procedure, so that anybody can benefit from the work already done, and progress further toward an even higher quality and reliability of results.
It contains a basic theoretical background to the 2-dimensional Fourier analysis, the instructions for beginners to be able to use the involved programs (Matlab and Photoshop), the parameters I used to get my best results, a comprehensive tutorial example, and the description of all the developed programs.
The guide is in format .pdf, and can therefore be read either in this browser if you have Acrobat Reader or similar, or downloaded for printing for your convenience.

Before using the program(s), please read the guide and follow the tutorials. In order to get these programs to work, you will need to have a working version of Matlab, be familiar with how Matlab works, download the programs (separately), make sure the programs are in a directory that is in the Matlab path, and download or create some test images. Unfortunately, we are not able to offer assistance with getting the programs running and cannot make any assurances about the results.

How to do it -- The ultimate user guide is here! (Updated December 7th,2000)