You have a dead cylinder. something is causing one or more of your cylinders to misfire.
In order to get good idle and a smooth rev, you need the following for good combustion:
1. Good compression and valve seal
2. Good Air to fuel ratio
3. Good timing
4. Good spark
5. Good, leak free vacuum/boost
It could be one of the following and most to least likely in this order:
1. Bad spark plugs or wires
2. Leaking vacuum
3. Bad or dirty fuel injectors or connectors
4. Bad timing
5. Bad coil packs or connectors
6. Bad air flow meter or connector
7. Bad compression/ ring seal
Other things like a bad alternator, fuel pump, cam position sensor, a bad ignitor, or other wiring/connectors etc. could cause these problems, but when these things fail, they usually prevent the car from running at all.
I would put money on the spark plug wires being at fault. They are commonly overlooked (how many miles are on yours and when was the last time you changed them if at all?)... Most wires are rated for 30,000 miles and should be checked when you change plugs every 10,000 -15,000 miles.
I would also buy a GOOD set of spark plugs while you're at it.
If your engine has at least 60,000 on it it would be a good idea to check your timing, as timing belts stretch over miles of operation and timing could be affected to some degree of retardation. It's a good idea just to check.
If you have REPLACED the plugs AND wires and still experience the problem, you may have to buy a new coil pack if you still experience a dead wire. If the problem is not electrical related by process of elimination (replacing wires/plugs) it's probably a vacuum leak or it could very well be your Air flow meter. Check the wiring running into the connector at the air flow meter. Sometimes they get brittle and can crack or break completely. If the connections look shady, fix ALL of them and not just the wires that look bad. Do ONE AT A TIME with the connector, because there are two brown wires that go into the connector and they must stay in the same place and not be confused.
If the connector looks good, you know that the spark plugs and wires are new and installed correctly (also one at a time), you show 10 degrees of initial advance timing at idle and you have Zero vacuum leaks, run the TSRM test on your air flow meter and replace it if needed.
Misfires are usually vacuum, electrical or timing related and are seldom fuel or compression related. If it does have a fuel problem or compression problem, chances are that your engine also needs electrical work (wire connectors, components, spark plug wires or plugs, etc.)
Just check the easyest and cheapest thing first (as it usually fails first) and go from there.