Okay, so now I'm confused as to what you mean by 'stairs': there's no stairs in the result based off the code I posted...
Are you wanting the signal to be smoothed out (bezier curve fit)? This is almost never done on any data acquisition system, as it doesn't represent the data...to do an FFT (which is a large subject in itself), you'll need to read a few books - numerical recipes in C is a good one if you are doing signal analysis.