Questions tagged [convolution]

A mathematical operation that combines two signals to generate a third signal. Convolution often arises in audio processing (e.g., filtering, reverb) and image processing (e.g., blurring, edge detection).

Convolution takes two signals and combines them to generate a third signal. For 1-D signals, the operation can be thought of as sliding the time-reverse of one signal along the other, and at each time step, taking the integral of the product of the signals (see wikipedia). The convolution operation describes the response of linear time-invariant systems to common input signals. Therefore, it commonly occurs in digital signal processing (DSP) contexts. Audio and image processing are two very common application areas for convolution.

A simple implementation for convolving two discrete time signals requires M*N multiply-add operations, where M and N are the lengths of the two signals. However, by taking advantage of the fact that convolution in the time domain is equivalent to multiplication in the frequency domain, and that transforming between domains can be implemented with O(N*log N) operations, convolution can be sped up. See here for more details.


Related tags

2052 questions
0
votes
1 answer

Convolution of a Gaussian with an asymmetrical Gaussian

I'm looking to convolve a Gaussian with an asymmetric Gaussian. My attempt at this is below. import numpy as np import matplotlib.pyplot as plt x=np.linspace(0,5,500) dx=x[1]-x[0] #…
freja
  • 47
  • 1
  • 6
0
votes
0 answers

Picking out a shape-coordinates in an image

I have some flat material on which I make a mark with a laser cutter - currently I'm marking a "plus"-sign. I would then like to take a picture and automatically find the mark so that I can calibrate the position of the laser to the material. Here…
0
votes
0 answers

Is there a program for 2D circular convolution in python

I am wondering is there a program defined for 2D circular convolution? If not, I am looking for how to perform it. I did search for it. Could not find anything. So I am wondering does anybody know it. Here is a sample 2D data I have taken a=…
user19013072
0
votes
1 answer

How to convolution integration(Duhamel Integration) by python?

Hi~ I'm studying about structural dynamics. I want to make a code about Duhamel Integration which is kind of Convoution Integration. If the initial conditions are y(0)=0 and y'(0)=0, Duhamel Integration is like this. enter image description…
SM KIM
  • 7
  • 2
0
votes
1 answer

1D Convolution of 2D arrays

I have 2 arrays of sets of signals, both 16x90000 arrays. In other words, 2 arrays with 16 signals in each. I want to perform matched filtering on the signals, row by row, correlating row 1 of array 1 with row 1 of array 2, and so forth. I've tried…
Jack
  • 107
  • 7
0
votes
0 answers

I'm running a convolution over an image with a randomized kernel. How to account for the added depth of RGB values?

I am trying to run a convolution with a randomized kernel over a image list created with PIL.Image. Doing it on my own worked, it's just very slow (0.00016 seconds per pixel, but that adds up). Here is the code for that: def convolve(list_, kernel,…
0
votes
0 answers

Scaling of convolution in python

I'm trying to get the impulse response and transfer function of a filter with an exponential sweep. To do so, I convolved the output of the filter (measure in my code) with the inverse filter of the sweep (invFilter). This should give me the impulse…
bouaaah
  • 25
  • 4
0
votes
0 answers

Convolution of two 3D numpy arrays in python

I need to convolve a (128,128,128) numpy array m with a (35,35,35) kernel k. I am looking for something like Matlab's convn function convn(m,k,'same') The most similar function I found in python is ndimage.convolve() but is not the same. Can…
carluri
  • 93
  • 2
  • 6
0
votes
1 answer

[cv2.filter2D() on Python]: why does it return these specific values?

The following Python script computes the 2D convolution of the blue color channel of a .jpg image: It reads a 6x6 BGR image: It extracts the channel 0. In cv2 this corresponds to color channel blue. I print the values of the channel Input data…
0
votes
0 answers

Fastest Python implementation of vector field gradient-like contour detection in RGB image

I consider an RGB image as a discretization of a vector field f whose domain is the 2D grid of pixels and whose image is a subset of the RGB cube (each colour is a vector with three components). I want to compute a scalar field g which is related to…
Alberto
  • 1
  • 1
0
votes
1 answer

How do I apply a function to every row of a csv file and save the new data into a new file?

I have this MNIST data set of 10,000 rows and I'm trying to apply a convolution kernel to every single row, but what my code does only produces the last line after it's done. It's been reshaped to 28,28. This is a snippet the raw original data set.…
Moe
  • 1
  • 1
0
votes
1 answer

2D tiled convolution taking more time than untiled version

Writing a code that perform a 2D convolution on a float matrix, in both tiled and untiled version. I'm assuming the width of the tile as BLOCK_SIZE - MASK_WIDTH + 1 , using halo cells. But for a 1024 matrix and masks varing from 3 to 9 I get the…
0
votes
0 answers

numpy.convolve of two sets of polynomial coefficients

I am trying convolution of two signals after finding the polynomial coefficients of the signals. But I guess when I try to fit the values from the convolution to plot the graph, I am making a mistake. Can anyone please help? Thanks. from…
MRR
  • 45
  • 1
  • 6
0
votes
0 answers

Combination of three 1D convolution kernel

What is a kernel equivalent to applying [1/3 1/3 1/3] three times on an image? Is there any formula to formulate the problem? I know the keyword is convolution associative, but I am still clueless. Thank you.
0
votes
1 answer

how does depth_multiplier in tensorflow DepthwiseConv2D work?

Currently I am studying about Computer Vision, and studying about Depthwise Convolution. (Not Depthwise Seperate Convolution!) So, What I want to know is how does "depth_multiplier" argument works. First of all, When not using "depth_multiplier" and…