The Signal Processing
Joseph H. Reibenspies  Ph.D.
Nattamai Bhuvanesh Ph.D.
X-ray Diffraction Laboratory
Texas A & M University
All rights reserved.  Please do not copy, modify or distribute these slideswithout the consent of the authors.
http://brandguide.tamu.edu/downloads/primary08.jpg
X-ray Diffraction Laboratory 1.0.1
Processing
Systematic errors
Signal
Signal to noise
Smoothing/Outliers
Background correction
K2 stripping
Peak location
Limits of Detection (LOD)
Intensities
http://brandguide.tamu.edu/downloads/primary08.jpg
Errors
Random Error
 Random errors and unpredictable and have a null meanwhen the measurement is repeated many times.
Systematic Error
Systematic errors are predictable, and typically constant orproportional to the true value
http://brandguide.tamu.edu/downloads/primary08.jpg
The BIG 2 systematic errors
+2
+
-
Displacement
2
Transparency
+2
http://brandguide.tamu.edu/downloads/primary08.jpg
Systematic Errors
Displacement Error
Placement error
Sample level error
∆2𝜃=−2∆ℎ  57.30cos 𝜃  𝑅 
100 micron ~ 0.04o 2
20o 2
Hair diameter
~0.045-.01o 2 offset 
100micron
0-80o 2
http://brandguide.tamu.edu/downloads/primary08.jpg
Transparency Error
Absorption
  𝑡  1 2  =  1  𝜇 𝑒𝑓𝑓  
(e,), Vcell, pow
 𝑡  1 2  =0.1 mm, =10mm-1
Error :  ∆2𝜃=  sin 2𝜃  2 𝜇 𝑒𝑓𝑓 𝑅 
> 0  (negative displacement)
eff  = 10mm-1 ~ 0.004o 2
@ 20o    2
Offset > as eff <
~0.01o eff =1mm-1 20o 2
Loose packed > error
pow = Vpow/Vtotal  decreases

Fix :  Use thin film of sample on a ZBH
At the expense of accurate I
http://brandguide.tamu.edu/downloads/primary08.jpg
Other Systematic Errors
Instrumental
Axial Divergence:
The X-ray beam diverges outof the plane of the focusingcircle
Soller Slits
Flat Specimen Error:
The specimen is flat, anddoes not follow thecurvature of the focusingcircle
Decrease DS size
http://brandguide.tamu.edu/downloads/primary08.jpg
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot020.jpg
Slider Bar
Height Error
http://brandguide.tamu.edu/downloads/primary08.jpg
Displacement-FIX-EVA
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot021.jpg
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot022.jpg
0.185mm
displacement
Signal to Noise
A signal is a spatial-varying (2,d) quantity.
Noise is a random fluctuation in a signal
Signal to Noise Ratio : ratio of the desired signal to the level of background noise.
 𝑺 𝑵 = 𝑰 𝝈 ~ 𝑰   𝑰  =  𝑰 
  𝑰 ~  𝒕 ~ 𝑺 𝑵     signal to noise ratio increase   𝒕
http://brandguide.tamu.edu/downloads/primary08.jpg
Smoothing
Running Median
  𝑦  𝑘 =𝑚𝑒𝑑  𝑦 𝑘−𝑛 , 𝑦 𝑘 , 𝑦 𝑘+𝑛  
Sliding polynomial regression
Savitzky-Golay method
Sliding polynomial
  𝑦  𝑘 =  𝑖=−𝑛 𝑖=𝑛  𝐶 𝑖  𝑦 𝑘+𝑖   𝑛𝑜𝑟𝑚    𝑛𝑜𝑟𝑚= 𝑖=−𝑛 𝑖=𝑛  𝐶 𝑖     where C = quadratic coefficients
Fourier (low pass)
Weighted sum of sines and cosines of increasing frequency
  𝑦  𝑘 = 𝑎 0 + 𝑎 1  sin   2 𝑦 𝑘  𝑇  +  𝑎 2  sin   4 𝑦 𝑘  𝑇  +  𝑎 𝑛  sin   𝑛 𝑦 𝑘  𝑇  + 
		             𝑎 1  cos   2 𝑦 𝑘  𝑇  +  𝑎 2  cos   4 𝑦 𝑘  𝑇  +  𝑎 𝑛  cos   𝑛 𝑦 𝑘  𝑇   
