Here is a link to the sound in question. I only just realized that the noise/phrase/chant(?) is so incredibly prevalent in media, but I have no clue as to what it's origins are, or its meaning is (if it even has one).
Assuming this is what you mean (roughly 0:30), it comes from the traditional music in Noh theater, and is usually referred to as “kakegoe.”
Because there is no conductor to coordinate timing, and because Noh often has long periods of silence where musician timing can "drift," kakegoe are usually sang by the percussionists, and the type and length of call set things like the tempo for both the musicians and performers. You’ll note that the calls cut off and are then usually quickly followed by a sequence of synchronized percussion strikes, flute calls, or dance steps.
There are actually four calls that mean different things: yo, ho, iya, and yoi.
Noh is not a particularly common thing in Japan anymore, similar to say... traditional opera in the US. Tickets are expensive, the performance language and references are very hard to understand, and it’s usually only attended by the affluent or artistically high-minded.
But similar to how everyone in the US has the mental image of the ample-sized soprano in a horned helmet belting out a Wagner aria, even if they’ve never been to an actual opera, everyone still knows the Noh kakegoe sound, and associates it with “old” feudal era Japan. Especially from the Muromachi to Edo periods when it was most popular, which just so happens to be the settings of most samurai / ninja stories.
(Edit: note that "kakegoe" just means verbal "calls" in Japanese, so you'll find a number of meanings for it. Kabuki theater, which is not quite as esoteric as Noh for example, has their own forms of "kakegoe," but they tend to be phrases shouted in call/response type exchanges between performers and audience, and not what I think you're referring to. "Kakegoe" can also be a term for the "kiai" style shouts in martial arts.)
As other's have mentioned kake-goe (掛け声) is a strange Japanese phenomenon, on a practical level it is like a signal or musical cue. But to really understand it's purpose you need to dive deeply into the Japanese psyche and peformance/festival culture, even then it's quite hard to put your finger on why it is so prominent.
At the heart of it is the concept of mori-age (盛り上げ) which is hard to translate directly to English but essentially means to hype up or rile up a crowd. Similar to how a hype man may punctuate a rap lyric with random whoops and hollers that don't really mean anything but serve as emphasis. In the case of traditional Japan however these sounds are often vocal onomatopeia or sometimes even instruments like taiko drums, wooden clackers, bells, etc.
There are actually many types of kake-goe. Often the primary purpose is a kind of rallying cry or to punctuate something. For example you can hear the "Dokkoi-sho!"( ドッコイショッ!) in a traditional festival dance called Soran-Bushi ( ソーラン節). In this case "Dokkoi-sho" is supposed to be a kind of onomatopeia of pushing/pulling a heavy object with multiple people similar to how you may say something like "heave, ho!". To put it into some context you can take a look at things like Danjiri Matsuri where local communities build their own elaborate carts and race them through the city, constantly beating on drums and shouting kake-goe to encourage the crowd and teams.
In addition to these factors kake-goe is also like a palate cleanser during a performance. It signifies a clean break in the tension or a climax. In Japan we have this weird belief in the cleansing power / purity of simple sounds, sort of like how many South East Asian countries believe fireworks ward off evil spirits. In the video you've posted you notice the "yoooo" part but to the Japanese ear those clacks of wood blocks hitting each other are almost equally as important. In this particular case they build the tension and the "yooo" relieves it. These wooden clackers are taken very seriously and play a big role in traditional buddhist/zen rituals. For example take a listen to these ritualistic chants to hear the occasional dings and clacks that serve as points of emphasis/rythm.
Anyway I am rambling now, this is turning more into an ask-a-Japanese-person than ask-a-historian. My lack of proper citations might be unacceptable to the mods, if so please remove it. Hopefully someone with more academic knowledge on this subject can shed some light into the roots, for now I am just trying to piece together this oddly puzzling phenomenon in a way that a westerner can understand it.