A method for matching an impedance of a system comprising a cavity and one or more feeds to an impedance of one or more sources of electromagnetic radiation irradiating a plurality of frequencies into the cavity via the feeds, comprising: determining a plurality of s-parameter of the system for a frequency band; determining the system impedance based on the s-parameters; and modifying the system impedance according to the difference between the impedance of the system and the impedance of the source.