The mitzvah discussion for sounding the shofar on Rosh Hashanah presents the blast as a means of awakening the heart to repentance and reminding a person of divine judgment.
וְכֵן מֵעִנְיַן הַמִּצְוָה, מָה שֶׁאָמְרוּ זִכְרוֹנָם לִבְרָכָה (שם לג, ב) שֶׁחַיָּב אָדָם לִתְקֹעַ בְּרֹאשׁ הַשָּׁנָה שָׁלֹשׁ תְּקִיעוֹת שֶׁל שָׁלֹשׁ שָׁלֹשׁ, כְּלוֹמַר, שָׁלֹשׁ פְּעָמִים תְּקִיעָה וּתְרוּעָה וּתְקִיעָה, שֶׁנִּמְצָא שֶׁהֵן שֵׁשׁ תְּקִיעוֹת וְשָׁלֹשׁ תְּרוּעוֹת. וּפֵרוּשׁ תְּרוּעָה כְּתַרְגּוּמוֹ יַבָּבָא, וְעִנְיַן יְבָבָא, הוּא קוֹל שָׁבוּר, כְּלוֹמַר קוֹל יְלָלָה. נִמְצָא, שֶׁהַתּוֹרָה צִוְּתָה אוֹתָנוּ לַעֲשׂוֹת בַּשּׁוֹפָר, קוֹל הַדּוֹמֶה לִילָלָה, וּמִפְּנֵי שֶׁמְּקוֹמוֹת הָעוֹלָם חֲלוּקִים בְּעִנְיַן הַיְלָלָה, שֶׁבְּמָקוֹם אֶחָד מְיַלְּלִין בִּגְנִיחוֹת גַּסּוֹת, וּבְמָקוֹם אַחֵר בְּדַקּוֹת, וּבְמָקוֹם אַחֵר עוֹשִׂין הַכֹּל גַּסּוֹת וְדַקּוֹת, נָהֲגוּ בְּכָל מָקוֹם וּמָקוֹם לִהְיוֹת מַתְרִיעִין בְּרֹאשׁ הַשָּׁנָה עַל דֶּרֶךְ שֶׁהָיוּ מְיַלְּלִין אִישׁ אִישׁ בִּמְקוֹמוֹ, וּבְכָךְ הָיוּ יוֹצְאִין יְדֵי חוֹבָתָן בַּמִּצְוָה שֶׁהַתּוֹרָה צִוְּתָה בְּקוֹל יְלָלָה, וּבְאֵי זֶה שֶׁיִּהְיֶה בְּשׁוּם מָקוֹם בְּכָךְ הָיָה יוֹצֵא יְדֵי תּוֹרָה בְּכָל מָקוֹם. וְאַף עַל פִּי שֶׁבִּמְקוֹמוֹ אֵין מְיַלְּלִין כֵּן שֶׁהֲרֵי קִיֵּם כַּוָּנַת הַכָּתוּב וְעָשָׂה בְּיוֹם זֶה יְלָלָה בְּשׁוֹפָר, עַד שֶׁקָּם רַבִּי אַבְהוּ (שם לד, א) וְלֹא יָשַׁר בְּעֵינָיו לִהְיוֹת יִשְׂרָאֵל חֲלוּקִים בְּמִנְהַג הַתְּרוּעָה, זֶה בְּכֹה, וְזֶה בְּכֹה, שֶׁנַּעֲשֶׂה תּוֹרָה כִּשְׁתֵּי תּוֹרוֹת, וְקִבֵּץ כָּל הַמִּנְהָגִים, וְהִתְקִין שֶׁיְּהוּ תּוֹקְעִין בְּכָל הַמְּקוֹמוֹת בְּשָׁוֶה, וְלָצֵאת יְדֵי חוֹבָה מִכְּלַל הַיְּלָלוֹת שֶׁנַּעֲשׂוֹת בָּעוֹלָם, תִּקֵּן לַעֲשׂוֹת הַתְּרוּעָה בִּשְׁלֹשָׁה צְדָדִין כְּעֵין גְּנִיחוֹת גַּסּוֹת, דְּהַיְנוּ שְׁבָרִים, וּכְעֵין גְּנִיחוֹת דַּקּוֹת דְּהַיְנוּ שֶׁאָנוּ קוֹרִין תְּרוּעָה. וְעוֹד בְּצַד אֶחָד גְּנִיחוֹת גַּסּוֹת, וְדַקּוֹת, כְּמִנְהַג אֶחָד מֵהַמְּקוֹמוֹת שֶׁעוֹשִׂין הַכֹּל כְּיִלְלוֹתֵיהֶם, וְנִמְצָא לְפִי זֶה, שֶׁאָנוּ צְרִיכִין לִתְקֹעַ שָׁלֹשׁ שֶׁל שָׁלֹשׁ פְּעָמִים שָׁלֹשׁ. וְדִין (שם כז, ב) שׁוֹפָר שֶׁנִּסְדַּק לְאָרְכוֹ אוֹ לְרָחְבּוֹ, וְנִקַּב וּסְתָמוֹ בְּמִינוֹ אוֹ שֶׁלֹּא בְּמִינוֹ, וְדִין נוֹתֵן שׁוֹפָר בְּתוֹךְ שׁוֹפָר, וְדִין תּוֹקֵעַ לְתוֹךְ הַבּוֹר וְהַדּוּת, וְדִין (שם, כח, א) שׁוֹפָר שֶׁל עֲבוֹדָה זָרָה וְעִיר הַנִּדַּחַת, וְהַמֻּדָּר הֲנָאָה מֵחֲבֵרוֹ, וְדִין נִתְכַּוֵּן שׁוֹמֵעַ וְלֹא מַשְׁמִיעַ. וְיֶתֶר פְּרָטֶיהָ, מְבֹאָרִים בְּמַסֶּכֶת רֹאשׁ הַשָּׁנָה [א"ח סי' תקפה].
And also from the content of the commandment is that which they, may their memory be blessed, said (Rosh Hashanah 33b) that a man is obligated to blow three [sets] of three on Rosh Hashanah, meaning to say three times tekiah, teruah, tekiah — which comes out that they are six times tekiah (the long uninterrupted blow) and three times teruah. And the understanding of teruah is like its [official Aramaic] translation, yabava. And the [meaning] of yabava is a broken sound, meaning to say, the sound of wailing. It comes out that the Torah commanded us to make a sound similar to wailing from the shofar. But since [different] places in the world differ regarding the matter of wailing — as in one place they wail with heavy sobs, and in another place, with light [yelps] and in [yet] another place, they do [both], heavy and light — it became customary in each and every place to blow the teruah on Rosh Hashanah according to the way each person would wail in his place. And with this, they would [all] fulfill their obligation for the commandment, since the Torah commanded about a voice of wailing. And with whichever one it would be in any place, he would fulfill his obligation with this from the Torah regardless — and even though in his place, they did not wail like this — as he fulfilled the intention of Scripture and made a wail from the shofar on Rosh Hashanah. [This was the case] until Rabbi Abahu rose (Rosh Hashanah 34a) and it was not right in his eyes that Israel should differ regarding the practice of teruah — this one with this and that one with that — as the Torah would become like two Torahs in Israel. [So] he gathered all of the customs and established that they would blow the same [way] in all places and to fulfill the obligation with all of the wailings that are done in the world. He ordained to make the teruah in [all] three ways: like the heavy sobs, which is shevarim; and like the light [yelps], which is what we call teruah; and also the way of heavy sobs and light [yelps together], like the custom of one of the places where they do it all, according to their [particular] wails. And it comes out according to this that we need to blow three [sets] of three, three times. And the law of the shofar that cracked along its length or width, or was punctured and he plugged it with its type or not its type (Rosh Hashanah 27b); the law of one who puts a shofar inside a shofar; the law of one who blows in a pit or a cellar; the law of a shofar of idolatry or a condemned city or one who vows not to benefit from his fellow (Rosh Hashanah 28a); the law when the listener had intention [to fulfill the commandment] but the [blower] did not; and the rest of its details are [all] elucidated in Tractate Rosh Hashanah. (See Tur, Orach Chaim 585.)