Computation of Spectra from Raw Igrams

The following procedure is used to compute spectra from raw igrams:

  1. Apodize the input igram using the selected Apodization method
  2. Shift the igram so that zero frequency is the first element in the data array
  3. If necessary, zero fill the igram array so the number of elements is an exact power of 2
  4. Apply the FFT function
  5. Extract the positive frequencies as the spectrum for the given input igram

The default mode is for Edgar to assume the middle of the igram is ZPD as set by the FTS controller, and apply the apodization function from the middle +- 1/2 the igram width. So for 8cm-1 with 2048 samples, ZPD is assumed to be at 1024. The default of apodization and igram shift operation being applied about the igram midpoint is equivalent to executing the following statement from a Python script:

ComputeSpectrum.setFindZpd(0)

The Apodization and igram shift operation will be applied about ZPD if the following statement is executed from a Python script:

ComputeSpectrum.setFindZpd(1)

Note that after making this call, all spectra computed by Edgar will use the search for ZPD function, whether or not Compute Spectrum is called from within a Python script or not.

When the option for Edgar to find ZPD is set, the apodization window is applied over a range defined by ZPD+-M, where M is the minimum of R and L. R is the number of points on Right side of ZPD, and L is the number of points on Left side of ZPD. L is just equal to ZPD, and R is the igram length minus the ZPD position. For example, for 8cm-1 resolution with 2048 samples per igram, if ZPD is at 1024, then L=1024 and R=2048-1024=1024, so M=Min(1024,1024)=1024. So nothing is different in this case as the apodization is applied from 0 to 2048 with middle at 1024. But suppose ZPD is found to be at 512. In this case, L=ZPD=512 and R=2048-512=1536 and M=Min(R,L)=512. So the center of the apodization is set to ZPD which is 512, and the apodization is applied over 512+-512. Values outside the apodization window are set to 0. The net result of all this is that you will have less spectral resolution than if ZPD had been located in the middle of the sampled portion of the igram, but this will fix the phase errors in the real part of the computed spectrum.

The approach used to find the ZPD position is to first average each group of 2 points in the igram, then find the positive and negative peaks (and the location of the peaks) of this sliding average. Then each of these peaks is examined to see which peak the igram is most symmetric about by applying a simple symmetry test. The symmetry test is to look at the valleys on either side of the most positive peak, and see how close together they are; and to look at each of the peaks on either side of the most negative valley, and see how close together they are. If the valleys around the positive peak are closer together (in magnitude) than the peaks around the negative valley, then the positive peak is chosen as ZPD location. Otherwise, the negative peak is chosen as ZPD location.

You can see the individual subfile results of the ZPD finder by running Tools–Analyze File on a raw igram file. Then open the output text file. This is a plain tab delimited text file and can easily be imported into a spreadsheet. The ZPD location and y value at ZPD for each scan is listed. (Also included are the Grams/SPC file number, the Annotator scan number, scan time, and delta time.) Frequency of occurrence for all ZPD locations for each direction are listed at the bottom of the file in descending order. ZPD is sample number, and y at ZPD is in raw counts. This uses the same function to find ZPD as is used by Compute Spectrum when the option for Edgar to find ZPD is turned on.

When doing a Compute Spectrum operation on a multifile, and the option for Edgar to find ZPD is turned on, Edgar will first examine all subfiles and compute frequency of occurrence for each ZPD location. Then the location with most occurrences is used as ZPD location for all subfiles. Forward and reverse are treated separately in this process.

This assumes that ZPD really is in the same position for all subfiles. For a stable instrument, this will always be the case. If you power up cold and immediately collect data, you’ll probably notice that if you collect several hundred scans (or more), the ZPD position will shift by a sample or 2 from beginning to end. The only remedy for this is to let the system reach its final operating temperature before collecting data.