Should M be prime?
Harmonic map with an M of 21

Should M be prime?

It's common knowledge among mixed signal practitioners that M, in the formula M/N=Ft/Fs needs to be prime. It's widespread and pervasive. Everyone believes it. And argue with someone about it and you will get an earful. You are some kind of insane moron if you don't believe it! If you ask them why M needs to be prime, you'll get some incomprehensible reasons, but they remain convinced. But I don't believe it, and for good reason.

One day I was giving a customer demo at the ungodly hour of of 7AM. But everyone was there, my boss, the sales guy and me, even though the front door of the Nextest building was locked. We made a pot of coffee, the customer arrived and I started my presentation. After about 15 minutes, the customer seemed to be very impressed. Then he really got everyone's attention; he told my boss "I could use a guy like Dan at work. I bet I can pay him a lot more than you are paying him, Rick!" Well, he had my attention. I wasn't there to get a new job, I was trying to sell him a tester, but Rick sure took notice! We continued on and he kept hounding me about joining him. How much I would like it at his workplace, how good a boss he was and so on. Then, during the demo, we discussed creating a sine wave for the test, and I chose an M of 21, notably not a prime number. The customer objected, "You can't do that, M must be prime!" I tried to find a way to prove him wrong, but remember that the objective was not to prove a potential customer wrong, it was to sell him a tester! Sadly I failed on three counts. I failed to prove him wrong, I failed to sell him the tester and suddenly the incipient job offer vaporized. The customer left and we all felt a bit let down. We all got up early to be there for the customer at his request and while he was at first very impressed, the whole thing fell apart over a simple difference in opinion.

Years later I created a 45 minute video on Sampling that proves without a doubt that M need not be prime. It doesn't actually take 45 minutes to prove it, but I like covering all the bases and even though it has a long runtime, I've had over 30,000 views and many, many positive comments. Not only that, I have captured quite a few fans with it. One guy was so much of a fan he helped me proofread my book Distortion. Even though the video took me 4 months to produce, it was well worth it. It proves beyond a doubt that M need not be prime, and in a way that would have convinced my potential customer that he was wrong (but that is not the way to make sales, trust me on this).

Below is a slide from the video of harmonic distribution with an M of 20, clearly not a prime number. I cover 16 harmonics with an N of 32, meaning that it covers all the harmonics that can be captured (since the FFT only gives you N/2 bins). Of course, with an M of 20, everything is an alias, even the fundamental, which can't appear in bin 20, because bin 20 doesn't exist when the N is 32!

The fundamental aliases from bin 20 (which doesn't actually exist) back to bin 12, per Dan's Aliasing Rules (aka Dan's Rules), which is what the big point that this video covers in depth. There are two rules, so there are two columns in this chart, but we can ignore that and look at the column for Rule 2, the final result. The second harmonic falls into bin 8, but you'll notice that the text there is green. That is part of a color code showing that bin 8 also contains energy from the 6th harmonic, which aliases back down from bin 120. But it also contains energy from the 10th harmonic that aliases back down from bin 200 and the 14th harmonic that aliases back down from bin 280. Not just that, but even the fundamental bin also contains energy from the 7th harmonic that aliases back down from bin 140, the 9th harmonic that aliases back down from bin 180 and the 15th harmonic that aliases back down from bin 300. In fact, because an M of 20 is not mutually prime with N, which is 32, every harmonic contains at least one other harmonic. For those who can elucidate the reason that M must be prime, this is the reason they refer to: That harmonics from other places in the spectrum will pollute the bins of interest, so for example, if I was doing a THD test on the first 4 harmonics, they would be polluted with the 2nd+6th+10th+14th, the 3rd+5th+11th+13th and the 4th+12th. Now you might say, well, that's not so bad, there isn't likely to be much amplitude in those bins. Clearly you haven't read Distortion; harmonics do not necessarily drop off, in some cases they ramp up! Not just that but we can't guarantee what the phases of those harmonics might be, so they might add energy to the harmonic under scrutiny or they might subtract from it. So this is very, very bad! If harmonics fall into bins that are already occupied, it is a disaster to any kind of frequency domain tests.

Now, what about an M of 21? 21 is not prime, but it is mutually prime with N (32). How do the harmonics map out in that case?

Every single harmonic is listed in black text. That means there are no repeats, no higher harmonics fall into the bins occupied by lower harmonics. The fundamental falls into bin 11, the 2nd harmonic falls into bin 10 from bin 42, the 3rd harmonic falls into bin 1 from bin 63, and so on. There are no repeats, none, every single bin has only the energy from the harmonic we expect. But 21 is not prime! How can this be? Read Matt Mahoney's book, DSP Based Testing again. He says (in chapter 4 if I'm not mistaken) that M and N must be mutually prime. And since our N is always a power of two number (32, 64, 128, 256, 512, 1024....32768, etc) then any odd number will do!

So much anger, energy and time wasted on what can only be called fake news. So many lost sales. Think about that customer who walked away from my demo because he thought I was full of crap. But I don't blame him, I blame his college degree. Somebody, probably a professor told him this false fact. At the opening of Distortion I quote my favorite author, Charles Darwin who had something to say about fake news, even back in 1871.

“False facts are highly injurious to the progress of science, for they often endure long" Charles Darwin, The Descent Of Man.

要查看或添加评论,请登录

Dan Bullard的更多文章

  • I outsmarted Dr. Richard Feynman

    I outsmarted Dr. Richard Feynman

    For decades I have revered Dr. Richard Feynman.

    4 条评论
  • A new law of physics

    A new law of physics

    I will admit it here, I have seen this effect from the day I began working on the cause of harmonics, but I just didn't…

    12 条评论
  • Proximity is everything

    Proximity is everything

    I was watching the newest edition of the YouTube channel Sailing Project Atticus and noted some similarity to their…

    1 条评论
  • Easter in Korea

    Easter in Korea

    Excerpt from The Reluctant Road Warrior published by Amazon.com.

    1 条评论
  • Blood

    Blood

    I think it started when I was in the Navy. You got some extra liberty or something if you gave blood, so I did.

  • QAM for dummies

    QAM for dummies

    I learned to love electronics in college under Mr. Dillon, a retired US Navy Electronics Technician and former…

  • How I arrived

    How I arrived

    People take pretty twisty paths in life to get where they are now. I am no exception.

  • How to think

    How to think

    I've been doing electronics since I was 8 years old. Remember that line from the movie War Games? David's mom:…

  • The distortion microscope trick

    The distortion microscope trick

    I like helping people with technical problems, and recently a former coworker enlisted me to help with a problem his…

    3 条评论
  • Ghosts

    Ghosts

    If you live a while, a ghost from your past will come out to pursue you. It happened to me in 2014 when I published the…

    1 条评论

社区洞察

其他会员也浏览了