473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 11740

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew Crowe | last post by:
Hi guys, We've got a content management system in PHP that allows users to upload images that are resized and sharpened. The resizing is done using the GD libraries resampling function and to...
25
by: Stijn Oude Brunink | last post by:
Hello, I have the following trade off to make: A base class with 2 virtual functions would be realy helpfull for the problem I'm working on. Still though the functions that my program will use...
3
by: PengYu.UT | last post by:
I want to define a convolution operator for two Array objects. Unfortunately, * operator has been used for Array class. +,-,/ are not good candidates for convolution. Is there any other...
2
by: yezi | last post by:
Hi: I am coding a convolution for discrete system from minus infinity to infinity, where can i get the algorith ? Thanks for any refer.
2
by: MrPolite | last post by:
I'm using a 5x5 convolution matrix to do some image processing. (I don't really know much about image processing). I lose 2 pixels from the edges of the image. When I apply any 5x5 matrix in...
6
by: ma740988 | last post by:
Oh what fun it is to get acclimated with the various containers and algorithms.. I'm trying to determine if I could use find/find_first_of algorithms to achieve the same object of a for loop when...
16
by: LabWINC | last post by:
Hi all, i'm looking for a module to implement a digital FIR filter! Can anyone help me? Thanks, Vincent
11
by: Tomi Lindberg | last post by:
Hi, I'm trying to find a way to calculate a distribution of outcomes with any combination of dice. I have the basics done, but I'm a bit unsure how to continue. My main concern is how to make...
14
by: danfan1981 | last post by:
Hi, I am using Python Thread library for my parallel processing course project. I am doing matrix convolution on a multi-processor machine running Solaris. I just found out that no speed-up is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.