This video shows you how to use baking soda as a carpet deodorizer. Baking soda is really good at absorbing odors. People have been putting an open box of baking soda in their refrigerators to help keep it fresh for years. My mom used to put a box in the freezer to keep it from smelling stale. There's a big problem with using it in your carpet.
I clean carpets in Tampa FL and almost every carpet deodorizing job I do is a failed attempt to remove odors with baking soda. Carpet odors only develop after something has contaminated the carpet. Whether it's food, chemical, or biological if there's a smell there is something there that doesn't belong. Treating the odor with baking soda will only temporarily solve the problem. One the baking soda is vacuumed out of the carpet, as shown in the video, it will soon come back because the original contaminate was not removed.
In other words baking soda will only absorb odors as long as it's present in the carpet. You're goal should be to remove the contaminate. Cleaning the carpet should be the first step in removing the odor. Find the origin of the odor and clean it with a spot carpet cleaner or have your carpets professionally cleaned. If your carpet still has an odor it might need to be sanitized to kill the offending bacteria that is causing the odor to persist. There are some carpet deodorizers that have a sanitizer in it, but make sure you apply it according to the directions or it could be ineffective.