468,456 Members | 1,843 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,456 developers. It's quick & easy.

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 11207

Ruan Hongning wrote:
Hi, Friends:

May I know what's the fastest way to implement 1D/2D convolution?
Buy a book on DSP and read it?

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?

Buy a book on DSP and read it?

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
computer, ask in comp.programming.

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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
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.

"Duncan Muirhead" <no***@this.addresswrote in message
news:pa****************************@this.address.. .
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?

Buy a book on DSP and read it?

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.

Similar topics

reply views Thread by Andrew Crowe | last post: by
25 posts views Thread by Stijn Oude Brunink | last post: by
3 posts views Thread by PengYu.UT | last post: by
6 posts views Thread by ma740988 | last post: by
16 posts views Thread by LabWINC | last post: by
11 posts views Thread by Tomi Lindberg | last post: by
14 posts views Thread by danfan1981 | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.