# How to determine frequency components present in distorted signal, with the set of possible components already known?

I am trying to choose the best approach to digitally analyse a signal, which is a mix of an unknown number (but less than 16) fundamental signals at specific frequencies (e.g., sines).

The goal is to determine which of the fundamental signals are present in the signal.

Some of the fundamental signals might be distorted, so they are actually more like square waves than sine waves.

I can decide what the fundamental signals are going to be, including their frequencies, waveforms and amplitudes, since I am going to generate them digitally.

However, I have no control over the distortion process, which can increase the amplitude of the fundamental signals by some unknown amount, resulting in distortion of some or all of the fundamental signals.

The analysis approach should be robust, such that it can still figure out which signals are present even if all the fundamental signals have been distorted.

The fundamental signals all have limited bandwidth, obviously, and the total bandwidth in which to fit the fundamental signals is also limited.

One idea I've already had is to increase the amplitude of the fundamental signals over a short window of time, such that for a brief moment in the window, they will get through without being distorted, making the job of detecting using an FFT easier.

But perhaps there is a much better way to deal with this? I haven't explored other techniques like wavelets, Kalman filters, etc. and to be honest my signal processing knowledge is a bit limited.

-
Hi @b20000, welcome to Physics.SE! I'm not entirely clear on what you're asking. You can choose your input waves entirely, and you just want to be able to reconstruct them? If you already know what frequencies you're looking for (i.e. by deciding on the input) then it's much easier to recreate your signal. Namely you can just clean the signal and fit - instead of anything complex like an FFT. – DilithiumMatrix Apr 21 '13 at 3:26
@zhermes thx, what I am looking for is the best approach to analyse a signal and determine the components present in the signal. I can choose what these components are (e.g. sine waves at specific frequencies), and I know that they will be mixed together at unknown amplitudes by a certain process, and that some of them may become distorted. – b20000 Apr 21 '13 at 4:10

Speaking very generally, and using terminology somewhat loosely:

Distortion is usually harmonic, meaning, in simple terms, that multiples of the fundamental are created and added to the signal. So, if your original signal is a sine wave at 100 Hz, you will get new signal components at 200, 300, 400, and so on in your distorted signal. Distortion can occur regardless of signal intensity, (for example, if the positive and negative sides of a signal are amplified differently, or if there is a distortion at the zero-crossing point, which is common with some kinds of transistor circuits). Moreover, you're always going to get some noise in your FFT bins and you need to have some threshold to distinguish that from signal. So don't count on your low-to-high technique if you don't have a-priori knowledge of your distortion.

The solution, then, is to pick frequencies such that their fundamentals don't match other harmonics. For example, 100 Hz and 150 Hz ar good starting points, because 150 is not a multiple of 100. Obviously, you are limited by the bin size of your FFT and the frequency of the lowest tone you select. Therefore, whether you can get 16 tones in depends on your sample-rate and your FFT bin-size (which will effect how fast you can get your results). At 44kHz, you could do 1kHz, 1.5kHz, 1.75kHz, etc.

You can also reduce the effects of distortion, if you don't expect it to be too bad, with a low-pass filter. This will help emphasize the fundamental, rather than the higher-frequency multiples.

You can also get more sophisticated and try to guess which signal is present by which harmonics are present. eg, if you see 200, 300 and 400, you probably started with a 100 Hz tone rather than a 200 Hz tone. This can get a little error prone as you can have distortion that skips certain harmonics, and noise might look like a harmonic, but it is a trick you can use if you need to get more sophisticated.

Finally, you can go outside the bounds of your problem and do something like have your tones alternate in time.

Also, read up on DTMF which solves a similar problem. I may have missed something.

-
thanks for your reply. Are you saying that the tones would ideally need to have prime frequencies? I think this is sort of what DTMF does. Thanks for the reminder. I'm now wondering if FFT is the best approach for this or if wavelets or something else would work better. – b20000 Apr 21 '13 at 4:13
In the digital domain, DTMF is usually decoded using the Goertzel algorithm. Like the FFT, the Goertzel algorithm is essentially a DFT implementation designed for performance. – Bjorn Roche Apr 21 '13 at 21:46
You need the signals and the harmonics to be far enough apart that they don't have overlapping FFT bins. Choosing prime numbers won't guarantee that. – Bjorn Roche Apr 21 '13 at 21:48