Just like when we left Mitzrayim Hashem purified us from the 49 levels of tumah in order to enable us to receive the Torah, so too, during Sefiras HaOmer - the seven cycles of seven days - Hashem purifies us before Shavuos. This is indicated in the short prayer that is printed in every Siddur in the Sefiras HaOmer section. There is actually a verse in Tehillim that teaches us the concept that “seven cycles of seven” has the power to purify:
אִמֲרוֹת ה' אֲמָרוֹת טְהֹרוֹת כֶּסֶף צָרוּף בַּעֲלִיל לָאָרֶץ מְזֻקָּק שִׁבְעָתָיִם.
The sayings of Hashem are pure sayings, like silver refined, exposed to the earth, purified sevenfold. [Tehillim, 12:7]
Count Omer and of this be sure:
Hashem makes sure to make you pure!