Interruptions

While every didgital input pin will have a threshold, it's not a tightly controlled parameter. The ATmega328P datasheet shows that the highest voltage that the pins will sense as a digital low is between 0.2VCC and 0.3VCC, or between 1.0 and 1.5V at 5V, while the minimum voltage that will be sensed as high is between 0.6VCC and 0.7 VCC, or between 3 and 3.5V at 5V. In between, the pin will sense either a high or a low, but it doesn't promise which.

If you want better resolution, you'll have to use something else. One option is an external comparator with the output connected to any pin that can give you a digital input. Another option is to use the analog comparator interrupt. Either way, you'll have to supply the other voltage input. If your signal varies slowly relative to the Arduino's clock speed, you'll want to add some hysteresis to the input signal.

For more on the ATmega328P's analog comparator, see chapter 23 of the datasheet dated 07/2012, here: http://www.atmel.com/Images/doc8271.pdf. If you'd like to see some sample code that uses the comparator interrupt, look here: http://interface.khm.de/index.php/lab/experiments/frequency-measurement-library/. There's a description of a frequency measurement project, and a link to a library called "FreqPeriod." The example code is in the library.