The Stack Overflow podcast is back! Listen to an interview with our new CEO.
39

Convolution is correlation with the filter rotated 180 degrees. This makes no difference, if the filter is symmetric, like a Gaussian, or a Laplacian. But it makes a whole lot of difference, when the filter is not symmetric, like a derivative. The reason we need convolution is that it is associative, while correlation, in general, is not. To see why this ...


10

One-dimensional version The one-dimensional version that you list won't work. When there is a large enough shift in images (more than one or two pixels in real-world images), there will be nothing relating the column pixels. For an example of this, try: I5 = rand(100,100)*255; I6 = zeros(100,100); I6(11:100,22:100) = I5(1:90,1:79); So that we have I5: ...


8

Yeah, it can mess you up pretty badly if you don't get the fundamentals right off the get-go. This is how I interpret correlation, and it has worked for me for what I do for a living. Let's start off with a relatively simple example. Take a look at the following figure (pulled from dspguide... this is actually a great online book for knowing the basics of ...


7

The (linear or aperiodic) convolution of two vectors $\mathbf x = (x[0], x[1], \ldots, x[N-1])$ and $\mathbf y = (y[0], y[1], \ldots, y[N-1])$ is a vector $$\mathbf z = {\mathbf x}\star {\mathbf y} = (z[0], z[1], \ldots, z[2N-1]).$$ On the other hand, their cross-correlation is a vector $$\mathbf w = {\mathbf x}\otimes {\mathbf y} = (w[-(N-1)], w[-(N-2)], \...


7

I can tell you of at least three applications related to audio. Auto-correlation can be used over a changing block (a collection of) many audio samples to find the pitch. Very useful for musical and speech related applications. Cross-correlation is used all the time in hearing research as a model for what the left and ear and the right ear use to figure ...


7

Let $\theta_a$ and $\theta_c$ respectively denote the maximum magnitudes of the off-peak or out-of-phase periodic autocorrelation functions and the periodic crosscorrelation functions of a set of $K$ sequences of length $N$ and energy $\sum_{n=0}^{N-1}|x[n]]|^2 = N$. In a seminal paper published in 1974, Welch proved that $$\max\big(\theta_a, \theta_c\big)\...


7

No. Quoting Wikipedia's article Independence (probability theory): If $X$ and $Y$ are independent random variables, then the expectation operator $\operatorname{E}$ has the property $$\operatorname{E}[X Y] = \operatorname{E}[X]\operatorname{E}[Y].$$ Consider your $X(t_1)$ and $Y(t_2)$ as $X$ and $Y$ in this answer. If both $\operatorname{E}[X] \ne ...


6

How did you plan to use the FFT in the first place? If it is to naively look for peaks in the magnitude spectrum and deduce the frequency from it, this is a bad idea. As you have seen, this has a limited resolution in the lowest frequencies. Resolution limitations aside, looking for a peak in the FFT is a poor way of estimating periodicity since the true ...


6

There a few commercial algorithms that do exactly that (Dolby Prologic, DTS Neo 6, Lexicon Logic 7, Bose Videostage, etc.). If your project has the funds, you can simply try to license one of those. The inner workings of these algorithms are rather complicated and typically a mixture of time domain and frequency domain feature extraction, some steering ...


5

Generally speaking, about the only restriction that the signals need satisfy is that they have finite energy or power. Since you mention vectors by which is presumably meant $N$-tuples of real or complex numbers and dot products, the restriction is the trivial one that each component of the $N$-tuple has finite value. Practically, there are several issues ...


5

First off, you should use whichever tool is appropriate for the job. Correlation vs coherence vs wavelet-based correlation are all different things, so this question is kind of like asking "Which is better? Screwdrivers or hammers?" It depends on what you're trying to do, and whether you care about similarity in time, frequency spectra, or both. Second, I ...


5

It depends on the normalization that you perform on the data. Note that for computing the Pearson correlation coefficient you subtract the means of the signals. This is normally not the case if you simply compute a mean squared error between the signals, unless mean removal is part of your normalization procedure. I assume you compute the Pearson correlation ...


5

Why not just use something like the relative "error" between the two? For example, if your frequency magnitude responses are $G_1$ and $G_2$, then calculate: $$ ERR = \sum \left | G_1(n) - G_2(n) \right|^2 $$ and then normalize with respect to the reference, $G_1$: $$ NORMALIZED = \sum \left | G_1(n) - G_2(n) \right|^2 / \sum \left | G_1(n) \right|^2 $$ ...


5

What are reasons to choose for cross-correlation or cross-covariance when comparing signals with non-zero mean? Well, part of the issue is that cross-correlation as defined in your equation: $$(f \star g)[n]\ \stackrel{\mathrm{def}}{=} \sum_{m=-\infty}^{\infty} f^*[m]\ g[m+n].$$ will not exist (or be infinite) if $f$ and $g$ have non-zero mean. So, in ...


4

I am trying to answer your question about incoherence here rather than update my previous answer on another question of yours. Compressive sensing requires low coherent pairs. So the lower $\mu(\Phi,\Psi)$, the better. Actually is $\Phi$ is spike basis (identity matrix) with $\phi_k(t) = \delta(t-k)$, and $\Psi$ is Fourier basis with $\psi_j(t) = 1/\sqrt n ...


4

I suspect your problem occurs due to some scaling issues. Basically you need to normalize your research image to the pattern template by subtracting the mean value of the template. And it is better calculate the ratio of correlation to the standard deviation of both images. I don't know which programming language you are using. I wrote a Matlab code for you ...


4

I understand your confusion because the equation is barely understandable from the information given in the book. It becomes more clear from the original paper by Classen and Meyr [1] from which it has been taken. They propose a two stage frequency offset estimation that consists of an acquistion stage and a tracking stage. The equation you've cited ...


4

For power signals $x(t)$ and $y(t)$, the function $$R_{xy}(\tau)=\lim_{T\rightarrow\infty}\frac{1}{2T}\int_{-T}^{T}x(t)\bar{y}(t+\tau)dt\tag{1}$$ is the cross-correlation of $x(t)$ and $y(t)$. So the expression you're asking about is the cross-correlation of $x(t)$ and $y(t)$ evaluated at lag $\tau=0$: $$R_{xy}(0)=\lim_{T\rightarrow\infty}\frac{1}{2T}\...


4

Note that (discrete-time) convolution is defined as $$x_1[n]\star x_2[n]=\sum_kx_1[k]x_2[n-k]\tag{1}$$ and correlation is defined as $$r_{x_1,x_2}[n]=\sum_kx_1[k]x_2[k-n]\tag{2}$$ Comparing $(1)$ and $(2)$ we see that correlation can be written as the following convolution: $$r_{x_1,x_2}[n]=x_1[n]\star x_2[-n]\tag{3}$$ The $\mathcal{Z}$-transform of $...


4

edit: to be clear this answer describes why Lab can be described as a decorrelated color space. This does not imply that decorrelation is the main benefit of using Lab (see many answers on why Lab is useful) If you plot all the RGB colors of a standard RGB image of the natural world you will notice something (see below), the values tend to fall on a ...


4

Tl;DR version: You are not missing anything; finite-duration signals cannot be uncorrelated signals. If the crosscorrelation function $x\star y$ of $x$ and $y$ is zero everywhere, then the Fourier transform of $x\star y$, which is $X(f)Y^*(f)$ (or $X^*(f)Y(f)$ for left-handed folks), must also have value $0$ for all $f$. But, finite-duration signals have ...


3

This question is plagued by bad notation that the OP is unwilling to abandon because, unfortunately, his book uses it. This greatly impedes his understanding of the concepts. Case 1: First convolution equation example: $$ h[k] * h^*[-k] = \sum_{n=-\infty}^{\infty} h[n] \ h^*[n+k] $$ The way I got the right hand side, was: 1) Make the $h$'s ...


