{"id":34,"date":"2024-09-10T07:27:21","date_gmt":"2024-09-09T23:27:21","guid":{"rendered":"http:\/\/chaixiangyu.cn\/?p=34"},"modified":"2024-09-11T21:40:28","modified_gmt":"2024-09-11T13:40:28","slug":"armadillo%e4%bd%bf%e7%94%a8%e4%bb%8b%e7%bb%8d%ef%bc%88%e5%8d%81%e4%b8%80%ef%bc%89%ef%bc%9aconv","status":"publish","type":"post","link":"https:\/\/chaixiangyu.cn\/?p=34","title":{"rendered":"Armadillo\u4f7f\u7528\u4ecb\u7ecd\uff08\u5341\u4e00\uff09\uff1aconv"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">conv<\/h1>\n\n\n\n<p>\u7528\u9014\uff1a<em>conv\u51fd\u6570\u7528\u4e8e\u4e00\u7ef4\u5377\u79ef\u3002<\/em><br>\u7c7b\u578b\uff1a<em>\u666e\u901a\u51fd\u6570<\/em><br>\u96b6\u5c5e\uff1a<em>Signal &amp; Image Processing<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1D convolution of vectors A and B<\/li>\n\n\n\n<li>The orientation of the result vector is the same as the orientation of A (ie. either column or row vector)<\/li>\n\n\n\n<li>The shape argument is optional; it is one of:<br>&#8220;full&#8221; = return the full convolution (default setting), with the size equal to <code>A.n_elem + B.n_elem - 1<\/code><br>&#8220;same&#8221; = return the central part of the convolution, with the same size as vector A<\/li>\n\n\n\n<li>The convolution operation is also equivalent to FIR filtering<\/li>\n<\/ul>\n\n\n\n<p>\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vec A(256, fill::randu);\n\nvec B(16, fill::randu);\n\nvec C = conv(A, B);\n\nvec D = conv(A, B, \"same\");<\/code><\/pre>\n\n\n\n<p>\u8fd0\u884c\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Armadillo version: 9.900.1 (Nocturnal Misbehaviour)\nA:\n   0.0013\n   0.1933\n   0.5850\n   0.3503\n   0.8228\n   0.1741\n   0.7105\n   0.3040\n   0.0914\n   0.1473\n   0.9885\n   0.1191\n   0.0089\n   0.5317\n   0.6018\n   0.1662\n   0.4508\n   0.0571\n   0.7833\n   0.5199\n   0.8760\n   0.9559\n   0.5393\n   0.4621\n   0.8622\n   0.7797\n   0.9968\n   0.6115\n   0.2662\n   0.8401\n   0.3759\n   0.6772\n   0.0088\n   0.2759\n   0.5879\n   0.8376\n   0.4849\n   0.7437\n   0.4580\n   0.7444\n   0.5990\n   0.7350\n   0.5724\n   0.1516\n   0.4252\n   0.5171\n   0.7515\n   0.1690\n   0.4919\n   0.6998\n   0.1475\n   0.1416\n   0.6929\n   0.4265\n   0.9666\n   0.1533\n   0.8217\n   0.1914\n   0.8172\n   0.1556\n   0.7320\n   0.2796\n   0.6822\n   0.7219\n   0.1230\n   0.8347\n   0.5170\n   0.4262\n   0.9493\n   0.5495\n   0.4717\n   0.8470\n   0.4561\n   0.9829\n   0.7392\n   0.1960\n   0.8394\n   0.5009\n   0.0275\n   0.5726\n   0.5313\n   0.8430\n   0.6576\n   0.8421\n   0.1099\n   0.3141\n   0.2861\n   0.1403\n   0.8346\n   0.6002\n   0.2527\n   0.0016\n   0.8062\n   0.2106\n   0.5532\n   0.1138\n   0.7522\n   0.5434\n   0.4367\n   0.6962\n   0.4367\n   0.5779\n   0.6287\n   0.5041\n   0.6958\n   0.1900\n   0.1784\n   0.4575\n   0.0975\n   0.0944\n   0.9315\n   0.8946\n   0.2273\n   0.4107\n   0.6281\n   0.4516\n   0.5978\n   0.8548\n   0.6248\n   0.5657\n   0.1843\n   0.5551\n   0.2429\n   0.6047\n   0.5846\n   0.4944\n   0.7407\n   0.6204\n   0.8045\n   0.5760\n   0.9115\n   0.7277\n   0.6678\n   0.3150\n   0.3058\n   0.1086\n   0.8512\n   0.1549\n   0.0793\n   0.6410\n   0.5451\n   0.4090\n   0.4656\n   0.1527\n   0.7380\n   0.8267\n   0.8733\n   0.3001\n   0.1272\n   0.7850\n   0.6096\n   0.0723\n   0.6538\n   0.1048\n   0.2271\n   0.9200\n   0.6628\n   0.4925\n   0.4968\n   0.5093\n   0.6882\n   0.6063\n   0.0059\n   0.1006\n   0.8632\n   0.7473\n   0.3801\n   0.5528\n   0.9557\n   0.1766\n   0.1316\n   0.9517\n   0.0278\n   0.0559\n   0.1316\n   0.8643\n   0.7216\n   0.0147\n   0.7079\n   0.2176\n   0.1689\n   0.3410\n   0.3676\n   0.8024\n   0.5265\n   0.7982\n   0.1448\n   0.4024\n   0.1366\n   0.0662\n   0.5733\n   0.5480\n   0.3113\n   0.8080\n   0.2843\n   0.8952\n   0.7438\n   0.3611\n   0.2285\n   0.2294\n   0.5424\n   0.0538\n   0.5247\n   0.0947\n   0.8915\n   0.1465\n   0.9316\n   0.0471\n   0.3364\n   0.3986\n   0.9462\n   0.5342\n   0.6935\n   0.2592\n   0.5256\n   0.3987\n   0.5855\n   0.6840\n   0.4355\n   0.0072\n   0.6016\n   0.5767\n   0.2223\n   0.0043\n   0.0823\n   0.8551\n   0.8111\n   0.6915\n   0.5301\n   0.1428\n   0.7279\n   0.0311\n   0.6445\n   0.0855\n   0.9479\n   0.2750\n   0.9818\n   0.2923\n   0.3675\n   0.2186\n   0.2406\n   0.9023\n   0.9026\n   0.0801\n   0.1718\n   0.7759\n   0.2106\n   0.0038\n   0.1141\n   0.3112\n   0.0386\n   0.1893\n   0.1535\n   0.8854\n   0.1957\n   0.6456\nB:\n   0.9091\n   0.9213\n   0.1508\n   0.5695\n   0.9430\n   0.5786\n   0.2553\n   0.3503\n   0.7952\n   0.0703\n   0.5907\n   0.1977\n   0.6443\n   0.6043\n   0.4413\n   0.3965\nC:\n   0.0012\n   0.1769\n   0.7101\n   0.8873\n   1.2703\n   1.4854\n   1.7938\n   2.1444\n   1.7661\n   1.7571\n   2.8044\n   2.5578\n   1.9188\n   2.2350\n   3.8802\n   2.7669\n   2.9627\n   3.1577\n   3.8220\n   3.4011\n   3.5408\n   4.0236\n   4.1757\n   3.9416\n   4.5852\n   4.7820\n   5.1713\n   4.6817\n   5.0271\n   5.1147\n   5.1975\n   5.0501\n   4.7720\n   4.7721\n   5.2644\n   5.0937\n   4.6981\n   4.8401\n   4.9184\n   5.4867\n   4.6445\n   5.0565\n   4.7270\n   4.4557\n   4.1643\n   4.4683\n   4.3752\n   4.2173\n   4.0366\n   5.0476\n   4.4173\n   3.5157\n   4.2808\n   4.3718\n   4.4732\n   3.6408\n   4.1538\n   4.1189\n   4.0501\n   4.0399\n   4.0429\n   4.0724\n   4.2595\n   3.9630\n   4.2891\n   3.6887\n   5.1367\n   4.0654\n   4.9462\n   4.6124\n   4.6667\n   4.7216\n   4.7542\n   5.3165\n   4.9616\n   4.9953\n   5.0308\n   5.3105\n   4.6404\n   4.3458\n   4.9759\n   5.3531\n   4.6972\n   5.1073\n   5.0139\n   4.3356\n   4.6888\n   4.1837\n   4.1174\n   4.5649\n   3.5408\n   3.4751\n   3.7665\n   4.2761\n   3.5429\n   3.5590\n   4.1369\n   3.8499\n   3.4463\n   3.2932\n   4.1865\n   3.7933\n   4.4052\n   3.8475\n   4.4819\n   3.7614\n   3.7042\n   4.0190\n   3.5985\n   3.3389\n   3.7644\n   4.6914\n   3.8784\n   3.3116\n   4.5002\n   4.3804\n   3.8032\n   4.2292\n   4.5362\n   4.1472\n   3.7049\n   4.0504\n   4.1979\n   4.1953\n   4.4963\n   4.4899\n   4.4642\n   4.6299\n   4.6764\n   5.0968\n   4.9946\n   5.6097\n   5.0588\n   4.7630\n   4.5852\n   4.2582\n   4.8728\n   4.3666\n   3.9381\n   4.1971\n   4.8910\n   4.1215\n   4.0072\n   3.9467\n   4.5022\n   4.2088\n   4.3621\n   3.7647\n   3.4710\n   4.3233\n   4.4224\n   3.4463\n   3.7946\n   4.0509\n   3.8700\n   3.8102\n   4.3700\n   4.2492\n   4.1193\n   4.5949\n   4.7191\n   4.0612\n   3.8334\n   3.4564\n   4.2585\n   4.5301\n   3.4619\n   3.8486\n   5.0459\n   4.7163\n   3.6173\n   4.4750\n   4.5850\n   3.2325\n   3.1418\n   3.9721\n   4.2076\n   2.9006\n   3.6634\n   4.4958\n   3.3186\n   3.3204\n   3.1064\n   3.9718\n   3.3832\n   3.3879\n   3.7361\n   3.0813\n   3.7836\n   3.1507\n   3.4311\n   3.7250\n   2.9084\n   3.6424\n   3.3613\n   4.1506\n   4.2860\n   4.2542\n   3.9165\n   3.6712\n   3.8691\n   3.2741\n   2.8713\n   3.6415\n   3.6297\n   3.8733\n   3.7647\n   3.8150\n   3.7414\n   3.5235\n   4.3645\n   3.5336\n   3.8944\n   3.2960\n   4.3481\n   3.5342\n   4.2054\n   4.0698\n   4.4595\n   3.6384\n   3.9578\n   4.2051\n   3.8929\n   3.1462\n   3.5636\n   4.1482\n   4.0717\n   3.5623\n   3.8914\n   3.8875\n   4.2337\n   3.6712\n   3.3787\n   3.6359\n   3.7165\n   3.9342\n   3.6998\n   3.8782\n   4.1428\n   3.8065\n   4.4282\n   3.8447\n   4.8854\n   3.2111\n   3.6183\n   3.9625\n   4.3953\n   2.9344\n   3.0682\n   3.8912\n   2.9828\n   2.2922\n   2.3513\n   3.2548\n   3.0304\n   2.9091\n   2.7856\n   2.4907\n   2.0028\n   1.9016\n   1.4296\n   1.4223\n   0.8368\n   1.4083\n   0.6897\n   1.1821\n   0.9315\n   0.9858\n   0.8275\n   0.3625\n   0.2560\nD:\n   1.7661\n   1.7571\n   2.8044\n   2.5578\n   1.9188\n   2.2350\n   3.8802\n   2.7669\n   2.9627\n   3.1577\n   3.8220\n   3.4011\n   3.5408\n   4.0236\n   4.1757\n   3.9416\n   4.5852\n   4.7820\n   5.1713\n   4.6817\n   5.0271\n   5.1147\n   5.1975\n   5.0501\n   4.7720\n   4.7721\n   5.2644\n   5.0937\n   4.6981\n   4.8401\n   4.9184\n   5.4867\n   4.6445\n   5.0565\n   4.7270\n   4.4557\n   4.1643\n   4.4683\n   4.3752\n   4.2173\n   4.0366\n   5.0476\n   4.4173\n   3.5157\n   4.2808\n   4.3718\n   4.4732\n   3.6408\n   4.1538\n   4.1189\n   4.0501\n   4.0399\n   4.0429\n   4.0724\n   4.2595\n   3.9630\n   4.2891\n   3.6887\n   5.1367\n   4.0654\n   4.9462\n   4.6124\n   4.6667\n   4.7216\n   4.7542\n   5.3165\n   4.9616\n   4.9953\n   5.0308\n   5.3105\n   4.6404\n   4.3458\n   4.9759\n   5.3531\n   4.6972\n   5.1073\n   5.0139\n   4.3356\n   4.6888\n   4.1837\n   4.1174\n   4.5649\n   3.5408\n   3.4751\n   3.7665\n   4.2761\n   3.5429\n   3.5590\n   4.1369\n   3.8499\n   3.4463\n   3.2932\n   4.1865\n   3.7933\n   4.4052\n   3.8475\n   4.4819\n   3.7614\n   3.7042\n   4.0190\n   3.5985\n   3.3389\n   3.7644\n   4.6914\n   3.8784\n   3.3116\n   4.5002\n   4.3804\n   3.8032\n   4.2292\n   4.5362\n   4.1472\n   3.7049\n   4.0504\n   4.1979\n   4.1953\n   4.4963\n   4.4899\n   4.4642\n   4.6299\n   4.6764\n   5.0968\n   4.9946\n   5.6097\n   5.0588\n   4.7630\n   4.5852\n   4.2582\n   4.8728\n   4.3666\n   3.9381\n   4.1971\n   4.8910\n   4.1215\n   4.0072\n   3.9467\n   4.5022\n   4.2088\n   4.3621\n   3.7647\n   3.4710\n   4.3233\n   4.4224\n   3.4463\n   3.7946\n   4.0509\n   3.8700\n   3.8102\n   4.3700\n   4.2492\n   4.1193\n   4.5949\n   4.7191\n   4.0612\n   3.8334\n   3.4564\n   4.2585\n   4.5301\n   3.4619\n   3.8486\n   5.0459\n   4.7163\n   3.6173\n   4.4750\n   4.5850\n   3.2325\n   3.1418\n   3.9721\n   4.2076\n   2.9006\n   3.6634\n   4.4958\n   3.3186\n   3.3204\n   3.1064\n   3.9718\n   3.3832\n   3.3879\n   3.7361\n   3.0813\n   3.7836\n   3.1507\n   3.4311\n   3.7250\n   2.9084\n   3.6424\n   3.3613\n   4.1506\n   4.2860\n   4.2542\n   3.9165\n   3.6712\n   3.8691\n   3.2741\n   2.8713\n   3.6415\n   3.6297\n   3.8733\n   3.7647\n   3.8150\n   3.7414\n   3.5235\n   4.3645\n   3.5336\n   3.8944\n   3.2960\n   4.3481\n   3.5342\n   4.2054\n   4.0698\n   4.4595\n   3.6384\n   3.9578\n   4.2051\n   3.8929\n   3.1462\n   3.5636\n   4.1482\n   4.0717\n   3.5623\n   3.8914\n   3.8875\n   4.2337\n   3.6712\n   3.3787\n   3.6359\n   3.7165\n   3.9342\n   3.6998\n   3.8782\n   4.1428\n   3.8065\n   4.4282\n   3.8447\n   4.8854\n   3.2111\n   3.6183\n   3.9625\n   4.3953\n   2.9344\n   3.0682\n   3.8912\n   2.9828\n   2.2922\n   2.3513\n   3.2548\n   3.0304\n   2.9091\n   2.7856\n   2.4907\n   2.0028\n   1.9016\n   1.4296\n   1.4223\n   0.8368\n   1.4083\n\u8bf7\u6309\u4efb\u610f\u952e\u7ee7\u7eed. . .<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>conv \u7528\u9014\uff1aconv\u51fd\u6570\u7528\u4e8e\u4e00\u7ef4\u5377\u79ef\u3002\u7c7b\u578b\uff1a\u666e\u901a\u51fd\u6570\u96b6\u5c5e\uff1aSignal &amp; Image Proce [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-algorithm"],"_links":{"self":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=34"}],"version-history":[{"count":1,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":35,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=\/wp\/v2\/posts\/34\/revisions\/35"}],"wp:attachment":[{"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chaixiangyu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}