PH balance

How long after your period for your period to go back to normal? I remember after having sex the day right after my period I experienced some odor this never happened to me in the past since I usually wait at least a week to have sex after my period usually after ovulating. But this time I had sex I had a strong smell especially when I was climaxing. Can someone please explain to me how PH balance works and what it has to do with sex? When is it safe to have sex without experiencing any smell?