Two-period undulator, comprising: - a vacuum chamber extending along a longitudinal axis Y - four series (1, 2, 3, 4) of permanent magnets installed at regular intervals along the axis Y, including a first, second, third and fourth series, these four series and the vacuum chamber being superposed, along an axis Z of the undulator perpendicular to the longitudinal axis Y, in the following successive order: first series, second series, vacuum chamber, third series, fourth series these four series comprising: - the first series of permanent magnets according to a spatial periodicity respectively of (2n+1)λ 0 or 2nλ 0 along the longitudinal axis Y, where n is a positive integer, and where λ 0 is the spatial periodicity of the second series along the longitudinal axis, each period of the first series comprising N 1 permanent magnets successively along the axis Y, the magnetization of which rotates stepwise by 360/N 1 degrees in a first direction about an axis X of the undulator perpendicular to the axes Y and Z - the second series of permanent magnets according to a spatial periodicity of λ 0 along the longitudinal axis, each period of the second series comprising N 2 permanent magnets successively along the axis Y, the magnetization of which rotates stepwise by 360/N 2 degrees in a second direction about the axis X - the third series of permanent magnets according to a spatial periodicity of λ 0 along the longitudinal axis, each period of the third series comprising N 3 permanent magnets successively along the axis Y, the magnetization of which rotates stepwise by 360/N 3 degrees in a third direction, preferably opposite to the second direction, about the axis X - the fourth series of permanent magnets according to a spatial periodicity respectively of (2n+1)λ 0 or 2nλ 0 along the longitudinal axis Y, each period of the fourth series comprising N 4 permanent magnets successively along the axis Y, the magnetization of which rotates stepwise by 360/N 4 degrees in a fourth direction, preferably opposite to the first direction, about the axis X characterized in that the two-period undulator also comprises first displacement means arranged to alter along the axis Y, with respect to a reference position along the axis Y, the relative position of the first and second series jointly with respect to the position of the third and fourth series jointly, by a distance respectively of (2n+1)λ 0 /2 or (2n-1)λ 0 /2, such that the undulator is located in an offset position along the axis Y. - a vacuum chamber extending along a longitudinal axis Y - four series (1, 2, 3, 4) of permanent magnets installed at regular intervals along the axis Y, including a first, second, third and fourth series, these four series and the vacuum chamber being superposed, along an axis Z of the undulator perpendicular to the longitudinal axis Y, in the following successive order: first series, second series, vacuum chamber, third series, fourth series - the first series of permanent magnets according to a spatial periodicity respectively of (2n+1)λ 0 or 2nλ 0 along the longitudinal axis Y, where n is a positive integer, and where λ 0 is the spatial periodicity of the second series along the longitudinal axis, each period of the first series comprising N 1 permanent magnets successively along the axis Y, the magnetization of which rotates stepwise by 360/N 1 degrees in a first direction about an axis X of the undulator perpendicular to the axes Y and Z - the second series of permanent magnets according to a spatial periodicity of λ 0 along the longitudinal axis, each period of the second series comprising N 2 permanent magnets successively along the axis Y, the magnetization of which rotates stepwise by 360/N 2 degrees in a second direction about the axis X - the third series of permanent magnets according to a spatial periodicity of λ 0 along the longitudinal axis, each period of the third series comprising N 3 permanent magnets successively along the axis Y, the magnetization of which rotates stepwise by 360/N 3 degrees in a third direction, preferably opposite to the second direction, about the axis X - the fourth series of permanent magnets according to a spatial periodicity respectively of (2n+1)λ 0 or 2nλ 0 along the longitudinal axis Y, each period of the fourth series comprising N 4 permanent magnets successively along the axis Y, the magnetization of which rotates stepwise by 360/N 4 degrees in a fourth direction, preferably opposite to the first direction, about the axis X