It isn't just the upper layers of the carpet - you need to get to the underlay or floorboards beneath where the pee will have sunk in. These need to be washed and dried - try leaving layers of kitchen paper there to soak up the moisture - then when dry sprinkle area with bicarb. Don't use bleach which the cat will 'smell' as another cat and so pee on it again. To deter the cat try sprinkling anything with a good citrus smell on the area. Also try to find out why s/he did it - litter tray full, scared of something, or just not housetrained yet?