how to fit a matrix with a wave as fitting variable?

Hello,
I have a set of two dimensional data modeled by an equation:


f[E,t]=e^(-g*t)*(s[E]-sp[E])+sp[E]

I know what s[E] is for all E, but I do not know what sp[E] is. I want to fit the data as a function of E and t in order to find what g and sp[E] is. I have written fitting code for single parameters numerous times, but have never done one where the fit parameter is actually a wave. Any ideas?
I think you just consider it to be a function of 2 variables and N parameters. That's a standard case (see Multi-variate fit demo in the example experiments).