# Extract amplitudes

I have two mixed signals like $A_1f(t) + A_2g(t)$, where $f(t)$ and $g(t)$ are sinusoidal. I want to extract the amplitude infos. Directly I can not get the amplitudes (or I don't know how to). What I am doing is simply sample the signal and correlate the samples to a set of known amplitudes, then use the correlation to predict unknown sampled signals. But it seems it can not work very well.

• Do you know the frequencies of $f(t)$ and $g(t)$? Mar 30, 2015 at 9:33
• frequencies can be obtained from fft. Mar 30, 2015 at 9:41
• From my understanding of your problem, it looks like your two peaks are closely located and that while you manage to "see" the separation between them, their amplitude corrupt each other, is that it ? Have you tried to use zero padding on your signal ? I'm not understanding your correlation thingy Jun 2, 2015 at 7:39

Assuming you know the frequencies (which is not exactly the case), you can solve the problem as follows:

Let $$x[n]$$ be the sampled vector for $$n=0,\ldots,N-1$$. The signal can be represented in vector form, i.e. $$\mathbf{x} = [x[0],\ldots,x[N-1]]^T$$. The signal model is $$x[n] = A_1\sin(2\pi f_1n) + A_2\sin(2\pi f_2n)$$ or in vector form, $$\mathbf{x} = \mathbf{S}\mathbf{a}$$
where $$\mathbf{a} = [A_1,A_2]^T$$ and $$\mathbf{S} = [\mathbf{s}(f_1),\mathbf{s}(f_2)]$$, $$\mathbf{s}(f) = [\sin(2\pi f\cdot0),\ldots,\sin(2\pi f\cdot(N-1))]^T$$.
Then, the amplitudes can be found be solving the following optimisation:
$$\underset{\mathbf{a}}{\arg\min}\left\|\mathbf{x}-\mathbf{S}\mathbf{a}\right\|^2$$
which yields

$$\hat{\mathbf{a}} = (\mathbf{S}^T\mathbf{S})^{-1}\mathbf{S}^T\mathbf{x}$$ Note that $$(\mathbf{S}^T\mathbf{S})$$ is a $$2\times 2$$ matrix of the cross product of two sine wave which is easy to invert without any matrix operations and the other term is simply multiplying the signal (element wise) with two sine wave. Therefore no matrix operations is actually needed.

Now, the problem is that the frequencies are not exactly known. The resolution of the FFT is $$1/N$$, and I am not sure this is good enough. You can try to use Quinn's Fourier coefficients interpolation method or any other method to obtain better frequency estimation.

FFT hands on this job.

1. Calculate FFT
2. Find Magnitude response (abs)
3. Find peaks (local maximum)

The peaks will be $A_1$ and $A_2$.

• Thanks for your response, but the two peaks are closely spaced. The FFT can resolve two peaks, but amplitude for each peak is not so trivial. Apr 1, 2015 at 9:31
• Try to use longer length of data to do FFT, It will help. Apr 1, 2015 at 10:06