Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to import mathematical algorithms in C?

Status
Not open for further replies.

ltsi

Programmer
Jul 10, 2003
7
FR
Hello,

I have to import and implement algorithms in C (for signal processing)in order to apply it to a signal (displayed in a CView).
Here is the situation: i have a CView and a CFormView (split window). I'd like to create a button in the CFormView that would enable me to apply automatically (by clicking)the mathematical algorithm to the signal in the CView (Spectrum calculating, FFT,...).

If someone knows how to do it, It would be nice.
Thanks.
LTSI.
 
Keep a pointer to the data shown in the view available globally. I have an application that uses the MFC arrays CArray<double, double&> to hold my data.

You can add the following functionality to your CView class. I found these features useful when displaying data in my &quot;virtual scope&quot;: click and drag zoom, markers, ...

Your CFormView can operate in a number of ways. I found that I quickly was able to add many mathematical operations (FFT, IFFT, Magnitude, Average, Std Deviation ...). You may find that you begin to run out of realestate quickly. In that case, instead of using buttons, you can implement a list. Each operation can be performed with a double click.

As far as the implementations of the algorithms you will want to get a hold of the book &quot;Numerical Methods in C++&quot; for efficient code. It makes a big difference in the heavy math operations like FFT.

Hope this helps.
 
edit with class wizard(by pressing CTRL+W the method OnCommant of your CView, and handle there the click on the button what you should create.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Thanks bCravens for your answer.
But do you have any code examples (from your CView or CFormView) that you used for creating and implementing signal processing functions such as FFT?
If yes, could me you give me some?
Thanks.

LTSI
 
The book &quot;Numerical Methods for C++&quot; has cut and paste code for many high level functions. If you go a google search you can even find the book chapters as free downloads.

Unfortunately, my exact code was developed for a business application that I am not at liberty to share.

When you find the book, I believe you will probably have all the code that you may need for DSP.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top