Control the degree of smoothing by tuning the number of sines/cosine interactions
http://brandguide.tamu.edu/downloads/primary08.jpg
Smoothing
http://brandguide.tamu.edu/downloads/primary08.jpg
Smooth-EVA- Savitzky-Golay
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot009.jpg
Polynomial
Factor
OVER SMOOTHED
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot010.jpg
Much Better
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot012.jpg
http://brandguide.tamu.edu/downloads/primary08.jpg
\Downloads\ScreenShot001.jpg
Fourier
  𝑦  𝑘 = 𝑎 0 + 𝑎 1  sin   2 𝑦 𝑘  𝑇  +  𝑎 2  sin   4 𝑦 𝑘  𝑇  +  𝑎 𝑛  sin   𝑛 𝑦 𝑘  𝑇  +  𝑎 1  cos   2 𝑦 𝑘  𝑇  +  𝑎 2  cos   4 𝑦 𝑘  𝑇  +  𝑎 𝑛  cos   𝑛 𝑦 𝑘  𝑇   

The Fourier analysis smoothes data using a sum of weighted sine and cosine terms of increasing frequency.  The data must be equi-spaced and discrete smoothed data points are returned.
Advantages
Very good smoothing procedure
User chooses cutoff and computer automatically smoothes data.
Can store the coefficients rather than the data points.
Disadvantages
Number of points must be a power of 2 or data must be padded with zeros
http://brandguide.tamu.edu/downloads/primary08.jpg
Smooth – EVA-  Fourier
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot013.jpg
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot014.jpg
http://brandguide.tamu.edu/downloads/primary08.jpg
Number of
sines/cosines
Background
Parabolic Fit 
“Sliding” Polynomial
 𝑎 𝑜 + 𝑎 1 𝑥+ 𝑎 2  𝑥 2 +… 𝑎 𝑛  𝑥 𝑛 
“pull down”*
Point every 10 steps
http://brandguide.tamu.edu/downloads/primary08.jpg
Curvature can be “adjusted” for closer fit
*Goehner, R. (1978) Anal. Chem.,50,1223-1225
Vary the criteria for
the “end” of the pull
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot002.jpg
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot003.jpg
Background-EVA-Polynomial
Polynomial
Curvature
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot004.jpg
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot005.jpg
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot006.jpg
Threshold
http://brandguide.tamu.edu/downloads/primary08.jpg
Bezier -Background
The Bezier curve begins at P0 andends at Pn
Straight lines connects thesequential points
A series of lines is drawn betweenthe connecting lines
The intersection of the linesdefine the curve. (intersection istangent to the curve)
More points the more complexthe curve.
Po
P2
P1
http://brandguide.tamu.edu/downloads/primary08.jpg
Background-EVA-Bezier
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot007.jpg
Bezier “curve”
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot008.jpg
http://brandguide.tamu.edu/downloads/primary08.jpg
K2 stripping
Conventional Optics (metal filter)
K1 and K2 peaks are present
Every diffraction peak is a doublet
At low angles the doublet is unresolved
At low resolution the doublet is unresolved
The separation of the doublet follows the formula (Rachinger method)
∆2𝜃= 1−  𝜆 1   𝜆 2    tan  𝜃  𝜆 2     360 0  𝜋  
Intensity K2 peak is ~ 1/2 of the K1 peak.
Employing the formula and intensity ratio the K2 peak can be subtracted from the pattern.
K2 should be stripped before peak location
http://brandguide.tamu.edu/downloads/primary08.jpg
“5 fingers of Quartz”
Peak Positions
Manual Peak Picking
Intensity Maxima
Center of Gravity (Mass)
Position 2 𝜃 𝑔  where  𝑗=1 𝑔  𝐼 𝑗  =  1 2  𝑘=1 𝑁  𝐼 𝑘    
Cord
½ distance of a cord (vector) positioned at FWHM(L) to FWHM(R).
Polynomial/Parabolic Curve
Position where 𝑦= 𝑎 𝑜 + 𝑎 1 𝑥+ 𝑎 2  𝑥 2 +… 𝑎 𝑛  𝑥 𝑛  is maximum
Derivative
Profile fit
Aust J. Physics 41 201 1988
http://brandguide.tamu.edu/downloads/primary08.jpg
Derivatives
http://brandguide.tamu.edu/downloads/primary08.jpg
Derivative (shoulder)
http://brandguide.tamu.edu/downloads/primary08.jpg
Asymmetric Peak Positions
Center of Gravity
Cord
2nd Derivative
Polynomial 3rd order
FWHM
Polynomial
Derivative
http://brandguide.tamu.edu/downloads/primary08.jpg
Peak Position/Profile Fit
http://brandguide.tamu.edu/downloads/primary08.jpg
Two PVII peaks
Peak Search-EVA
Width
Savitzky-Golay smooth width (sliding polynomiallength).
Threshold
3 is often used (see LOD)
Higher Thresholds will Eliminate peak positionsfrom impurities (or minor phases)
http://brandguide.tamu.edu/downloads/primary08.jpg
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot015.jpg
Width
Threshold
Peak Search-EVA-
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot016.jpg
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot017.jpg
C:\Users\jhr6675\Desktop\Projects\Lectures-pow\support\ScreenShot018.jpg
http://brandguide.tamu.edu/downloads/primary08.jpg
FPM Full Patten Model
\Downloads\ScreenShot001.jpg
Limits of Detection (LOD)
Signal (integrated intensity) 
 𝐼 𝑆 
