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

CIConvolution chain leads to integer overflow

I've been doing some work with Core Image's convolution filters and I've noticed that sufficiently long chains of convolutions lead to unexpected outputs that I suspect are the result of numerical overflow on the underlying integer, float, or half…
bd1170
  • 13
  • 4
0
votes
1 answer

CS50 Blur filter gave incorrect outputs with small test cases

I am writing the mean blur filter for the filter task in CS50 (more comfortable version). When I tested it with some my pictures, it seemed to work fine. However, when I tested it with CS50 test cases, it gave wrong results for small matrices. Below…
akooi
  • 80
  • 6
0
votes
1 answer

Convolution function gives segmentation error while getting pixel value of relative image coordinates

I'm trying to write a convolution function in C for my computer vision study. In this function, every pixel in the convolved image is a sum of product of original image and filter kernel like in this image and this gif. In the code below pixel…
enesdemirag
  • 325
  • 1
  • 10
0
votes
1 answer

How to test my generated assembly program?

I've made a program which generate assembly instructions according to arguments for my vector extension to perform convolution. Note that I assume My vector extension doesn't have a loop or branch instruction However, if I set input width = 7,…
laurent01
  • 115
  • 8
0
votes
1 answer

Validation of Keras Conv2D convolution using NumPy return different layer output

I am trying to validate the output of the first layer of my network build using standard Keras. The name of the first layer is conv2d. I built a new Model just to get the output of the first layer, using the following code: inter_layer =…
fPecc
  • 115
  • 7
0
votes
1 answer

Assembly Convolution with manual memory management

I have riscv processor and extension processor which is programmable. In other words, the extension has its own unique ISA. I will insert instruction to this extension to perform convolution by the program which runs at the riscv processor. In other…
laurent01
  • 115
  • 8
0
votes
1 answer

Convolve array with kernel of variable standard deviation

Good day to you fellow programmer ! Today I would like to do something that I believe is tricky. I have a very large 2D array called tac that basically contains time curve values and a file containing a tuple of coordinates called coor which…
Murnawful
  • 135
  • 1
  • 12
0
votes
1 answer

How to use masking with Convolution1D layer in keras?

I am trying to perform a sentiment classification task for which I am using Attention based architecture which has both Convolution layer and BiLSTM layers. The first layer of my model is a Embedding layer followed by a Convolution1D layer. I have…
0
votes
0 answers

Benefit of convolution with input_hole and mask in image inpainting project

I am studying inpainting on a "damaged" image's project from papers. And I realized that recently people often combine image with hole (3-channel) and mask(1-channel) to be input (they concat to become 4-channel). There is even case where it add…
0
votes
0 answers

Keras Conv2D with extended Batch Shape

Hello I am trying to use the last example from keras Conv2D # With extended batch shape [4, 7]: import tensorflow as tf input_shape = (4, 7, 127, 127, 3) x = tf.random.normal(input_shape) y = tf.keras.layers.Conv2D(2, 3, activation='relu',…
aiguy990
  • 1
  • 1
0
votes
1 answer

Fit a convolution in python

I am a bit confused about convolutions in python. I tried to define this function: from scipy import signal import numpy as np import matplotlib.pyplot as plt def f(x,A,t,mu,sigma): y1 = A*np.exp(-x/t) y2 =…
JohnDoe122
  • 638
  • 9
  • 23
0
votes
1 answer

How can I implement a natural blur filter? (Convolution Kernel)

Currently, I'm implementing blur filter using opengl in Android. The blur filter is implemented through the shadertoy site. Adjust the Size value using the source below to apply blur properly. However, if you apply that source to Android, it is…
Woodong
  • 51
  • 3
0
votes
1 answer

Optimization of 3D Direct Convolution Implementation in C

For my project, I've written a naive C implementation of direct 3D convolution with periodic padding on the input. Unfortunately, since I'm new to C, the performance isn't so good... here's the code: int mod(int a, int b) { // calculate mod to…
lxiangyun93
  • 77
  • 1
  • 7
0
votes
0 answers

conv2 in octave showing a white image

I am using conv2 to perform convolution on a gray image. conv2 was returning a floating value so I performed floor operation on it. The input image is: The code: clc; clear all; close all; img = imread("balloonGrayNoisy.jpg"); z = ones(3,…
darkexodus
  • 147
  • 1
  • 14
0
votes
1 answer

Convolutional filter applied to Fourier-transformed signal

I understand that the Fourier transform of a convolution of two signals is the pointwise product of their Fourier transforms (convolutional theorem). What I wonder is there known cases where a convolution can be meaningfully applied to a…