A speech praising the deceased person at a funeral is a eulogy. An elegy is a poetic form, usually with a sad or thoughtful subject. It can also be a poem on any subject written in the form called “elegaic couplets.” Unless it’s in verse, the speech at a funeral isn’t an elegy.