{"id":1939,"date":"2018-04-09T20:52:34","date_gmt":"2018-04-09T11:52:34","guid":{"rendered":"https:\/\/www.utsbox.com\/?p=1939"},"modified":"2018-07-24T22:37:11","modified_gmt":"2018-07-24T13:37:11","slug":"%e3%82%a8%e3%83%95%e3%82%a7%e3%82%af%e3%82%bf%e3%83%bc%e3%81%ae%e7%b0%a1%e5%8d%98%e3%81%aa%e5%ae%9f%e8%a3%85%e4%be%8b-%e3%82%b3%e3%83%b3%e3%83%97%e3%83%ac%e3%83%83%e3%82%b5%e3%83%bc","status":"publish","type":"post","link":"https:\/\/www.utsbox.com\/?p=1939","title":{"rendered":"\u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u306e\u7c21\u5358\u306a\u5b9f\u88c5\u4f8b \u2013 \u30b3\u30f3\u30d7\u30ec\u30c3\u30b5\u30fc"},"content":{"rendered":"<h1>\u30b3\u30f3\u30d7\u30ec\u30c3\u30b5\u30fc\u306e\u5b9f\u88c5\u4f8b<\/h1>\n<p>\u30b3\u30f3\u30d7\u30ec\u30c3\u30b5\u30fc\u3068\u306f\u5165\u529b\u97f3\u58f0\u306e\u97f3\u5727\u306b\u5fdc\u3058\u3066\u97f3\u91cf\u3092\u8abf\u6574\u3059\u308b\u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u3067\u3059\u3002<\/p>\n<p>\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3068\u3057\u3066\u4e0b\u8a18\u304c\u3088\u304f\u5229\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<table>\n<tr>\n<th>\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc<\/th>\n<th>\u610f\u5473<\/th>\n<th>\u3060\u3044\u305f\u3044\u306e\u7bc4\u56f2<\/th>\n<\/tr>\n<tr>\n<td>\u30b9\u30ec\u30c3\u30b7\u30e7\u30eb\u30c9<\/td>\n<td>\u5727\u7e2e\u304c\u59cb\u307e\u308b\u97f3\u5727<\/td>\n<td>0.1\uff5e1.0\u7a0b\u5ea6(dB\u3067\u8a08\u7b97\u3059\u308b\u5834\u5408\u3082\u3042\u308b)<\/td>\n<\/tr>\n<tr>\n<td>\u30ec\u30b7\u30aa<\/td>\n<td>\u5727\u7e2e\u3059\u308b\u5272\u5408<\/td>\n<td>2.0\uff5e10.0\u7a0b\u5ea6(\u4f8b\u3048\u30702.0\u306e\u5834\u5408\u3001\u5727\u7e2e\u6bd4\u73872:1\u3067\u30b9\u30ec\u30c3\u30b7\u30e7\u30eb\u30c9\u3092\u8d85\u3048\u305f\u5206\u304c1\/2\u306b\u306a\u308b\u3002)\/td><\/tr>\n<tr>\n<td>\u97f3\u91cf<\/td>\n<td>\u6700\u7d42\u7684\u306a\u97f3\u91cf<\/td>\n<td>1.0\uff5e3.0\u500d\u7a0b\u5ea6(dB\u3067\u8a08\u7b97\u3059\u308b\u5834\u5408\u3082\u3042\u308b)<\/td>\n<\/tr>\n<\/table>\n<p>\u5b9f\u88c5\u3067\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u5165\u529b\u4fe1\u53f7\u306b\u5fdc\u3058\u305f\u97f3\u5727\u3092\u691c\u77e5\u3002<\/li>\n<li>\u691c\u77e5\u3057\u305f\u97f3\u5727\u306b\u5fdc\u3058\u3066\u97f3\u91cf(\u30b2\u30a4\u30f3)\u3092\u8a08\u7b97\u3002<\/li>\n<li>\u5165\u529b\u4fe1\u53f7\u306b\u8a08\u7b97\u3057\u305f\u97f3\u91cf(\u30b2\u30a4\u30f3)\u3092<\/li>\n<\/ol>\n<p>\u97f3\u5727\u3092\u691c\u77e5\u306f\u300c\u5165\u529b\u4fe1\u53f7\u306e\u7d76\u5bfe\u5024\u3092\u3068\u3063\u305f\u3082\u306e\u306b\u30ed\u30fc\u30d1\u30b9\u30d5\u30a3\u30eb\u30bf\u3092\u901a\u3059\u300d\u3053\u3068\u3067\u3067\u304d\u307e\u3059\u3002<br \/>\n(\u4ed6\u306e\u65b9\u6cd5\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u306f\u3053\u306e\u65b9\u6cd5\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002)<\/p>\n<p>\u30d5\u30a3\u30eb\u30bf\u306f\u300c<a href=\"https:\/\/www.utsbox.com\/?page_id=728\">\u7c21\u5358\u306a\u30c7\u30b8\u30bf\u30eb\u30d5\u30a3\u30eb\u30bf\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/a>\u300d\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3042\u304f\u307e\u3067\u5b9f\u88c5\u4f8b\u3067\u3059\u306e\u3067\u3044\u3044\u97f3\u8cea\u306e\u3082\u306e\u304c\u307b\u3057\u3044\u5834\u5408\u306f\u3001\u3054\u81ea\u8eab\u3067\u8a66\u884c\u932f\u8aa4\u3044\u305f\u3060\u304f\u3088\u3046\u304a\u9858\u3044\u3057\u307e\u3059\u3002<\/p>\n<p>\u3010\u5b9f\u88c5\u30a4\u30e1\u30fc\u30b8\u3011<br \/>\n[crayon]<br \/>\nvoid Compressor(float inL[], float inR[], float outL[], float outR[], int wavelength)<br \/>\n{<br \/>\n\t\/\/ inL[]\u3001inR[]\u3001outL[]\u3001outR[]\u306f\u305d\u308c\u305e\u308c\u5165\u529b\u4fe1\u53f7\u3068\u51fa\u529b\u4fe1\u53f7\u306e\u30d0\u30c3\u30d5\u30a1(\u5de6\u53f3)<br \/>\n\t\/\/ wavelenght\u306f\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u3001\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u5468\u6ce2\u6570\u306f44100Hz\u3068\u3059\u308b<\/p>\n<p>\t\/\/ \u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc<br \/>\n\tstatic float threshold = 0.3;  \/\/ \u5727\u7e2e\u304c\u59cb\u307e\u308b\u97f3\u5727\u30020.1\uff5e1.0\u7a0b\u5ea6<br \/>\n\tstatic float ratio     = 2.0f; \/\/ \u5727\u7e2e\u3059\u308b\u5272\u5408\u30022.0\uff5e10.0\u7a0b\u5ea6<br \/>\n\tstatic float volume  = 2.0f; \/\/ \u6700\u7d42\u7684\u306a\u97f3\u91cf\u30021.0\uff5e3.0\u7a0b\u5ea6<\/p>\n<p>\t\/\/ \u5185\u90e8\u5909\u6570<br \/>\n\t\/\/ \u30d5\u30a3\u30eb\u30bf\u30fc\u30af\u30e9\u30b9(https:\/\/www.utsbox.com\/?page_id=728 \u3088\u308a)<br \/>\n\tstatic CMyFilter envfilterL, envfilterR;   \/\/ \u97f3\u5727\u3092\u691c\u77e5\u3059\u308b\u305f\u3081\u306b\u4f7f\u3046\u30ed\u30fc\u30d1\u30b9\u30d5\u30a3\u30eb\u30bf<br \/>\n\tstatic CMyFilter gainfilterL, gainfilterR; \/\/ \u6025\u6fc0\u306a\u97f3\u91cf\u5909\u5316\u3092\u907f\u3051\u308b\u305f\u3081\u306e\u30ed\u30fc\u30d1\u30b9\u30d5\u30a3\u30eb\u30bf<\/p>\n<p>\t\/\/ \u30ed\u30fc\u30d1\u30b9\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u8a2d\u5b9a<\/p>\n<p>\t\/\/ \u30ab\u30c3\u30c8\u30aa\u30d5\u5468\u6ce2\u6570\u304c\u9ad8\u3044\u307b\u3069\u97f3\u5727\u5909\u5316\u306b\u654f\u611f\u306b\u306a\u308b\u3002\u76ee\u5b89\u306f10\uff5e50Hz\u7a0b\u5ea6<br \/>\n\tenvfilterL.LowPass(30.0f, 1.0);<br \/>\n\tenvfilterR.LowPass(30.0f, 1.0);<br \/>\n\t\/\/ \u30ab\u30c3\u30c8\u30aa\u30d5\u5468\u6ce2\u6570\u304c\u9ad8\u3044\u307b\u3069\u6025\u6fc0\u306a\u97f3\u91cf\u5909\u5316\u306b\u306a\u308b\u3002\u76ee\u5b89\u306f5\uff5e50Hz\u7a0b\u5ea6<br \/>\n\tgainfilterL.LowPass(5.0f, 1.0);<br \/>\n\tgainfilterR.LowPass(5.0f, 1.0);<\/p>\n<p>\t\/\/ \u5165\u529b\u4fe1\u53f7\u306b\u30a8\u30d5\u30a7\u30af\u30c8\u3092\u304b\u3051\u308b<br \/>\n\tfor (int i = 0; i < wavelength; i++)\n\t{\n\t\t\/\/ \u5165\u529b\u4fe1\u53f7\u306e\u7d76\u5bfe\u5024\u3092\u3068\u3063\u305f\u3082\u306e\u3092\u30ed\u30fc\u30d1\u30b9\u30d5\u30a3\u30eb\u30bf\u306b\u304b\u3051\u3066\u97f3\u5727\u3092\u691c\u77e5\u3059\u308b\n\t\tfloat tmpL = envfilterL.Process(abs(inL[i]));\n\t\tfloat tmpR = envfilterR.Process(abs(inR[i]));\n\n\t\t\/\/ \u97f3\u5727\u3092\u3082\u3068\u306b\u97f3\u91cf(\u30b2\u30a4\u30f3)\u3092\u8abf\u6574(\u5de6)\n\t\tfloat gainL = 1.0f;\n\n\t\tif (tmpL > threshold)<br \/>\n\t\t{<br \/>\n\t\t\t\/\/ \u30b9\u30ec\u30c3\u30b7\u30e7\u30eb\u30c9\u3092\u8d85\u3048\u305f\u306e\u3067\u97f3\u91cf(\u30b2\u30a4\u30f3)\u3092\u8abf\u7bc0(\u5727\u7e2e)<br \/>\n\t\t\tgainL = threshold + (tmpL &#8211; threshold) \/ ratio;<br \/>\n\t\t}<br \/>\n\t\t\/\/ \u97f3\u91cf(\u30b2\u30a4\u30f3)\u304c\u6025\u6fc0\u306b\u5909\u5316\u3057\u306a\u3044\u3088\u3046\u30ed\u30fc\u30d1\u30b9\u30d5\u30a3\u30eb\u30bf\u3092\u901a\u3059<br \/>\n\t\tgainL = gainfilterL.Process(gainL);<\/p>\n<p>\t\t\/\/ \u5de6\u3068\u540c\u69d8\u306b\u53f3\u3082\u97f3\u5727\u3092\u3082\u3068\u306b\u97f3\u91cf(\u30b2\u30a4\u30f3)\u3092\u8abf\u6574<br \/>\n\t\tfloat gainR = 1.0f;<br \/>\n\t\tif (tmpR > threshold)<br \/>\n\t\t{<br \/>\n\t\t\tgainR = threshold + (tmpR &#8211; threshold) \/ ratio;<br \/>\n\t\t}<br \/>\n\t\tgainR = gainfilterR.Process(gainL);<\/p>\n<p>\t\t\/\/ \u5165\u529b\u4fe1\u53f7\u306b\u97f3\u91cf(\u30b2\u30a4\u30f3)\u3092\u304b\u3051\u3001\u3055\u3089\u306b\u6700\u7d42\u7684\u306a\u97f3\u91cf\u3092\u8abf\u6574\u3057\u51fa\u529b\u3059\u308b<br \/>\n\t\toutL[i] = volume * gainL * inL[i];<br \/>\n\t\toutR[i] = volume * gainR * inR[i];<br \/>\n}<br \/>\n[\/crayon]<\/p>\n<p>\u4e0a\u8a18\u306f\u3042\u304f\u307e\u3067\u5b9f\u88c5\u4f8b\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u6025\u6fc0\u306b\u97f3\u91cf(\u30b2\u30a4\u30f3)\u304c\u5909\u5316\u3057\u306a\u3044\u3088\u3046\u306b\u30ed\u30fc\u30d1\u30b9\u30d5\u30a3\u30eb\u30bf\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u30a2\u30bf\u30c3\u30af\u3084\u30ea\u30ea\u30fc\u30b9\u3092\u6301\u3063\u305f\u30a8\u30f3\u30d9\u30ed\u30fc\u30d7\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u97f3\u5727\u691c\u77e5\u306bRMS(\u4e8c\u4e57\u5e73\u5747\u5e73\u65b9\u6839)\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u8cea\u554f\u306f\u30b3\u30e1\u30f3\u30c8\u6b04\u3084<a href=\"https:\/\/jbbs.shitaraba.net\/computer\/42917\/\" title=\"\u63b2\u793a\u677f\" target=\"_blank\">\u63b2\u793a\u677f<\/a>\u3001<a href=\"https:\/\/twitter.com\/vstcpp\">Twitter<\/a>\u3067\u3044\u305f\u3060\u3051\u3070\u3068\u304a\u3082\u3044\u307e\u3059\u3002<br \/>\n\u4ed6\u306e\u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u5b9f\u88c5\u4f8b\u306f<a href=\"https:\/\/www.utsbox.com\/?page_id=1197\">\u3053\u3061\u3089<\/a>\u306b\u3082\u3042\u308a\u307e\u3059\u3002\u3000\u2192\u3000<a href=\"https:\/\/www.utsbox.com\/?page_id=1197\">\u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u306e\u7c21\u5358\u306a\u5b9f\u88c5\u4f8b<\/a><\/p>\n<p>\u25a0<a href=\"https:\/\/jbbs.shitaraba.net\/computer\/42917\/\" title=\"\u63b2\u793a\u677f\" target=\"_blank\">\u63b2\u793a\u677f<\/a><br \/>\n\u25a0Twitter\u30a2\u30ab\u30a6\u30f3\u30c8\uff1a@vstcpp\u3000\u3000\u3000URL\uff1a<a href=\"https:\/\/twitter.com\/vstcpp\">https:\/\/twitter.com\/vstcpp<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30b3\u30f3\u30d7\u30ec\u30c3\u30b5\u30fc\u306e\u5b9f\u88c5\u4f8b \u30b3\u30f3\u30d7\u30ec\u30c3\u30b5\u30fc\u3068\u306f\u5165\u529b\u97f3\u58f0\u306e\u97f3\u5727\u306b\u5fdc\u3058\u3066\u97f3\u91cf\u3092\u8abf\u6574\u3059\u308b\u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u3067\u3059\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3068\u3057\u3066\u4e0b\u8a18\u304c\u3088\u304f\u5229\u7528\u3055\u308c\u307e\u3059\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc \u610f\u5473 \u3060\u3044\u305f\u3044\u306e\u7bc4\u56f2 \u30b9\u30ec\u30c3\u30b7\u30e7\u30eb\u30c9 \u5727\u7e2e\u304c\u59cb\u307e\u308b\u97f3\u5727 0.1\uff5e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[19],"tags":[],"class_list":["post-1939","post","type-post","status-publish","format-standard","hentry","category-19"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p5fXUX-vh","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/1939","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1939"}],"version-history":[{"count":3,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/1939\/revisions"}],"predecessor-version":[{"id":1943,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/1939\/revisions\/1943"}],"wp:attachment":[{"href":"https:\/\/www.utsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}