From Matlab to C / C++ : Improving Perfomance

Status
Not open for further replies.

pooz

Newbie level 5
Joined
Jul 1, 2010
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,347
Hi,

I want to port my Matlab Code to a C / C++ code. What are the essential rules to pay attention to, when creating a ressource-friendly code for real-time application?

For example: How to realize vector operation in C? Should I go with a for-loop and process element by element?

Thanks.
Cheers.
 

Well,
DO not use the automatic conversion of matlab to C using the mcc command.
Try to use a compiler that supports vectoring like the new gcc versions.
If your performance is not met, we can discuss more about it here in this thread.
--
Amr
 

Hi Amr,

thanks for your reply.
Ok, I will use a new gcc compiler.

I want to implement an audio-application as a VST-Plug-In for real-time processing.
I used to process each element in an array for its own, and increased a pointer in a for loop. But I guess, a vectoring compiler would do it faster, wouldn´t it?

Is there anything else, I shoud think about?

Thanks in advance.
cheers.
 

Try the vectoring and lets C what we will have.
--
Amr
 

Yes, it will. Are you using a DSP processor?
--
Amr
 

No, I would implement as a VST-Plug-In on a PC using MS Visual Studio (and the shipped compiler)
 

Sounds interesting, hope when you finish your work to share it with us.
--
Amr
 

The vector extention you mentioned and which I gave a link seems to complicated to me. I will give IT++ (ITPP) a try. It is similar to matlab´s syntax, but with a good speed.
 

The vector extension is a new thing in gcc.
Anyway, feedback me with your progress.
--
Amr
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…