Integration in MFC
-
Hi everyone, I want to do integration in MFC coding. Is there any formulas for doing this one. Actually i want to do the Ramp,Sin waves of formulas for simulation of signals Ramp wave required integration. how to do integration in programming. Any library or header files which will do integration.
-
Hi everyone, I want to do integration in MFC coding. Is there any formulas for doing this one. Actually i want to do the Ramp,Sin waves of formulas for simulation of signals Ramp wave required integration. how to do integration in programming. Any library or header files which will do integration.
Do you want to do the integration in real-time ? Is an approximation ok for you ? There's an easy and quick way to make an integration, but it is an approximation (and the error margin depends on your sample rate and signal variation). If you remember that an integration of a signal is the calculation of the area under the curve of the signal, you can reach a good approximation by using an "average" method. When you have two consecutive points of your signal, you will approximate the surface under those points by taking the average Y value and calculate the surface of the rectangle made by this Y and the X difference between the two points. This looks like:
double dSurface = (Y2 + Y1)/2 * (X2 - X1);
You then need to add all these surface together to get an approximation of the total surface under the curve.
Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++ -
Hi everyone, I want to do integration in MFC coding. Is there any formulas for doing this one. Actually i want to do the Ramp,Sin waves of formulas for simulation of signals Ramp wave required integration. how to do integration in programming. Any library or header files which will do integration.
-
Do you want to do the integration in real-time ? Is an approximation ok for you ? There's an easy and quick way to make an integration, but it is an approximation (and the error margin depends on your sample rate and signal variation). If you remember that an integration of a signal is the calculation of the area under the curve of the signal, you can reach a good approximation by using an "average" method. When you have two consecutive points of your signal, you will approximate the surface under those points by taking the average Y value and calculate the surface of the rectangle made by this Y and the X difference between the two points. This looks like:
double dSurface = (Y2 + Y1)/2 * (X2 - X1);
You then need to add all these surface together to get an approximation of the total surface under the curve.
Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++