I've heard that past a certain critical period for language acquisition, our brain loses some neural connections and thereby the ability to differentiate phonemes not occurring in our maternal language. This makes me curious and want to test it on myself. Does such online tests exist? Thanks in advance!
There are no such scientifically reliable online tests, though as you may know you can find some online tests for just about anything. One could participate in an offline test (if someone else were to set it up for you). There are a number of kinds of tests, which test different things (so you have to decide more precisely what you want to test), though your wording complicates the question by multiplying the number of tests ("maternal language" is the trigger, back to this in a moment).
A primary dichotomy has to be made as to what ability is being called on. Very common is word-identification, e.g. you play a recording of "cat" and ask the subject to identify which word it is (there are a number of ways to do that). The premise there is that word-identification involves reducing the acoustic stream to a small symbolic stream – phonemes, perhaps – and that a "phoneme" merges physical distinctions that the ear detects and part of the brain hears. We take word-identification ("cat" not "cap") to tell us something about phonemes. This kind of test is not appropriate for sounds that don't occur in the subject's language. An English speaker will just filter out [ʕ] in Arabic [baʕad] and classify the stimulus as the English word "bad".
Instead, you would test ability to discriminate physically-different signals. For example, "cat" pronounced by two different but similar sounding speakers, or "cat" produced by one speaker in somewhat different ways, or the same recording digitally manipulated in different ways. Some subjects may be completely incapable of performing reliably on this test, and they only say "everybody is saying 'cat'", so you have to make sure that subjects are answering the question "do they sound the same?" and not "are they the same word?". A simple non-linguistic version of this test is presenting tones either with different amplitudes, frequencies, or spectral distributions. Although humans can generally distinguish 100 vs. 105 Hz, triangular vs. square wave, it is not a trivial task. Ability to make absolute acoustic comparisons is very much affected by the presentation time between stimuli, to the point that modal voice [a] versus creaky voice [a̰] (same duration, pitch, amplitude, formants) separated by a couple of minutes of time might be generally indistinguishable to a person who hasn't learned "creaky voice" as a linguistic category. Since this kind of test is specifically designed to test physical signal processing and exclude linguistic processing, it's not a popular linguistic test.
The question also raises a complicating issue, the "mother tongue" problem, since people may be multilingual while still having just one primary language. In running any such test, one would also need information on second and third languages, when/how acquired, and beware terminological problems (I've encountered the problem of using the term "mother tongue" and having a speaker tell me that he doesn't know his mother's tongue very well, they use the paternal language at home). Substantial prior exposure to a language can improve ability to distinguish classes of signals. This is well-known to field-working linguists, that once you've heard an implosive, you can abstractly construct the acoustic pattern of many kinds of implosives.
My personal experience contradicts that claim (unless "certain critical period for language acquisition" is meant to cover the age of 30+ as well).
I learned Polish starting at the age of 31, and it has quite some phonemes not present in my mother tongue German (nor in any foreign language I learned earlier).
Yes, in the beginning, I had difficulties distinguishing between the
ś and the
sz phonemes in hearing, both sounding similar enough to the German
sch, but that changed rather quickly.