Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

can VC++ create convolution functions

Status
Not open for further replies.

J_expoler2

Member level 4
Member level 4
Joined
May 10, 2003
Messages
77
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
619
Hi
i'm study convolution functions but in problem
how to make function receive floatingpoint input array
and return output floating array too i'm try to create it but id doesn't work


float x[10] ---->| H(Z) | --------> float y[10]


:?: :?: :?:
Thank
 

You may use pointer(or reference) as the function's parameters and modify the array itself. For example,

conv(x, h) will calculate the convolution of x * h and store the results to x.

conv(x, h, y) stores the results to y.

y=conv(x, h) returns the results pointer. The results array should be dynamic allocated by memory allocation functions.
 

It's not safe returning object arrays. You can do that, but you should know well the language.

2 ways of doing "float x[10] ---->| H(Z) | --------> float y[10] ":

--
float function( float )
{
}

int nMember;
float x[ 20 ], y[ 20 ];

for( nMember = 0; nMember < 20; ++nMember )
y[ nMember ] = function( x[ nMember ] );

-- or --

bool function( float x[], float y[], int nMaxMembers )
{
int nMember;

for( nMember = 0; nMember < nMaxMembers; ++nMember )
y[ nMember ] = compute_function( x[ nMember ] );

return( true );
}

float x[ 20 ], y[ 20 ];

function( x, y, 20 );
--

Wagner.
 

Pointers will do the trick i remember having implemented almost all possible DSP Algos using C++ , so definately its possible in VC.

I am a big fan of pointers so i guess you will require pointers to functions and then make the function return the pointer...(even ** i.e. 2 level ptrs will be really useful)try it...
i'll see if i could send you the codes (prob is they are copyrighted if my seniors agree i'll send it across)
 

You also can use a matrix class similar to matlab & write some function such as convolution for it.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top