If your new carpet is an improvement rather than a repair, you must treat the expense as a capital expense and depreciate.
If the carpet is tacked down, it is classified as personal property and is depreciated over five years. However if the carpet in a residential rental property is glued down, it is considered to be part of the building structure and must be depreciated over 27.5 years.