This is a persistent problem. I've had fairly good success with undiluted white vinegar; apply enough to be wet but not a puddle. Let sit for a while then blot up with white paper towel (so you don't stain the carpet). There are products available at pet supply stores; look for a cleaner with enzymes specifically for cat urine.
Take 16 Oz Hydrogen Peroxide, 1 teaspoon dish washing liquid, 1 tablespoon baking soda and mix them together. Pour into small portions to the area where the cat urine is and leave for some few minutes. Take a clean wet cloth and rub on the same area vigorously until the smell gets out.
Cat urine consists of mainly three parts. Urea makes the urine sticky and allows the other two parts to stick around. Urochrome gives the urine its ugly yellow color that stains carpets, furniture, the wall and anything the cat sprays or urinates on. The third main part of the urine is Uric Acid. Uric acid in the urine consists of salts and crystals that give off the extremely pungent odor creating a gaseous state that attaches to positive ions floating in the air. Each of these ions has a positive electrical charge because it is missing an electron. This enables the odor to drift in the air carrying the odor throughout the room settling in the carpet, drapes and walls creating an uncomfortable living condition. Ozone generators and ionizers remove the odors by creating negative ions, aerosol sprays and candles only replace the odor with a more pleasant odor but these sprays have other health issues. There is a natural permanent one-time application, which will resolve odor problems, called Air-ReNu a paint additive, you only have to apply it once works 24/7/365. www.air-renu.com