Skip to content

Instantly share code, notes, and snippets.

@astellon
Last active April 8, 2019 17:01
Show Gist options
  • Save astellon/b0aa9b31f9379731e322119e33a2cc58 to your computer and use it in GitHub Desktop.
Save astellon/b0aa9b31f9379731e322119e33a2cc58 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Upsampling\n",
"\n",
"upsampling by using 0 insertion and frequency domain filtering"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Julia Version 1.1.0\n",
"Commit 80516ca202 (2019-01-21 21:24 UTC)\n",
"Platform Info:\n",
" OS: Linux (x86_64-pc-linux-gnu)\n",
" CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz\n",
" WORD_SIZE: 64\n",
" LIBM: libopenlibm\n",
" LLVM: libLLVM-6.0.1 (ORCJIT, skylake)\n"
]
}
],
"source": [
"versioninfo()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"using BenchmarkTools, FFTW, Plots"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip9500\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip9500)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip9501\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip9500)\" points=\"\n",
"189.504,1503.47 2321.26,1503.47 2321.26,47.2441 189.504,47.2441 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip9502\">\n",
" <rect x=\"189\" y=\"47\" width=\"2133\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 249.837,1503.47 249.837,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 569.912,1503.47 569.912,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 889.987,1503.47 889.987,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1210.06,1503.47 1210.06,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1530.14,1503.47 1530.14,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1850.21,1503.47 1850.21,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2170.29,1503.47 2170.29,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,1465.79 2321.26,1465.79 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,1121.46 2321.26,1121.46 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,777.126 2321.26,777.126 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,432.792 2321.26,432.792 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,88.4582 2321.26,88.4582 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1503.47 189.504,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 249.837,1503.47 249.837,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 569.912,1503.47 569.912,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 889.987,1503.47 889.987,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1210.06,1503.47 1210.06,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1530.14,1503.47 1530.14,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1850.21,1503.47 1850.21,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2170.29,1503.47 2170.29,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1465.79 221.48,1465.79 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1121.46 221.48,1121.46 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,777.126 221.48,777.126 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,432.792 221.48,432.792 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,88.4582 221.48,88.4582 \n",
" \"/>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 249.837, 1557.47)\" x=\"249.837\" y=\"1557.47\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 569.912, 1557.47)\" x=\"569.912\" y=\"1557.47\">2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 889.987, 1557.47)\" x=\"889.987\" y=\"1557.47\">4</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1210.06, 1557.47)\" x=\"1210.06\" y=\"1557.47\">6</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1530.14, 1557.47)\" x=\"1530.14\" y=\"1557.47\">8</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1850.21, 1557.47)\" x=\"1850.21\" y=\"1557.47\">10</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2170.29, 1557.47)\" x=\"2170.29\" y=\"1557.47\">12</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 1483.29)\" x=\"165.504\" y=\"1483.29\">-1.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 1138.96)\" x=\"165.504\" y=\"1138.96\">-0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 794.626)\" x=\"165.504\" y=\"794.626\">0.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 450.292)\" x=\"165.504\" y=\"450.292\">0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 105.958)\" x=\"165.504\" y=\"105.958\">1.0</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 249.837,88.4582 383.91,316.317 517.982,849.111 652.055,1334.27 786.128,1450.74 920.2,1121.46 1054.27,564.316 1188.35,147.997 1322.42,147.997 1456.49,564.316 \n",
" 1590.56,1121.46 1724.64,1450.74 1858.71,1334.27 1992.78,849.111 2126.85,316.317 2260.93,88.4582 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9502)\" style=\"stroke:#e26f46; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 249.837,88.4582 314.711,144.269 379.585,302.657 444.458,537.948 509.332,812.007 574.206,1080.41 639.08,1299.66 703.954,1434.21 768.828,1462.26 833.702,1379.26 \n",
" 898.576,1198.66 963.45,949.742 1028.32,672.843 1093.2,412.846 1158.07,211.893 1222.95,102.555 1287.82,102.555 1352.69,211.893 1417.57,412.846 1482.44,672.843 \n",
" 1547.31,949.742 1612.19,1198.66 1677.06,1379.26 1741.94,1462.26 1806.81,1434.21 1871.68,1299.66 1936.56,1080.41 2001.43,812.007 2066.31,537.948 2131.18,302.657 \n",
" 2196.05,144.269 2260.93,88.4582 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip9500)\" points=\"\n",
"1958.43,312.204 2249.26,312.204 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,312.204 2249.26,312.204 2249.26,130.764 1958.43,130.764 1958.43,312.204 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,191.244 2126.43,191.244 \n",
" \"/>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip9500)\" style=\"stroke:#e26f46; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,251.724 2126.43,251.724 \n",
" \"/>\n",
"<g clip-path=\"url(#clip9500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 269.224)\" x=\"2150.43\" y=\"269.224\">y2</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x1 = range(0.0, stop=4π, length=16)\n",
"y1 = cos.(x1)\n",
"x2 = range(0.0, stop=4π, length=32)\n",
"y2 = cos.(x2)\n",
"plot(x1, y1)\n",
"plot!(x2, y2)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip9900\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip9900)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip9901\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip9900)\" points=\"\n",
"121.251,1503.47 2321.26,1503.47 2321.26,47.2441 121.251,47.2441 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip9902\">\n",
" <rect x=\"121\" y=\"47\" width=\"2201\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip9902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 460.246,1503.47 460.246,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 875.342,1503.47 875.342,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1290.44,1503.47 1290.44,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1705.53,1503.47 1705.53,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2120.63,1503.47 2120.63,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,1462.26 2321.26,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,1120.92 2321.26,1120.92 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,779.571 2321.26,779.571 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,438.226 2321.26,438.226 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,96.8806 2321.26,96.8806 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1503.47 121.251,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 460.246,1503.47 460.246,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 875.342,1503.47 875.342,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1290.44,1503.47 1290.44,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1705.53,1503.47 1705.53,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2120.63,1503.47 2120.63,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1462.26 154.251,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1120.92 154.251,1120.92 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,779.571 154.251,779.571 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,438.226 154.251,438.226 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,96.8806 154.251,96.8806 \n",
" \"/>\n",
"<g clip-path=\"url(#clip9900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 460.246, 1557.47)\" x=\"460.246\" y=\"1557.47\">3</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 875.342, 1557.47)\" x=\"875.342\" y=\"1557.47\">6</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1290.44, 1557.47)\" x=\"1290.44\" y=\"1557.47\">9</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1705.53, 1557.47)\" x=\"1705.53\" y=\"1557.47\">12</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2120.63, 1557.47)\" x=\"2120.63\" y=\"1557.47\">15</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 1479.76)\" x=\"97.2505\" y=\"1479.76\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 1138.42)\" x=\"97.2505\" y=\"1138.42\">2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 797.071)\" x=\"97.2505\" y=\"797.071\">4</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 455.726)\" x=\"97.2505\" y=\"455.726\">6</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip9900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 114.381)\" x=\"97.2505\" y=\"114.381\">8</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip9902)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 183.515,1291.59 321.88,1244.85 460.246,88.4582 598.611,1298.34 736.976,1402.59 875.342,1432.43 1013.71,1446.56 1152.07,1455.34 1290.44,1462.26 1428.8,1455.34 \n",
" 1567.17,1446.56 1705.53,1432.43 1843.9,1402.59 1982.26,1298.34 2120.63,88.4582 2259,1244.85 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip9900)\" points=\"\n",
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip9900)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,191.244 2126.43,191.244 \n",
" \"/>\n",
"<g clip-path=\"url(#clip9900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot(abs.(fft(y1)))"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"insertzero (generic function with 1 method)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function insertzero(x::AbstractVector, n::Integer)\n",
" ret = zeros(eltype(x), length(x)*n)\n",
" for i in 1:length(x)\n",
" ret[(i-1)*n+1] = x[i]\n",
" end\n",
" ret\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip0300\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip0300)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip0301\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip0300)\" points=\"\n",
"189.504,1503.47 2321.26,1503.47 2321.26,47.2441 189.504,47.2441 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip0302\">\n",
" <rect x=\"189\" y=\"47\" width=\"2133\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 509.332,1503.47 509.332,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 833.702,1503.47 833.702,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1158.07,1503.47 1158.07,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1482.44,1503.47 1482.44,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1806.81,1503.47 1806.81,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2131.18,1503.47 2131.18,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,1477.44 2321.26,1477.44 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,1130.19 2321.26,1130.19 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,782.948 2321.26,782.948 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,435.703 2321.26,435.703 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,88.4582 2321.26,88.4582 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1503.47 189.504,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 509.332,1503.47 509.332,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 833.702,1503.47 833.702,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1158.07,1503.47 1158.07,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1482.44,1503.47 1482.44,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1806.81,1503.47 1806.81,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2131.18,1503.47 2131.18,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1477.44 221.48,1477.44 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1130.19 221.48,1130.19 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,782.948 221.48,782.948 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,435.703 221.48,435.703 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,88.4582 221.48,88.4582 \n",
" \"/>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 509.332, 1557.47)\" x=\"509.332\" y=\"1557.47\">5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 833.702, 1557.47)\" x=\"833.702\" y=\"1557.47\">10</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1158.07, 1557.47)\" x=\"1158.07\" y=\"1557.47\">15</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1482.44, 1557.47)\" x=\"1482.44\" y=\"1557.47\">20</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1806.81, 1557.47)\" x=\"1806.81\" y=\"1557.47\">25</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2131.18, 1557.47)\" x=\"2131.18\" y=\"1557.47\">30</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 1494.94)\" x=\"165.504\" y=\"1494.94\">-1.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 1147.69)\" x=\"165.504\" y=\"1147.69\">-0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 800.448)\" x=\"165.504\" y=\"800.448\">0.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 453.203)\" x=\"165.504\" y=\"453.203\">0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 105.958)\" x=\"165.504\" y=\"105.958\">1.0</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip0302)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 249.837,88.4582 314.711,782.948 379.585,318.243 444.458,782.948 509.332,855.541 574.206,782.948 639.08,1344.8 703.954,782.948 768.828,1462.26 833.702,782.948 \n",
" 898.576,1130.19 963.45,782.948 1028.32,568.339 1093.2,782.948 1158.07,148.5 1222.95,782.948 1287.82,148.5 1352.69,782.948 1417.57,568.339 1482.44,782.948 \n",
" 1547.31,1130.19 1612.19,782.948 1677.06,1462.26 1741.94,782.948 1806.81,1344.8 1871.68,782.948 1936.56,855.541 2001.43,782.948 2066.31,318.243 2131.18,782.948 \n",
" 2196.05,88.4582 2260.93,782.948 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0300)\" points=\"\n",
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0300)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,191.244 2126.43,191.244 \n",
" \"/>\n",
"<g clip-path=\"url(#clip0300)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"y3 = insertzero(y1, 2)\n",
"plot(y3)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip0700\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip0700)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip0701\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip0700)\" points=\"\n",
"121.251,1503.47 2321.26,1503.47 2321.26,47.2441 121.251,47.2441 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip0702\">\n",
" <rect x=\"121\" y=\"47\" width=\"2201\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 451.319,1503.47 451.319,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 786.074,1503.47 786.074,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1120.83,1503.47 1120.83,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1455.58,1503.47 1455.58,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1790.34,1503.47 1790.34,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2125.09,1503.47 2125.09,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,1462.26 2321.26,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,1120.92 2321.26,1120.92 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,779.571 2321.26,779.571 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,438.226 2321.26,438.226 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,96.8806 2321.26,96.8806 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1503.47 121.251,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 451.319,1503.47 451.319,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 786.074,1503.47 786.074,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1120.83,1503.47 1120.83,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1455.58,1503.47 1455.58,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1790.34,1503.47 1790.34,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2125.09,1503.47 2125.09,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1462.26 154.251,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1120.92 154.251,1120.92 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,779.571 154.251,779.571 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,438.226 154.251,438.226 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,96.8806 154.251,96.8806 \n",
" \"/>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 451.319, 1557.47)\" x=\"451.319\" y=\"1557.47\">5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 786.074, 1557.47)\" x=\"786.074\" y=\"1557.47\">10</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1120.83, 1557.47)\" x=\"1120.83\" y=\"1557.47\">15</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1455.58, 1557.47)\" x=\"1455.58\" y=\"1557.47\">20</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1790.34, 1557.47)\" x=\"1790.34\" y=\"1557.47\">25</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2125.09, 1557.47)\" x=\"2125.09\" y=\"1557.47\">30</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 1479.76)\" x=\"97.2505\" y=\"1479.76\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 1138.42)\" x=\"97.2505\" y=\"1138.42\">2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 797.071)\" x=\"97.2505\" y=\"797.071\">4</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 455.726)\" x=\"97.2505\" y=\"455.726\">6</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 114.381)\" x=\"97.2505\" y=\"114.381\">8</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip0702)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 183.515,1291.59 250.466,1244.85 317.417,88.4582 384.368,1298.34 451.319,1402.59 518.27,1432.43 585.221,1446.56 652.172,1455.34 719.123,1462.26 786.074,1455.34 \n",
" 853.025,1446.56 919.976,1432.43 986.927,1402.59 1053.88,1298.34 1120.83,88.4582 1187.78,1244.85 1254.73,1291.59 1321.68,1244.85 1388.63,88.4582 1455.58,1298.34 \n",
" 1522.53,1402.59 1589.49,1432.43 1656.44,1446.56 1723.39,1455.34 1790.34,1462.26 1857.29,1455.34 1924.24,1446.56 1991.19,1432.43 2058.14,1402.59 2125.09,1298.34 \n",
" 2192.04,88.4582 2259,1244.85 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip0700)\" points=\"\n",
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip0700)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,191.244 2126.43,191.244 \n",
" \"/>\n",
"<g clip-path=\"url(#clip0700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot(abs.(fft(y3)))"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip1100\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1100)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1101\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1100)\" points=\"\n",
"121.251,1503.47 2321.26,1503.47 2321.26,47.2441 121.251,47.2441 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1102\">\n",
" <rect x=\"121\" y=\"47\" width=\"2201\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 451.319,1503.47 451.319,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 786.074,1503.47 786.074,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1120.83,1503.47 1120.83,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1455.58,1503.47 1455.58,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1790.34,1503.47 1790.34,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2125.09,1503.47 2125.09,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,1462.26 2321.26,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,1120.92 2321.26,1120.92 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,779.571 2321.26,779.571 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,438.226 2321.26,438.226 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 121.251,96.8806 2321.26,96.8806 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1503.47 121.251,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 451.319,1503.47 451.319,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 786.074,1503.47 786.074,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1120.83,1503.47 1120.83,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1455.58,1503.47 1455.58,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1790.34,1503.47 1790.34,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2125.09,1503.47 2125.09,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1462.26 154.251,1462.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,1120.92 154.251,1120.92 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,779.571 154.251,779.571 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,438.226 154.251,438.226 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 121.251,96.8806 154.251,96.8806 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 451.319, 1557.47)\" x=\"451.319\" y=\"1557.47\">5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 786.074, 1557.47)\" x=\"786.074\" y=\"1557.47\">10</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1120.83, 1557.47)\" x=\"1120.83\" y=\"1557.47\">15</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1455.58, 1557.47)\" x=\"1455.58\" y=\"1557.47\">20</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1790.34, 1557.47)\" x=\"1790.34\" y=\"1557.47\">25</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2125.09, 1557.47)\" x=\"2125.09\" y=\"1557.47\">30</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 1479.76)\" x=\"97.2505\" y=\"1479.76\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 1138.42)\" x=\"97.2505\" y=\"1138.42\">2</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 797.071)\" x=\"97.2505\" y=\"797.071\">4</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 455.726)\" x=\"97.2505\" y=\"455.726\">6</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 114.381)\" x=\"97.2505\" y=\"114.381\">8</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip1102)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 183.515,1291.59 250.466,1244.85 317.417,88.4582 384.368,1298.34 451.319,1402.59 518.27,1432.43 585.221,1446.56 652.172,1455.34 719.123,1462.26 786.074,1462.26 \n",
" 853.025,1462.26 919.976,1462.26 986.927,1462.26 1053.88,1462.26 1120.83,1462.26 1187.78,1462.26 1254.73,1462.26 1321.68,1462.26 1388.63,1462.26 1455.58,1462.26 \n",
" 1522.53,1462.26 1589.49,1462.26 1656.44,1462.26 1723.39,1462.26 1790.34,1462.26 1857.29,1455.34 1924.24,1446.56 1991.19,1432.43 2058.14,1402.59 2125.09,1298.34 \n",
" 2192.04,88.4582 2259,1244.85 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1100)\" points=\"\n",
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1100)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,191.244 2126.43,191.244 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1100)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"z = fft(y3)\n",
"z[cld(length(z), 4)+1:end-cld(length(z), 4)] .= 0\n",
"plot(abs.(z))"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip1500\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1500)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1501\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1500)\" points=\"\n",
"189.504,1503.47 2321.26,1503.47 2321.26,47.2441 189.504,47.2441 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1502\">\n",
" <rect x=\"189\" y=\"47\" width=\"2133\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 509.332,1503.47 509.332,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 833.702,1503.47 833.702,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1158.07,1503.47 1158.07,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1482.44,1503.47 1482.44,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1806.81,1503.47 1806.81,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2131.18,1503.47 2131.18,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,1465.75 2321.26,1465.75 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,1125.8 2321.26,1125.8 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,785.851 2321.26,785.851 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,445.902 2321.26,445.902 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,105.953 2321.26,105.953 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1503.47 189.504,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 509.332,1503.47 509.332,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 833.702,1503.47 833.702,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1158.07,1503.47 1158.07,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1482.44,1503.47 1482.44,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1806.81,1503.47 1806.81,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2131.18,1503.47 2131.18,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1465.75 221.48,1465.75 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1125.8 221.48,1125.8 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,785.851 221.48,785.851 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,445.902 221.48,445.902 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,105.953 221.48,105.953 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 509.332, 1557.47)\" x=\"509.332\" y=\"1557.47\">5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 833.702, 1557.47)\" x=\"833.702\" y=\"1557.47\">10</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1158.07, 1557.47)\" x=\"1158.07\" y=\"1557.47\">15</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1482.44, 1557.47)\" x=\"1482.44\" y=\"1557.47\">20</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1806.81, 1557.47)\" x=\"1806.81\" y=\"1557.47\">25</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2131.18, 1557.47)\" x=\"2131.18\" y=\"1557.47\">30</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 1483.25)\" x=\"165.504\" y=\"1483.25\">-1.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 1143.3)\" x=\"165.504\" y=\"1143.3\">-0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 803.351)\" x=\"165.504\" y=\"803.351\">0.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 463.402)\" x=\"165.504\" y=\"463.402\">0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 123.453)\" x=\"165.504\" y=\"123.453\">1.0</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 249.837,105.953 314.711,176.452 379.585,330.91 444.458,571.306 509.332,856.919 574.206,1128.18 639.08,1335.9 703.954,1449.35 768.828,1450.89 833.702,1337.05 \n",
" 898.576,1125.8 963.45,855.977 1028.32,575.751 1093.2,331.752 1158.07,164.733 1222.95,105.141 1287.82,164.733 1352.69,331.752 1417.57,575.751 1482.44,855.977 \n",
" 1547.31,1125.8 1612.19,1337.05 1677.06,1450.89 1741.94,1449.35 1806.81,1335.9 1871.68,1128.18 1936.56,856.919 2001.43,571.306 2066.31,330.91 2131.18,176.452 \n",
" 2196.05,105.953 2260.93,88.4582 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1502)\" style=\"stroke:#e26f46; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 249.837,105.953 314.711,161.053 379.585,317.423 444.458,549.719 509.332,820.287 574.206,1085.27 639.08,1301.73 703.954,1434.57 768.828,1462.26 833.702,1380.32 \n",
" 898.576,1202.02 963.45,956.269 1028.32,682.895 1093.2,426.209 1158.07,227.815 1222.95,119.87 1287.82,119.87 1352.69,227.815 1417.57,426.209 1482.44,682.895 \n",
" 1547.31,956.269 1612.19,1202.02 1677.06,1380.32 1741.94,1462.26 1806.81,1434.57 1871.68,1301.73 1936.56,1085.27 2001.43,820.287 2066.31,549.719 2131.18,317.423 \n",
" 2196.05,161.053 2260.93,105.953 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1500)\" points=\"\n",
"1958.43,312.204 2249.26,312.204 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,312.204 2249.26,312.204 2249.26,130.764 1958.43,130.764 1958.43,312.204 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,191.244 2126.43,191.244 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip1500)\" style=\"stroke:#e26f46; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,251.724 2126.43,251.724 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1500)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 269.224)\" x=\"2150.43\" y=\"269.224\">y2</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot(real.(ifft(z)) .* 2)\n",
"plot!(y2)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"upsampling (generic function with 1 method)"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function upsampling(x, n)\n",
" res = insertzero(x, n)\n",
" z = fft(res)\n",
" z[cld(length(z), 2n)+1:end-cld(length(z), 2n)] .= 0\n",
" real.(ifft(z)) .* n\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip1900\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1900)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1901\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip1900)\" points=\"\n",
"189.504,1503.47 2321.26,1503.47 2321.26,47.2441 189.504,47.2441 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip1902\">\n",
" <rect x=\"189\" y=\"47\" width=\"2133\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 234.001,1503.47 234.001,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 550.709,1503.47 550.709,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 867.416,1503.47 867.416,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1184.12,1503.47 1184.12,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1500.83,1503.47 1500.83,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1817.54,1503.47 1817.54,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2134.24,1503.47 2134.24,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,1463.26 2321.26,1463.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,1123.93 2321.26,1123.93 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,784.592 2321.26,784.592 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,445.256 2321.26,445.256 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 189.504,105.921 2321.26,105.921 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1503.47 189.504,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 234.001,1503.47 234.001,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 550.709,1503.47 550.709,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 867.416,1503.47 867.416,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1184.12,1503.47 1184.12,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1500.83,1503.47 1500.83,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1817.54,1503.47 1817.54,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2134.24,1503.47 2134.24,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1463.26 221.48,1463.26 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,1123.93 221.48,1123.93 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,784.592 221.48,784.592 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,445.256 221.48,445.256 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 189.504,105.921 221.48,105.921 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 234.001, 1557.47)\" x=\"234.001\" y=\"1557.47\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 550.709, 1557.47)\" x=\"550.709\" y=\"1557.47\">20</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 867.416, 1557.47)\" x=\"867.416\" y=\"1557.47\">40</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1184.12, 1557.47)\" x=\"1184.12\" y=\"1557.47\">60</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1500.83, 1557.47)\" x=\"1500.83\" y=\"1557.47\">80</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1817.54, 1557.47)\" x=\"1817.54\" y=\"1557.47\">100</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2134.24, 1557.47)\" x=\"2134.24\" y=\"1557.47\">120</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 1480.76)\" x=\"165.504\" y=\"1480.76\">-1.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 1141.43)\" x=\"165.504\" y=\"1141.43\">-0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 802.092)\" x=\"165.504\" y=\"802.092\">0.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 462.756)\" x=\"165.504\" y=\"462.756\">0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 165.504, 123.421)\" x=\"165.504\" y=\"123.421\">1.0</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip1902)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 249.837,105.921 265.672,117.226 281.508,132.336 297.343,151.842 313.178,176.293 329.014,206.146 344.849,241.724 360.684,283.179 376.52,330.472 392.355,383.365 \n",
" 408.19,441.422 424.026,504.032 439.861,570.434 455.696,639.751 471.532,711.032 487.367,783.288 503.203,855.532 519.038,926.812 534.873,996.232 550.709,1062.97 \n",
" 566.544,1126.3 582.379,1185.56 598.215,1240.2 614.05,1289.7 629.885,1333.65 645.721,1371.66 661.556,1403.39 677.391,1428.55 693.227,1446.89 709.062,1458.18 \n",
" 724.898,1462.26 740.733,1459.02 756.568,1448.43 772.404,1430.53 788.239,1405.45 804.074,1373.43 819.91,1334.79 835.745,1289.97 851.58,1239.48 867.416,1183.91 \n",
" 883.251,1123.93 899.086,1060.25 914.922,993.62 930.757,924.809 946.593,854.592 962.428,783.739 978.263,713.01 994.099,643.146 1009.93,574.871 1025.77,508.884 \n",
" 1041.6,445.863 1057.44,386.463 1073.28,331.313 1089.11,281.011 1104.95,236.12 1120.78,197.16 1136.62,164.595 1152.45,138.826 1168.29,120.177 1184.12,108.89 \n",
" 1199.96,105.111 1215.79,108.89 1231.63,120.177 1247.46,138.826 1263.3,164.595 1279.14,197.16 1294.97,236.12 1310.81,281.011 1326.64,331.313 1342.48,386.463 \n",
" 1358.31,445.863 1374.15,508.884 1389.98,574.871 1405.82,643.146 1421.65,713.01 1437.49,783.739 1453.32,854.592 1469.16,924.809 1484.99,993.62 1500.83,1060.25 \n",
" 1516.67,1123.93 1532.5,1183.91 1548.34,1239.48 1564.17,1289.97 1580.01,1334.79 1595.84,1373.43 1611.68,1405.45 1627.51,1430.53 1643.35,1448.43 1659.18,1459.02 \n",
" 1675.02,1462.26 1690.85,1458.18 1706.69,1446.89 1722.53,1428.55 1738.36,1403.39 1754.2,1371.66 1770.03,1333.65 1785.87,1289.7 1801.7,1240.2 1817.54,1185.56 \n",
" 1833.37,1126.3 1849.21,1062.97 1865.04,996.232 1880.88,926.812 1896.71,855.532 1912.55,783.288 1928.38,711.032 1944.22,639.751 1960.06,570.434 1975.89,504.032 \n",
" 1991.73,441.422 2007.56,383.365 2023.4,330.472 2039.23,283.179 2055.07,241.724 2070.9,206.146 2086.74,176.293 2102.57,151.842 2118.41,132.336 2134.24,117.226 \n",
" 2150.08,105.921 2165.91,97.8454 2181.75,92.487 2197.59,89.4433 2213.42,88.4582 2229.26,89.4433 2245.09,92.487 2260.93,97.8454 \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip1900)\" points=\"\n",
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip1900)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,191.244 2126.43,191.244 \n",
" \"/>\n",
"<g clip-path=\"url(#clip1900)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot(upsampling(y1, 8))"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 34.481 μs (118 allocations: 134.92 KiB)\n"
]
}
],
"source": [
"xbench = range(0.0, stop=4π, length=256)\n",
"ybench = cos.(xbench)\n",
"@btime(upsampling($ybench, 8));"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.1.0",
"language": "julia",
"name": "julia-1.1"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.1.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment