rfftspectruminfrared

How to Fourier transform an Interferogramm to an IR Spectrum using R?


Hello people of the Internet, I have an Interferogramm (time domain) and want to to Fourier transform it into a IR Spectrum (frequency domain) to obtain the peaks of the functional groups in the molecule. FTIR (Fourier Transformation Infrared Spectroscopy) is a advanced method to determine functional groups in a molecule. The so-called interferometer is build like this:

FTIR

An interferogram plots the signal intensity in Volt vs. the mirror position in nanometers, as in this script:

par(family="mono", font.axis=1)
data <- read.table("D13-4-aminobenzoic_acid_interferogram.asc")
x <- data[,1]
y <- data[,2]

plot(x,y, 
     type="l", 
     xlab="Mirror position [mm]", 
     ylab="Signal intensity [V]",
     axes=F,
     )
axis(1)
axis(2)

Here is the Link to the .asc file with the measured data. After the Fourier Transformation the spectrum should look like this:

IR spectrum

My question is: How do I make a fast discrete Fourier transformation in R using fft() from the Interferogram to the IR spectrum? Is the reverse transformation from the spectrum to the Interferogram possible in R and if yes how is it done. Cheers, Kris


Solution

  • Try this solution:

    d <- read.table('D13-4-aminobenzoic_acid_interferogram.asc')
    f <- fft(d[,2])
    # do fft(f,inverse=T) to get the unnormalized inverse
    
    f2 <- sqrt(Re(f)^2 + Im(f)^2)
    
    c <- 2.9979e8 # speed of light
    lambda.laser <- 632.8e-9 # (nm) HeNe
    nu.Nyquist <- 1e-2/lambda.laser # upper limit of the wavenumber
    delta.nu <- nu.Nyquist/nrow(d) # wavenumber spacing
    
    i.nu <- 1:floor(length(f2)/2) # show plot up to the Nyquist limit
    plot((i.nu-1)*delta.nu,f2[i.nu],type='l')