I had the same thing start and the engine went about 6 weeks later. Pray its not the same for you.
I tore my engine in half and looked inside but I couldnt find anything visibly striking me to what the issue is. I havent torn down the lower end yet, I am assuming it must have been lower end failure. I suggest you get a mechanics stethescope from autozone for a couple bux to isolate it even further as a definite. Its just a stethescope with a rod on the end but its really handy. To me it sounded like it was coming from the head- on the exhaust side- on the cyl closest to the drivers side. I was sure I had bent valves, absolutely sure it had to be the case. - they were all unbent.
Do a compression test or if you can, a leakdown test. That will tell you alot.
My 5 speed 160k mile 2000 corolla didnt do it on full accel or decel, only on very light load throttle. I started losing low end power as it went (I had the noise before the power loss but a few weeks later that started fast), and eventually it kicked off the side of the road and barely ran but sounded like some serious smashing was going on down there.
I just got my car on the road after the most hellish swap I have ever done, this car is crap to work on. I had just yanked out and tore down the engine from my 240sx. fully broken down top and bottom in about 8 hours. The corolla engine swap as well as removing the head before I started took me between 40-60 hours. This is in a shop with a lift and a full set of quality tools. This is probably the 5th engine drop I have done personally. I picked up a cheap 03 engine locally and its running that now, feels great. Better not pull the same crap down the road.
If you gotta do a drop I recommend coming in from the bottom (crossmember is easy to pull) and pulling the tranny at the same time. Seems like more work but seperate it off the car and it would be alot easier than what I went through. Might as well do the 03-04 engine before it had drive by wire but you would have to do a little wiring for the coilpacks and vvt IIRC - well worth the gains you would see.