3

Sums of discrete cosines are good candidates because they're bound to repeat after a finite number of samples. In fact, anything that repeats after some finite number of samples is the most predictable thing in the world because you can predict the entire thing from just a handful of samples. In fact, the converse of this statement is true, i.e. anything ...


3

I would use correlation for simple and small data. If your data is large though, I would think about using feature extraction via ICA or PCA analysis, and then compare the features via correlation. The problem with correlation is scale. Look at the image in the URL below: Correlation examples 80% is pretty similar in my imagination, but in correlation it ...


3

This is very late, but maybe it's worth it anyway... The time-scale plane is not the same as the time-frequency plane, although it might be useful as well. Signals at different places in the time scale plane are related by $x(t) \rightarrow x(\Delta s(t-\Delta t))$, where $\Delta s$ moves you up (or down) in scale and $\Delta t$ shifts you in time. The ...


3

A relatively simple application where correlation is used is in determining timing of a communications signal. A known synchronization signal will be sent periodically so that the receiver can use it as a point of reference. How does the receiver use it as a point of reference? It correlates the incoming signal stream against the known sequence, and when ...


3

With known time scaling, you can resample to a common rate and then cross-correlate. It is natural to think you might need to go to the higher of the two rates, but that does not increase information beyond the lower rate, it only interpolates the information. This is analogous to zero-padding an FFT to interpolate the resolution of a peak. To determine ...


3

First: you should really read some basic theory of autocorrelation. For example. I also don't know why we subtract the mean First, to subtract the mean is the usual and right thing to do – it's so standard that often it is straightly assumed that the signal has zero mean. Recall that the covariance of two variables is $E[ (x-\mu_x)(y-\mu_y)]$ – of which ...


3

Let me answer in slightly different order: 3) It seems you're really asking for a "Goniometer", which is a 2 channel oscilloscope with the left and right signal components plotted in two orthogonal directions on the scope screen. These directions are typically chosen so that the signal channels make an angle of 45 degrees to the horizontal. 1) The ...


3

Usually, for power signals, we define the inner product to be \begin{align} \left<x\,,\,y\right> &= \lim_\limits{T\rightarrow \infty} \frac 1 {2T} \int\limits_{-T}^T x(t)\bar y(t)\,dt \end{align} which induces the vector norm \begin{align} ||x||^2 &= \left<x\,,\,x\right>\\ &=\lim_{T\rightarrow \infty} \frac 1 {2T} \int\limits_{-T}^...


Only top voted, non community-wiki answers of a minimum length are eligible