1. A device for spatially-encoding nuclear magnetic resonance signals, the device comprising: a plurality of spatial-encoding elements configured to produce a spatial-encoding magnetic field in the presence of an external magnetic field, the plurality of spatial-encoding elements comprising: at least one paramagnetic spatial-encoding element; at least one diamagnetic spatial-encoding element; and a support coupled to the plurality of spatial-encoding elements and configured to space the plurality of spatial-encoding elements in a fixed arrangement and to move the spatial-encoding elements relative to each other in order to produce a plurality of different spatial-encoding magnetic fields in the presence of the external magnetic field.