*Internet Service Required
Price data per hour

# Price data per hour

### All Replies

• Monday, January 23, 2012 8:22 AM
Moderator

Hi,

I am not familiar with Nyquist-Shannon sampling theorem. Do you mean you want to calculate some data based on the formula described in http://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem? It seems to use Fourier transform. As far as calculate an approximate value for a definite integral programmatically, you can use the definition of definite integral:

Lim(Sigma(f(xi)*DeltaX))

Divide the region to an infinite number of subintervals, calculate each subinterval’s area, and add them together. One of the solutions is to use a rectangle to emulate each subinterval. Of course we won’t be able to divide the region infinitely. So we can approximate the result by, say use 1000 intervals. It’s easy for a computer to calculate the areas for 1000 rectangles. We can also use Simpson’s Rule which may give us better result (use quadratics instead of rectangles). I am not sure how to calculate Fourier transform as it seems to require calculate a definite integral from negative infinite to positive infinite. But according to http://en.wikipedia.org/wiki/Fourier_transform, in most cases you can use –T/2 and T/2 as the lower/upper bound, so this is essentially a definite integral. And since Fourier transform seems to assume the original function converges between the interval, I “guess” this approximation can work in most cases.

In addition, if you have more questions regarding math, I would recommend you to post a thread on a math forum, there are more related experts in math forums.

Best Regards,

Ming Xu.

Please mark the replies as answers if they help or unmark if not.
Microsoft One Code Framework
• Friday, January 27, 2012 4:31 AM
Moderator

Hi,

I will mark the reply as an answer. If you find it no help, please feel free to unmark it and follow up.

Thanks.

Best Regards,

Ming Xu.

Please mark the replies as answers if they help or unmark if not.