Thanks for the help. But why when I increase N, the results curve then get "sharper"? If my N is larger, that means I have more terms, shouldn't the results look more like a Gaussian? why it only make the curve narrower than expected? Is it mean something still wrong with my code?