One of the mistakes I made back when I lived in a carpeted home [shudder] was purchasing carpet powder deodorizer, all because I liked the idea of the house "smelling clean". Really, I was just paying for chemically scented baking soda. You can just make your own carpet powder using this formula:
1/2 cup of borax
1/2 cup of baking soda
1 teaspoon of cloves and/or cinnamon (cloves help keep our closets moth-free too)
Or, if you've got pets, instead of the spices, use about 20-25 drops of sweet orange oil, which is a natural flea repellent; be sure to mix in the oil into powder mixture thoroughly and never use directly onto your pets.
Sprinkle on carpets using a cheese-shaker or empty baby powder container, and leave for 15-20 minutes before vacuuming. Now you've neutralized musty odours, added a pleasant naturally derived scent, and also possibly rid some unwelcome pests without chemicals or pesticides.
Related link: Natural closet moth-repellent mixture