Transition radiation from relativistic charged particles passing aluminum and silver foils