Giter VIP home page Giter VIP logo

gpsdo-config's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

nivekg

gpsdo-config's Issues

solver.cpp::find_solutions(): Test for even NCn_LS doesn't seem right

Re the following clause near the top of solver.cpp::find_solutions():

  if (!is_div_one_or_even(f1, lcm_freq) or !is_div_one_or_even(f2, lcm_freq))
  {
          // NCn_LS must be 1 or even
          lcm_freq *= 2;
  }

It seems to me that the arguments being passed to is_div_one_or_even() in the above clause are backwards.

Reasoning:

My interpretation of what you're trying to do there is to enforce a value of lcm_freq for which NCn_LS is either unity or an even integer. (Let's ignore the unity constraint since it doesn't apply to the CMOS part.)

So, using f1 as an example, then it seems to me that what you want from the above clause is to conditionally scale lcm_freq by a factor of 2 such that

    f1 == lcm_freq / NCn_LS

for some potential even value of NCn_LS. This in turn requires that lcm_freq/f1 be even. (And similarly for lcm_freq/f2.)

But the second portion of the test performed by is_div_one_or_even() divides the first arg by the second, and then tests whether that quotient is divisible by 2. So the way that the args are currently passed in the above clause, it is the ratios f1/lcm_freq and f2/lcm_freq that are being tested for even-ness, rather that their reciprocals.

If you disagree with the above reasoning, can you please explain patiently why the test is being done the way it is?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.