MagnetoEncephaloGraphy (MEG) is concerned with mapping electrical activity in the brain by measuring the induced external magnetic field. This mapping is applied for diagnosis of diseases such as epilepsy. MEG has been a very active area lately due to the steady improvement of weak magnetic field measurements and its relative robustness to inhomogeneities in electrical conductivity within the skull. This research is developing several performance measures and optimization schemes for magnetoencephalography (MEG) and electroencephalography (EEG) systems, from a signal processing point of view. The measures include: (1) accuracy of source parameter estimates, (2) detectability of a source, based on the probability of detection, and (3) resolution of sources, or the probability of detecting more than one source. These measures are being applied to develop techniques for the optimum design of MEG/EEG system parameters, including sensor placement, type and orientation.