Disclosed are a facility and a method using the facility for treating a feed gas
stream comprising at least
methane and
carbon dioxide by membrane
permeation, the facility comprising: - a first membrane separation unit capable of receiving the feed gas
stream and providing a first permeate and a first retentate, - a second membrane separation unit capable of receiving the first retentate and providing a second permeate and a second retentate, - a compressor for compressing the first permeate to a pressure of between 17 bar and 25 bar, - a means for cooling the first compressed permeate to a temperature lower than -40°C, - a
distillation column for separating the first cooled permeate into a gas
stream and a liquid stream, - at least one means for recycling the gas stream exiting the
distillation column to the inlet of the first membrane separation unit, - a means for measuring the concentration of
methane and / or
carbon dioxide in the gas stream exiting the
distillation column, - a means for comparing the concentration of
methane and / or
carbon dioxide measured by the measurement means with a target value, and - a means for adjusting the pressure and / or the temperature of the first permeate depending on the comparison carried out by the comparison means.