Looking for guidance in frequency measurement

I'm looking at Nick Gammon's code from this link Gammon Forum : Electronics : Microprocessors : Timers and counters where it says "Frequency Counter sketch for Atmega2560" and it is way above my head. I'm not sure how he even defines the input pin (D47) that his notations indicate he is using in this sketch.

Can anyone recommend something more simplistic for frequency counting on my Mega? I need to count rising or falling edges, 30hz to 2000hz.