13

For continuous convolution $$[Hf](x) \equiv f(x) * h(x) \equiv \int\mathrm{d}x' h(x-x')f(x')$$ and continuous cross-correlation $$[Gf](x) \equiv f(x) \star h(x) \equiv \int \mathrm{d}x'h^*(x'-x)f(x')$$ It's easy to show that the cross-correlation operator $G$ is the adjoint operator of the the convolution operator $H$. Also, the convolution operation is ...


13

I can recommend you two books about DSP for C language. Embree P. M. - C Language Algorithms for Digital Signal Processing It is old and you can easily get it second-hand for a decent price. It covers pretty much all 4 topics that you described. The other one I recommend is: Malepati H. - Digital Media Processing: DSP Algorithms Using C It covers ...


12

According to your definition of autocorrelation, the autocorrelation is simply the covariance of the two random variables $Z(n)$ and $Z(n+\tau)$. This function is also called autocovariance. As an aside, in signal processing, the autocorrelation is usually defined as $$R_{XX}(t_1,t_2)=E\{X(t_1)X^*(t_2)\}$$ i.e., without subtracting the mean. The ...


10

Are you looking for a formal proof or the intuition behind this? In the later case: "Nothing can be more similar to a function than itself". Autocorrelation at lag $\tau$ measures the similarity between a function $f$ and the same function shifted by $\tau$. Note that if $f$ is periodic, $f$ shifted by any integer multiple of $\tau$ and $f$ coincide, so the ...


10

I've never seen the word "Formula" with "AMDF". My understanding of the definition of AMDF is $$ Q_x[k,n_0] \triangleq \frac{1}{N} \sum\limits_{n=0}^{N-1} \Big| x[n+n_0] - x[n+n_0+k] \Big| $$ $n_0$ is the neighborhood of interest in $x[n]$. Note that you are summing up only non-negative terms. So $Q_x[k,n_0] \ge 0$. We call "$k$" the "lag". clearly if ...


8

The autocorrelation function of an aperiodic discrete-time finite-energy signal is given by $$R_x[n] = \sum_{m=-\infty}^{\infty}x[m]x[m-n]~~~~ \text{or}~~~ R_x[m] = \sum_{m=-\infty}^{\infty}x[m](x[m-n])^*$$ for real signals and complex signals respectively. Restricting ourselves to real signals for ease of exposition, let us consider the summand $x[m]x[m-n]$...


8

As a student I was involved in the same problem as you are. Let me explain to you in the simplest words without any math. Convolution: It is used to convolute two function. May sound redundant but I´ll put an example: You want to convolute (in a non math term to "combine") a unit cell (which can contain anything you want: protein, image, etc) and a ...


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

I'd recommend Introduction to Signal Processing by S.J. Orfanidis. It's a great book with a good mix of theory and practice, and it also has code examples in C and Matlab. Once you've worked through it you'll know enough to carry on by yourself.


7

Cons: Not as accurate This is just compared to the other methods. I was measuring frequency very accurately to look for clock drift, etc: 1000.000004 Hz for 1000 Hz, for instance. For guitar pitch detection it will be fine. doesn't work for inharmonic things like musical instruments I should have said "it can't find an accurate fundamental if there is ...


7

The definition of the autocorrelation function $R_x(\tau)$ depends on the nature of your $x$. If $x$ is a deterministic signal with finite energy then: $$R_x(\tau)=\int_{-\infty}^{+\infty}x(t)x^*(t-\tau)dt$$ If $x$ is a deterministic signal with finite average power$^{(1)}$ then: $$R_x(\tau)=\lim_{T\to+\infty}\frac{1}{T}\int_{-T/2}^{+T/2}x(t)x^*(t-\tau)dt$$...


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

A synchronization sequence generally needs the property that its autocorrelation function resembles an impulse. There are two possible autocorrelation functions that can be considered. For a (real-valued) sequence $x$ of length $N$, the periodic autocorrelation function is $$R_x[n] = \sum_{k=0}^{N-1}x[k]x[k+n]$$ where the sequence is assumed to extend ...


6

$$\begin{align} R_x(\tau) &=\int_{-\infty}^\infty x(t)x^*(t-\tau)\,\mathrm dt\\ &= \int_{-\infty}^\infty \left[\int_{-\infty}^\infty X(f)e^{j2\pi ft}\,\mathrm df\right]x^*(t-\tau)\,\mathrm dt\\ &= \int_{-\infty}^\infty X(f) \left[\int_{-\infty}^\infty x^*(t-\tau) e^{j2\pi ft}\,\mathrm dt\right]\,\mathrm df\\ &= \int_{-\infty}^\infty X(f) \...


6

Let's look at the case $x[n] \in \mathbb{R}$, where $x[n]$ is real. Autocorrelation is basically convolution of the signal with it's time inverse. This can be easily expressed in the frequency domain. $$ \mathscr{F}\Big\{ r_{xx}[n] \Big\} = \mathscr{F}\Big\{ x[n] \Big\} \cdot \mathscr{F}\Big\{ x[-n] \Big\} $$ $$R_{xx}(\omega) = X(\omega)\cdot X^*(\...


5

In principle you are doing the right thing. Step 4 should produce a real result unless there is a coding error. Sometimes you add up some residual imaginary part due to numerical noise but, if any, that should be very small. Here is an example %% random signal of length n n = 128; x = rand(n,1); % zero pad x = [x; zeros(n,1)]; % fft fx = fft(x); % mag ...


5

The value of the peak of the autocorrelation function (maximum) is not really important - though it can be used as a basic feature for voiced/unvoiced classification or more generally for "pitchedness". What matters is the index at which the function takes its maximum (arg-maximum). This is very intuitive to understand: if the signal has a period of $\tau$ ...


5

There is a vast literature on this subject. In particular, deleting one bit (the leading bit in one specific implementation) from each of the Walsh-Hadamard sequences and applying a permutation to the remaining $2^n-1$ bits will result in $2^n$ sequences of length $2^n-1$ that consist of (i) the all-zeroes sequence (ii) the $2^n-1$ cyclic shifts of a ...


5

Knowing the energies of $x_1$ and $x_2$ is not sufficient for determining the energy of $x_3=x_1x_2$. What you can do is determine an upper bound for the energy of $x_3$ given the energies of $x_1$ and $x_2$ and their maximum values: $$E_3=\sum_{k}\big|x_1[k]x_2[k]\big|^2\le\begin{cases}\max_k\big|x_1[k]\big|^2\sum_k\big|x_2[k]\big|^2=\max_k\big|x_1[k]\big|^...


5

The general topic of finding similarities between signals is wide ranging: are the signals of same sampling, length, offset, shift or scale? where do they take their values (discrete, real, complex)? are they stationary? noisy? what do you consider similar (whole signals, chunks, specific features)? which are the invariances looked for? and most important:...


5

The derivative of the Dirac delta impulse is written as $\delta'(\tau)$. This helps with notation because the mistake you made is to write $h(-\tau)=\frac{d}{d\tau}\delta(-\tau)$, which is not the case because $\delta(\tau)$ is an even (generalized) function, whereas the derivative operator $\delta'(\tau)$ is an odd (generalized) function: $$\delta'(\tau)=-\...


4

The (periodic) autocorrelation function of a sinusoid $A\cos(2\pi f_0 t + \theta)$ is $$\begin{align} R(\tau) &= \int_0^{f_0^{-1}} A\cos(2\pi f_0 t + \theta) A\cos(2\pi f_0 (t +\tau)+ \theta)\,\mathrm dt\\ &= \frac{A^2}{2}\int_0^{f_0^{-1}} \cos(2\pi f_0\tau)+\cos(2\pi f_0 (2t +\tau)+ \theta)\,\mathrm dt\\ &= \frac{A^2}{2f_0}\cos(2\pi f_0\tau) \...


4

For a real-valued signal $C$, the autocorrelation function $M$ is a real-valued even function and the power spectral density $m$ (Fourier transform of $M$) is a real-valued nonnegative even function. Now, $m(k) = c(k)c^*(k)$ where $c$ is the Fourier transform of $C$, as you correctly assert, but given only $m$ and no other information about $c$ (or $C$), it ...


4

An autocorrelation function like that is not possible for ordinary signals. The autocorrelation function is the Fourier transform of the power spectral density, which is a strictly positive quantity. However, to get a rectangular function as Fourier transform you need to have negative values. That is in conflict with the strictly positive power spectrum.


4

The random telegraph signal with parameter $\lambda$ is derived from a Poisson process of arrival rate $\lambda$. In the Poisson process, the number of arrivals in $(t_1, t_2]$ is a Poisson random variable with parameter $\lambda(t_2-t_1)$. Consider counting the Poisson arrivals in $(0,\infty)$ with a digital counter whose least significant bit (LSB) is $0$ ...


4

As correctly pointed out in the comments, in general the process $Y(t)=x(t)M(t)$ is not wide-sense stationary (WSS), i.e. its autocorrelation function depends not only on the time difference parameter $\tau$, but also on the absolute time $t$: $$R_Y(\tau,t)=E[Y(t+\tau)Y^*(t)]=E[x(t+\tau)M(t+\tau)x^*(t)M^*(t)]=\\ =x(t+\tau)x^*(t)E[M(t+\tau)M^*(t)]=x(t+\tau)x^...


4

Problem 1: As pointed by learner, awgn adds noise to the sequence y. So you are not plotting the autocorrelation of white gaussian noise, but the autocorrelation of white gaussian noise plus a constant. Use zeros instead of ones ; or analyze the difference $z - y$ ; or since $y$ is a constant signal, remove the mean of $z$. Problem 2: Once point 1 is ...


4

What you see are mainly numerical effects, even though the second result is actually correct, but not according to what Matlab intends to compute. But let's go slow ... Matlab computes the autocorrelation function by first subtracting the mean of the signal and then correlating it with itself. Then the autocorrelation function is normalized such that its ...


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}\...


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