Converting a spectrum from wavenumber to nm

Hi All,

I'm not sure how to go about this. So I want to convert spectra in wavenumbers to nanometers. But unfortunately it's not as simple as nm=10^7/wavenumber as the x-scaling changes between each sequential data points.
I think I need to somehow create a wave with a list of the delta x's between adjacent data points and incorporate this into a Transform Axis but I think I might be over-complicating things a bit.
I've read up a bit on the XY data model of data but i don't know how I would amend my x data to this. (I've never worked with inconsistently spaced values before).

Does anyone have any advice? Or can they point me in the right direction. I've been googling frequency conversion stuff but I am still a little lost. Sorry if this is a bit vague.

Thanks for any help/advice you can give. =)

N
It seems to me that you are correct in that the solution you are looking for is to put the x values in a separate wave.

To display the spectrum as a function of wavelength, try this (I'll assume that the x scaling of your data wave is calibrated for wave number correctly):

duplicate/O YourDataWave xwave
xwave = 10^7/x
display YourDataWave vs xwave


You'll need to let Igor know about the xwave if you want to do things like fitting from here on forward. Depending on how much analysis you ultimately want to do, it would also be possible to create an interpolation of the graph with evenly-spaced data points as a function of wavelength, but the solution above strikes me as the simplest.
I have looked into this in the past with Raman spectra. For me, the important thing is to keep the integrated intensity (photon counts) over a particular band consistent - i.e. a certain number of photons contribute to a given band, and this should be preserved irrespective of the x-position of the band. To this end, my method is broadly as follows (this is quite general for any arbitrary x-scale conversion):
0. Assume we start with a wave of N intensity values (called Yvalues), and some x-scaling (start and delta).
1. Make a new wave (called Xvalues) representing the x-values - this x-wave (N points) that is equivalent to the x-scaling.
2. Make a new x-wave (called intXvalues) with N+1 points as assign the values to be the mid-points of x-wave in 1. The first and last points will be extrapolations beyond the original x-range.
3. Make another new wave (called intYvalues), and populate this with the integral of the intensity wave (Yvalues) on a point by point basis (N+1 points) - the first value will be zero by definition.
4. Make another new x-wave (called Xfinal) which contains the desired final X-data (arbitrary spacing, M points).
5. Make a new x-wave (called intXfinal) with M+1 points as assign the values to be the mid-points of x-wave in 4. The first and last points will be extrapolations beyond the x-range.
6. Make a new y-wave (called intYfinal), with M+1 points. Populate this with a simple interpolation of the (intXvalues, intYvalues) data, but for x-data being intXfinal.
7. Make a new Y-wave (called Yfinal). Differentiate intYfinal on a point by point basis, populating Yfinal.
You now have data (Xfinal, Yfinal) that preserves counts, but is on a new arbitrary scale.
Sorry I have not posted code - I have code but it is far from stand-alone as it is embedded in a massive program. The above is the thought process - it is essentially mapping the integrated intensity curves onto each other.

Hope this helps,
Kurt

Thanks Csmallw!

That seems to make my spectra a lot more believable and consistent with old colleagues work!
I just read the x function on the help topic and it is the scaled row index for the wave of interest. So essentially what I am doing is taking the "delta wavenumber" of each segment of my wave and turning each of those into a "delta nm" and therefore constructing a correctly scaled wavelength x axis.
Please correct me if I'm wrong!

There is a software in the machine I took the measurement that converted the data but it did so using a "maximal conversion factor" and seemed to generate a good couple of thousand extra data points compared to the original "raw" data set. I assumed it was a fill factor. Any ideas why that software does that?

Anyway thanks again Csmallw, I'm glad the solution was simple!

Best wishes,
N

PS I'm using IGOR instead of the other software mentioned above because that other software you have to process spectra one at a time and remove backgrounds to individual data sets each time!
Hi Thanks Kurt,

I need to read through that again and try it out with my data. So I might post another comment later but this looks like a promising way to handle data also. Don't worry about the code as I think that was a clear thought process. I now need to try and understand the purpose behind each data manipulation.

Thanks for your help!

N

Another option you might consider for convenience is a simple addition to Chris Smallwood's suggestion:
duplicate/O YourDataWave xwave
xwave = 10^7/x
display YourDataWave vs xwave
Interpolate2   xwave, YourDataWave
display YourDataWave_CS

The Interpolate2 function (without additional flags) creates a default Cubic Spline interpolation from the non-uniformly spaced data in xwave and creates the auto-named wave of y-values with _CS suffix, having linear x-scaling. No further need of the xwave is required, unless you have a particular need. See the Command help or DisplayHelpTopic "Interpolate2" for further options on the interpolation.