Average Background (noise)
 𝐼 𝑏 
Error on I    
 𝜎 𝐼 ≅  𝐼 ≅  𝑅𝑡 
Net Intensity  
 𝐼 𝑛 = 𝐼 𝑠 − 𝐼 𝑏 
Net Counting error  
 𝜎 𝑛 =    𝐼 𝑠 + 𝐼 𝑏    𝐼 𝑠 − 𝐼 𝑏
LOD
I/
http://brandguide.tamu.edu/downloads/primary08.jpg
Detect
Not
Detectable
LOD statistics
1
2
3
 ~  1% chance that points above 2.58(I)belong to the background set.
http://brandguide.tamu.edu/downloads/primary08.jpg
What is the probability of finding a normally distributedvariable more than ± from its true value?
P
0.01
2.58
0.05
1.96
0.3
1.04
Intensities
Background (B)
 𝑎 𝑜 + 𝑎 1 𝑥+ 𝑎 2  𝑥 2 +… 𝑎 𝑛  𝑥 𝑛 
Peak Height (H)
𝐻= 𝐼 𝑚𝑎𝑥 −𝐵
Peak Width (Wb)
  2𝜃 𝐵2 − 2𝜃 𝐵1          𝐵 𝑛 > 𝐵    
where peak intensity  first [B1] and last [B2] exceeds the “average” (calculated) background intensity
Peak Area (A) : Integrated Intensity
𝐴= 2 𝜃 1   2𝜃 2   𝐼 2𝜃  𝑑2𝜃   ~   𝐴= 2 𝜃 1  2 𝜃 2   𝐼 2𝜃 −𝐵  
Integral Breadth
𝛽= 𝐴 𝐻
http://brandguide.tamu.edu/downloads/primary08.jpg
Intensity
𝐻= 𝐼 𝑚𝑎𝑥 −𝐵
FWHM
Wb
B
𝐴= 2 𝜃 1  2 𝜃 2   𝐼 2𝜃 −𝐵
21
22
Imax
𝛽= 𝐴 𝐻
http://brandguide.tamu.edu/downloads/primary08.jpg
Peak-EVA-Results
http://brandguide.tamu.edu/downloads/primary08.jpg
V1
V1
V1 ~ V2
Penetration Depth
V2
V2
Relative Intensities of the PeaksConstant Volume (assumption)
In a powdered specimen of ‘infinite’ thickness, the change in the volumeof irradiated specimen as the angle of incident changes is compensatedfor by the change in the penetration depth of the X-ray photons
NOT Valid for thin layers or films (e.g. ZBH specimens)
http://brandguide.tamu.edu/downloads/primary08.jpg
Results
Peak Positions
2  (if  is reported)
d spacings
𝑑= 𝜆 2 sin 𝜃  
Intensity of each peak
Total Counts
Counts/second
Absolute Scale
 𝐼  𝐼 𝑚𝑎𝑥  ×100
http://brandguide.tamu.edu/downloads/primary08.jpg
Notebook
Record the first 8 peaks and their absoluteIntensities
d8, d1, d4, d2, d5, d3 , d7, d6
1st peak is the least intense of the 8
2nd peak is the most intense of the 8
3rd peak is the 4th most intense
e.g.  Si    3.13561, 1.9202, 1.6383, 1.3586, 1.2465, 1.1084, 1.0457, 0.9608
Record the three most intense peak positions inorder of their Intensities.
 e.g. Si  3.136, 1.920, 1.638
End of Lecture 5
Lecture 6- The Analysis
Lecture 7- The Reitveld Method
Lecture 8- The Results
http://brandguide.tamu.edu/downloads/primary08.jpg