First, I agree with those who think it was Gandalf. He did, after all,
communicate with Frodo at Amon Hen in a moment of great urgency. And, if
ever there was an even greater moment of urgency, this was it!
I believe seeing the mirthil shirt, etc. as opposed to seeing captives,
actually gave Gandalf’s hope a ‘jump start.’ At that moment he was
suddenly sure Sauron did *not* have Frodo, or the Ring. He was sure Sam
and Frodo were out there somewhere, but unless they finished the task soon,
Sauron would still have a victory of sorts. Thus, the urgent call that
pierced the shrouds of Mordor he had previously been unable to communicate
through under less urgent circumstances.
I also think Frodo, in partucular, was partially sensing the thrill Sauron was
feeling as the battle started and he prepared to watch what he was sure would
be the utter defeat of his enemies and the recovery of the Ring.
Frodo was much more ‘open’ to non-verbal communication (a la Acathalion’s post)
by then and intimately connected to the minds of the two most powerful Maiar in
Middle-earth as they both prepared to face their ultimate moment of
truth. Sam had a lesser connection to Gandalf and Sauron, of course, but
a strong enough connection to Frodo to sense these things
too.