14
votes
Accepted
Does Mathematica reuse previous computations?
Here I implemented three different versions of Gaussian filtering (for periodic data). It took me a while to adjust the constants and still some of them might be wrong.
Prepare the Gaussian kernel
<...
10
votes
Accepted
Can I use ListDeconvolve or any other functions to get the original kernel?
In this case, the following works just fine:
LeastSquares[
Transpose@Through[{RotateLeft, Identity, RotateRight}[data1]],
conv
]
{0.333333, 0.333333, 0....
9
votes
Accepted
Dilation on 3D Images?
Unfortunately, MXNet does not support 3D convolutions with dilations yet. This can be seen in the MXNet source for convolution.
9
votes
Accepted
How does `DirichletConvolve` relate to Dirichlet convolution?
Consider the following code
f[n_, p_] := n^p
g[n_, p_] := n*p
DirichletConvolve[f[n, p], g[n, p], n, 4]
First, we define two functions ...
8
votes
Accepted
Incorrect evaluation of a convolution
That does not explain why your solution does not work (I'm pretty sure it is because of your definition of stripe), but if you replace ...
8
votes
Accepted
Analog of MATLAB's conv2 in Mathematica?
Not sure if I've guessed definition of conv2 accurately, but the following does reproduce the output of MATLAB. (Tested in Octave. )
...
8
votes
Why does ImageDeconvolve not restore this image?
The answer is that you are asking too much of deconvolution. The following code shows images blurred and refocused with different degrees of blurring.
...
7
votes
Convolution of Gaussian and Lorentzian functions
It seems, that MMA can't do that integral analytically (working with Version 8.0). Also Convolvedidn't do the job.
Do it numerically. By the way, don't use ...
7
votes
Accepted
NetEncoder for images of "Varying" dimension?
Automatic is not the same as "Varying".
Example 1
This works:
...
7
votes
Accepted
Rewrite the power sum in terms of convolution
Let's focus on the part that is giving you trouble: the term
$\sum_{k=0}^{m-1}k^t(m-k)^t$, which is written in code as:
Sum[k^t (m - k)^t, {k, 0, m - 1}]
For ...
7
votes
Does Mathematica reuse previous computations?
It's hard to know for sure, but one way to test for caching is to apply a single command to lots of data sets, or to apply the command separately to each set. For instance:
...
7
votes
7
votes
Accepted
Speeding a Manipulate illustrating convolution
As pointed by Nasser in comment above, Convolve is having difficulty in handling certain combination of f and ...
6
votes
Accepted
Using Convolve and Manipulate
First, you need to define the convolution of the two functions. Then plot it:
...
6
votes
Accepted
6
votes
Accepted
Symbolic Evaluation of Convolve Between DiracDeltas Where the Variable Appears In a Sqrt
To evaluate the convolution you need the transformation rule
( see wikipedia )
...
5
votes
Incorrect evaluation of a convolution
With x and d not numeric:
If[EvenQ[Quotient[x, d]], 1, 0]
(* 0 *)
The essential ...
5
votes
Accepted
Coefficients of Knuth's "Convolution Polynomials"
As Michael notes, deleting the stray brackets will make it work. A better method, however, would be to use SolveAlways[]:
...
Community wiki
5
votes
Speedup ListCorrelation when using generalized correlation function
... 3 years later at least for 2D problems:
ImageCorrelate[pData//Image, krData, CosineDistance]//ImageData
5
votes
Can I use ListDeconvolve or any other functions to get the original kernel?
This is a bit roundabout but one can treat this as a polynomial algebra problem. First pad both ends of data and convolution result with zeros so that the convolution emulates polynomial ...
5
votes
Convolution and cross-correlation of two discrete signals
Define a Gaussian kernel. The width is specified by s
kernel = #2 Exp[-(t - #1)^2/(2 s^2)] &;
Define a function to compute ...
5
votes
How do I implement convolution integrals symbolically (not numerically)?
On second thought, I don't think your approach to calculating the convolution is mathematically sound. The Wiki page, and the MathWorld page it references, both state that "the integral of a ...
4
votes
Accepted
Multiple discrete RV convolutions performance
Probability generating functions might be the way to go. Here's the pgf (probability generating function) of a single random variable:
...
4
votes
Accepted
single slit diffraction numerical simulation
I believe that the problem is the Nyquist limit. You are representing the slit as sampled array of zeros and ones. The bandwidth of the edge is infinite so at any sample interval you will be ...
4
votes
The curious case of Convolve function
I don't know why Mathematica returns the incorrect result, but it may be helpful to have the correct result so as to find the origin of the bug.
To find the correct result, one may generate the first ...
4
votes
Accepted
ListConvolve returns only one value
You need to tell ListConvolve how to handle "end conditions". Since your sequences are about the same length, everything is an end condition. Hence:
...
4
votes
Infinite long sequence convolution error
When using 2 instead of b, Mathematica can use the fact that 2>0. So, you can get the simplification you want by adding the ...
4
votes
Can I use ListDeconvolve or any other functions to get the original kernel?
To approximate ker using ListDeconvolve, use data1 as the kernel. Increasing ...
4
votes
Accepted
Numerically convolve lists in mathematica
Both your HannWindowand $\chi$ function are Indeterminate at $x=0$ so I created a function that uses the Limit at $x=0$ or I ...
4
votes
Convolution integrals
The problem is that Mathematica has a specific use for the ' character (namely Derivative). Changing ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
convolution × 157calculus-and-analysis × 24
distributions × 12
list-manipulation × 11
functions × 11
image-processing × 11
fourier-analysis × 11
plotting × 8
performance-tuning × 8
bugs × 7
probability-or-statistics × 7
numerical-integration × 6
neural-networks × 6
numerics × 5
fitting × 5
symbolic × 5
signal-processing × 5
recursion × 4
machine-learning × 4
integral-transforms × 4
function-construction × 3
manipulate × 3
special-functions × 3
polynomials × 3
discrete × 3