I heard somewhere that Fourier transform only works on a signal that
contains parts that are harmonic to each other (i.e. f, 2f, 3f etc.).
No. What you say would imply that the signal must be periodic, and that is not true. The Fourier transform can be computed for any signal, periodic or not, with finite energy or even with finite power. In the latter case (of finite power), the transform will, in most cases, be unbounded.
What you say is correct for Fourier series, not for the Fourier transform. The Fourier series decomposition is defined only for periodic signals. The spectrum of a periodic signal will be able to have contents only at \$f_0\$, \$2f_0\$, \$3f_0\$, etc. That does not mean that it will always have contents at all those frequencies. It means that it cannot have contents outside that set of frequencies.
Can anyone explain me on proof of this?
That was not right, so it cannot be proved.
What is the sufficient condition for Fourier transform?
There is no "the sufficient condition". There are several sufficient conditions.
For instance, one sufficient condition is that it satisfies both Dirichlet conditions:
1) Over any time interval of finite length, the function w(t) is single valued with a finite number of maxima and minima, and the number of discontinuities (if any) is finite.
2) w(t) is absolutely integrable.
That condition is sufficient, but not necessary.
A weaker sufficient condition for the existence of the Fourier transform is that the signal has finite energy. All physically realizable waveforms are finite-energy, so that means that all physical waveforms encountered in engineering practice are Fourier transformable. However, that is to have a Fourier transform with bounded values. If you allow yourself to work with unbounded values, then you can also compute the Fourier transform of a signal that has finite power (which is a less strict requirement). For instance, a sin(\$2\pi f_0·t\$) that exists for all t has finite power, but not finite energy. You can compute the Fourier transform of such a signal, but it will have unbounded values (in fact, "deltas") at \$f_0\$ and \$-f_0\$.
The Fourier transform is linear, which means that if you sum two signals, then also their spectrum will be the sum.
$$ \mathscr{F} [x(t) + y(t)] = \mathscr{F}[x(t)] + \mathscr{F}[y(t)] $$
If you consider the power, you can have two cases:
The signals have different frequency
Then their power just sums up, because:
$$ P_{tot} = P_1 cos (\omega _1 t + \phi _1) + P_2 cos (\omega _2 t + \phi _2) $$
The signals have the same frequency
Then if they are in phase you have:
$$ P_{tot} = P_1 cos (\omega _0 t + \phi _0) + P_2 cos (\omega _0 t + \phi _0) =
(P_1 + P_2) \cdot cos(\omega _0 t + \phi_0) $$
If they're out of phase, the resulting power will be lower and precisely:
$$ P_{tot} = P_1 cos (\omega _0 t + \phi _1) + P_2 cos (\omega _0 t + \phi _2) $$
and setting arbitrarily \$\phi_1 = 0\$ we obtain:
$$ P_{tot} = P_1 cos (\omega _0 t) + P_2 cos (\omega _0 t + \Delta \phi) $$
which for \$\Delta \phi = \pi\$ gives the subtraction of the signals.
Best Answer
If you take two raw signals and subtract, you will get a value that could be used to indicate the difference between the signals.
However, if you do the FFT you will lots of signal information, perhaps the power line is very noisy on one signal line. This would affect power consumption but may not be the component you wish to measure.
You could do multiple plots, say at 50Hz, 40Hz, etc. and compare.
FFT gives more signal detail than Euclidean distance.