Most likely, the odor is going to be in whatever is under the rug (or under the padding.) Wood will absorbe moisture or at least let it pass through in which case, it's now absorbed in whatever is UNDER the wood!
The best thing to do is remove the carpet and padding. Depending on what's under there, you can possibly seal or maybe dilute it enough where it isn't so annoying. Once you've removed the 'top layer(s)', let us know what's under there and we'll see if we can help you get rid of the smell from that.
My best to ya and hope this helps.
Jay J -Moderator
PS: Really, I don't think you want to keep the carpet to try and remove the odor. If you have kids or babies crawling or laying around, it's just unsanitary ...