Related to the previous post on how to select tone for testing your DAC I also hacked the code a bit to check what a good set of two tone tests would be.
Now, as mentioned in the comments, the two-tone test actually makes more sense as soon as you include an analog (I should say continuous-time) circuit with a limited bandwidth. In order to not “disguise” distortion beyond the bandwidth, one has to apply the two-tone test that folds back into the range.
For telecom (wide-band-in-narrow-band) applications it also make sense as you want to see how distortion from your band would leak into neighbouring bands.
In the previous example, we looked at tones that give you a large set of distortion terms and how they fold back and forth for a given sample frequency. We want to find the tones that give you “cleanest” spectrum in order to optimize our measurement setup for quick capture of “true” nonlinearity.
In this example, using two tones, I have done a slightly overambitious cleaning of two-tones. I assume that the frequency components cannot be too close. This implies also that the two tones cannot be too close either. This is actually a bit contradictive to what you would normally like.
Anyways, let’s play with some numbers instead for now and then we can clean it up in a later post. So, the number of samples in your FFT is
NOS = 2048, distortion order is 4, poisson order is 13 and I look for pairs of tones that are separated by more than
FREQSPAN = 2048/64 = 32.
Given this, we find 401 pairs of tones (802 if we would assume symmetry:
[tone1,tone2] == [tone2,tone1]).
If we further find the bins that are closest to each other (by 120% of FREQSPAN, i.e., 38 bins), we find a convenient list of 27 pairs:
Etc. The code is pretty similar to the previous one. To consider multi-tone applications, you would adopt a slightly different approach. First of all, you would probably not seek for coherently sampled signals. You would pick equi-spaced bins from your IFFT, and the number of tones after applying distortion would be massive and most likely you would not really find a proper multi-tone sequence (for a high number of tones and moderate order of distortion).