I'm not a big expert on pulseIn.
You can count pulse widths with a timer, I don't know if this will help or not: