Is arduino suitable for high frequency application?
Most Arduinos are based on AVR chips clocked at 16&nbsp;MHz. On those,
you can generate a 4&nbsp;MHz clock using hardware timers. Bit-banging
data at this speed would be difficult though. It may be possible,
using unrolled loops and hand-crafted assembly... or not, depending on
the specifics of your application. Even if possible, it would be a nice
challenge for an assembly programmer.

The Arduino Due is based on an ARM chip clocked at 84&nbsp;MHz. This
gives you more leeway to bit-bang at 4&nbsp;MHz. But even on the Due you
would certainly need hand-crafted assembly.