471,092 Members | 1,071 Online

# 2D convolution

Hi, Friends:

May I know what's the fastest way to implement 1D/2D convolution?

Thanks & Regards
Hongning.
Jul 12 '06 #1
6 11474

Ruan Hongning wrote:
Hi, Friends:

May I know what's the fastest way to implement 1D/2D convolution?

My guess is a for loop and multiplications.

Tom

Jul 12 '06 #2
On Wed, 12 Jul 2006 07:04:56 -0700, Tom St Denis wrote:
>
Ruan Hongning wrote:
>Hi, Friends:

May I know what's the fastest way to implement 1D/2D convolution?

My guess is a for loop and multiplications.

Tom
Off topic, I think. sci.math.num-analysis perhaps?
For what it's worth I've found that (my implementation of)
1D convolution via the fft is faster than the straightforward
implementation for (double) vectors of length greater than 64,
and slower otherwise, on a common or garden pc using gcc.
Implementing convolution using the fft is discussed in numerical
recipes, for example.
Duncan

Jul 12 '06 #3
On Wed, 12 Jul 2006 17:28:50 +0800, "Ruan Hongning"
<rh******@dso.org.sgwrote:
>Hi, Friends:

May I know what's the fastest way to implement 1D/2D convolution?
Use an analog computer. If you must use an algorithm on a digital

--
Al Balmer
Sun City, AZ
Jul 12 '06 #4
Ruan Hongning wrote:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Do whatever you need to do to stop your newsreader (Outlook Express, of
course) from posting in HTML.

Brian
Jul 12 '06 #5
I've known the algorithm clearly. What i want to know its implementation in
C.

In <<Numerical Recipe in C>>, it suggested computing convolution via fft. We
have known that convolution is also a filtering. That means we can compute
it via its definition. If one matrix's size is big, another one is very
small, e.g. 3x3, how about the computation time for these two methods ?

Thanks & Regards
Hongning.

On Wed, 12 Jul 2006 07:04:56 -0700, Tom St Denis wrote:
>>
Ruan Hongning wrote:
>>Hi, Friends:

May I know what's the fastest way to implement 1D/2D convolution?

My guess is a for loop and multiplications.

Tom
Off topic, I think. sci.math.num-analysis perhaps?
For what it's worth I've found that (my implementation of)
1D convolution via the fft is faster than the straightforward
implementation for (double) vectors of length greater than 64,
and slower otherwise, on a common or garden pc using gcc.
Implementing convolution using the fft is discussed in numerical
recipes, for example.
Duncan

Jul 13 '06 #6

Ruan Hongning wrote:
I've known the algorithm clearly. What i want to know its implementation in
C.

In <<Numerical Recipe in C>>, it suggested computing convolution via fft. We
have known that convolution is also a filtering. That means we can compute
it via its definition. If one matrix's size is big, another one is very
small, e.g. 3x3, how about the computation time for these two methods ?
Ah, homework questions.

T'is the season to be cheatin'

I'm sorry but IIRC a basic convolution is what? a MAC operation? Not
exactly challenging in C [and totally OT for this group too]. for loop
+ multiplication + array lookups + addition? What am I missing?

Oh you want someone to write out the code for you?

Tom

Jul 13 '06 #7

### This discussion thread is closed

Replies have been disabled for this discussion.