Hi, I need to create a utility to take a set of measurements of a function on the unit sphere, specified as (x,y,z,value) and convert that into a smoothly interpolating spherical harmonic representation.
I've read the article here that describes how to project a function into the SH basis using various numerical integration techniques. My understanding is that I should be able to just multiply each of my function's samples with the basis functions evaluated at the sample's XYZ direction, then accumulate the results to get a SH expansion for the function samples.
My question is, how well will this work if I only have a few samples of my function, possibly with irregularly spaced samples? Will the SH basis smoothly interpolate just a few (e.g. 3 or 4 values) samples, or do I need to do a monte carlo integration scheme where I sample a separate function that uses the nearest sampled neighbor for the query direction.