2003 subaru forester

hi , i have a loud, metal, clanging noise coming from under my car, it doesn’t sound like the muffler… any thoughts?

when does this noise occur? when you are turning, coasting, accelerating, etc… Is it coming from the middle, front, or rear of the underside?

sorry, i meant to include that. it occurs when the car is idoling. no noise when i am driving and it seems to be coming from the underside.

Sounds like a loose exhaust heat shield.