Physics 408: Optics Laboratory


Michelson Lab survival guide


Check carefully the "FT-Spectroscopy.m" file since it may need to be corrected


The old version of this code (still floating around) is off
by two bins, which biases the spectrum low by more than 5 nm at 640 nm
(so the laser calibration step will be off by around 7nm).

The problem is that the line
    fftdata_oneside =fftdata(NFFT/2:NFFT)
includes a negative frequency bin (N/2) and the 0 frequency bin (N/2 +
1).  But when the wavelengths are calculated, the index vector 1:N/2+1 is
used, which starts at the first non-zero k (which should correspond to
fftdata(N/2+2).

So the quick fix is to change that line to
    fftdata_oneside = fftdata(NFFT/2+2:NFFT)
and the n = 1:1:NFFT/2+1 line to
    n = 1:NFFT/2-1

- correction by Matthew Hasselfield: Oct. 30, 2008