Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Integration in MFC

Integration in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sakhalean
    wrote on last edited by
    #1

    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.

    C G 2 Replies Last reply
    0
    • S Sakhalean

      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.

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      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++

      S 1 Reply Last reply
      0
      • S Sakhalean

        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.

        G Offline
        G Offline
        goorley
        wrote on last edited by
        #3

        It's discrete data. Calculating the integral is really simple. If you can write a loop and use addition you will be fine.

        1 Reply Last reply
        0
        • C Cedric Moonen

          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++

          S Offline
          S Offline
          Sakhalean
          wrote on last edited by
          #4

          Ok thank you I will try.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups