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
0 answers

3D convolution for a RGB image

I'm trying to implement a convolution operation for a RGB image by applying the 2D convolution to each channel independently. Following is my code: kernel = np.array( [ [1,0,1], [0,0,0], [1,0,0] ]) image=images[1] Hi,…
0
votes
0 answers

Is it possible that Neural Network finding Deconvolution kernel without recursive process?

Let's assume that we receive a and b, which are 1D signals of time T. At this time, if the relation of a(t) = k ⊗ b(t) holds, is there a way to find the deconvolution kernel k with a Neural Network (not an recursive method)? This problem can be…
0
votes
1 answer

Sharpening filter and convolution function almost working, but something is wrong

So I am implementing a convolution function to apply the filters I need for my exercise, my blur filter works correctly, the output image is what i should get. The sharpening filter gives something kinda ok except it has a lot of abrupt pixels, what…
beginner
  • 11
  • 4
0
votes
1 answer

Can I share weights between keras layers but have other parameters differ tf2?

is there a solution to sharing the weights of convolution layers with different paramters in dilation? like here I want to train the weights of the layer with different dilations meaning that every dilation should have an impact to the weights I've…
0
votes
1 answer

Is there a name for a convolution that has the same size as the input?

I have an input tensor of dimensions (C, H, W) and kernel with size (H, W). It feels like there should be a name for this but I am unaware and can't get Google or ChatGPT to show it to me. Is there a name for this?
Vodis
  • 122
  • 1
  • 7
0
votes
0 answers

Numerical convolution between functions in IDL

I've been trying to plot the numerical convolution between a gaussian and another function in IDL, with poor results. So far I tried using the functions convol and convolve in the following way: pro num_convolution dist = findgen(4000.)/100. -…
0
votes
1 answer

Write a convolution code, but returns me a "Mosaic" image. Can anyone see what is wrong with my code?

I want to implement the convolution using numpy and python by myself: This is my code: def add_padding_to_image(img, kernel): old_image_height, old_image_width, channels = img.shape padding_width = kernel.shape[0] // 2 new_image_width…
0
votes
0 answers

Why is OpenCV's sepFilter2D slower than filter2D and both are slower than a sequential application of 1D filters?

I'm a looking for a way to compute 2D convolutions/correlations fast on large images, preferably in Python. My filters can be made separable, though I incur some added computational cost. The fastest way to compute a 2D convolution that I have found…
Amit Hochman
  • 111
  • 3
0
votes
0 answers

Convolution integral with non-trivial extremes of integration in python

for a given array f of size N that represents discrete values of a function of x I would like to evaluate g(y) = integral from zero to y of f(x)*f(x-y) dx in python. How do I do that? I'm failing to see a solution, while the convolution would be…
SO_32
  • 31
  • 4
0
votes
1 answer

Convolve a grid of delta functions, with random positional offsets at the pixel level, with a kernel, in Python

The convolution of a regular grid of Dirac delta functions with a kernel is pretty standard: import numpy as np deltas = np.zeros((2048, 2048)) deltas[8::16,8::16] = 1 # Construct a Gaussian kernel x, y = np.meshgrid(np.linspace(-2, 2, 15),…
Alex van Houten
  • 308
  • 3
  • 17
0
votes
0 answers

Is smoothing a causal transformation?

After looking at such a plot, I'm asked if my smoothing is causal. Once, during pre-processing, I smooth my raw data using this function: def _smooth(x, data_freq): LpFilt_cutoffFreq = 4 LpFilt_order = 4 lowpass_filter =…
Zahra
  • 1
  • 2
0
votes
0 answers

Kernel size of dimension WxH for MinkowskiConvolution

Can somebody explain how to define a convolutional layer with kernel size of WxH using MinkowskiEngine library? Or it is not possible to do that for some costrains using sparse tensors? I haven't tried nothing yet cause on the documentation I can't…
0
votes
1 answer

Fitting data with Voigt profile in lmfit in python - huge errors

I am trying to fit some RIXS data with Voigt profiles (lmfit in Python), and I have defined the Voigt profile in the following way: def gfunction_norm(x, pos, gwid): gauss= (1/(gwid*(np.sqrt(2*np.pi))))*(np.exp((-1.0/2)*((((x-pos)/gwid))**2))) …
0
votes
0 answers

How to make a convolutional - deconvolutional neural network that gives the same output dimension as the input dimensions?

Input dimension is (257,40,1).Output dimension after 5 convolutional layer is (8,1,64). I am using tensorflow for model's implementation. I tried by changing the padding to 'same' or 'valid' of various layer, but output dimensions are coming…
0
votes
1 answer

Circular convolution of binary vectors (mod 2) using NTT

Let x, y be vectors of length n, with entries either 1 or 0. I want to efficiently compute the circular convolution (x * y) mod 2 Where each component of the result is taken mod 2. I know how to do it using a Fast Fourier Transform (multiply Fourier…
Adomas Baliuka
  • 1,384
  • 2
  • 14
  • 29