Takadanobaba Station, along the Yamanote Line in Tokyo, I often noticed an irritating, high-pitched whine just outside the wickets. For quite a while I thought it had something to do with the trains or some high-voltage electric current being wired through the area, but it turns out this whine is intentional. It comes from a device installed to prevent teenagers from loitering in the area.
The device is called The Mosquito. It was developed and first sold in the UK, where its legality has been under debate; the high pitched frequency it disperses can on average be heard only by people under 25, which has led to criticism that it infringes on human rights of young people. Sales and marketing slowly spread to other countries, and it was eventually banned from some.
A domestic model has not appeared on the Japanese market. However, a small security systems company called MELC, Co., Ltd. sells imported UK-market models to interested buyers here. If you're interested in checking out the specs or... uh... buying one, they have a product page separate from their main website.
Municipal governments in Japan are also employing UK-market models in public areas in order to gauge their effectiveness. One such experiment in Adachi Ward, Tokyo ended in March, 2010, there also amid complaints about human rights violations. The devices had been activated at night to keep teenagers from congregating in public parks. Though no legislation specifically addressing the devices has appeared in Japan, the Adachi Ward government issued a statement at the end of its experiment saying that if loitering problems recurred, it would first address them with police officer patrols before again resorting to the Mosquito devices.