whenever i need a roadmap for a project like this i bung the keyword 'arduino' into the search engine if i dont immediately find what i am looking for. After all if it can be done someone has done it with an arduino and written a book about it.
I did the same for this question and it turns out its a common task for an arduino uno and achievable with setting the timer registers.
https://forum.arduino.cc/index.php?topic=415167.0
a slave arduino or barebones chip even could resolve the issue perhaps?