Radioactive noble-gas isotopes, SSKr (half-life tl/2=10.8 y), 39Ar (tl/2=269 y), and SlKr (t1/2-229,000 y), are ideal tracers and can be detected by atom trap trace analysis (ATTA), a laser-based technique, from environmental samples like air and groundwater. Prior to ATTA measurements, it is necessary to efficiently extract krypton and argon gases from samples. Using a combination of cryogenic distillation, titanium chemical reaction and gas chromatography, we demonstrate that we can recover both krypton and argon gases from 1-10 L "air-like" samples with yields in excess of 90% and 98%, respectively, which meet well the requirements for ATTA measurements. A group of testing samples are analyzed to verify the performance of the system, including two groundwater samples obtained from north China plain.