A bad fuel pump wouldn't throw a check engine light.
I had something similar happen. The car would idle like crap, and sounded like a Subaru with any throttle input. The check engine light would come on if this persisted long enough. One of the injector plugs had a crappy connection, and would cut out intermittently. I ended up replacing all the connectors with the pinch type quick disconnect injector plugs, and never saw the problem again. With the car running, just pop the hood and give each injector plug a wiggle. If you have a crappy one, your symptoms will likely reoccur when you wiggle the weak link.