Numerical analysis of transmission through a sub-wavelength metallic aperture or grating at visible and Terahertz wavelengths