You want to calculate - or measure - the idle speed?
Is it EFI?
As to neutral, it'll be any ratio that doesn't match with the above ratio bands (ie, with tolerance).
The problem though is that then "Neutral" is displayed for clutch slip, clutch disengaged, vehicle stationary, and - if the speedo is driven off separate wheels - any wheel spin. And of course the gears will flash anytime the speed & engine RPM match that ratio.
Hence why gear indicators are usually switches etc on the selectors.