There are both DIY and commercial devices that will do this. Of course, most folks who post here are wheel reinventors.
By sampling the pulsetrain I mean checking the pin every 25µS (or less) and setting a bit in an array to indicate its state. You end up with something like...which is an image of the pulsetrain where each digit represents a 25µS sample.
- 11111100000111000111000000111000111000000000000000
IR receiver modules are active low, so you'll get an inverted output with 0s where there's IR and 1s where there's none.
Bookmarks