Production of electromagnetic fields