conversion: spectrum -> RGB -> spectrum



Hello,

I have a problem. I want to transform an RGB value from an image to
the equivalent spectrum and transform it back to RGB.....
Can somebody explain me how to do this.....
I have tried to implement the paper "Deriving Spectra from Colors and
Rendering Light Interference" from Sun, Fracchia, Calvert and Drew in
Matlab as a prototype....
The problem is that I don't get their results (the relative error from
RGB -> spectrum ->RGB)....
So I am a little bit confused doing everything right....
Can please somebody explain me the correct order of the transformation
from RGB to spectrum and then back......? I am not 100 percent sure about
this....
I would also be happy if somebody can give me the general procedure....

Cheers,
Dirk

.