aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2023-02-13 11:07:50 +0100
committerUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2023-02-13 11:07:50 +0100
commit7fcb323c0657b16180aac255f5868474c50997bc (patch)
tree6e25d1411405ba89d828eaa15f1980571fa89f24
parente402b4d15a169effc16c51cd63ce6c8ce53b71a5 (diff)
Research - FPGA audio generation
-rw-r--r--assets/audioPWM.svg340
-rw-r--r--docs/research.md12
2 files changed, 352 insertions, 0 deletions
diff --git a/assets/audioPWM.svg b/assets/audioPWM.svg
new file mode 100644
index 0000000..3b43a0b
--- /dev/null
+++ b/assets/audioPWM.svg
@@ -0,0 +1,340 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="550pt"
+ height="380pt"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.43"
+ sodipodi:docbase="C:\Documents and Settings\Stas\Desktop\wiki\Moje hasla\Moje grafiki\PWM"
+ sodipodi:docname="3-level(1).svg"
+ version="1.0">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.1935472"
+ inkscape:cx="346.04346"
+ inkscape:cy="243.3429"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer2"
+ showgrid="true"
+ inkscape:window-width="994"
+ inkscape:window-height="695"
+ inkscape:window-x="26"
+ inkscape:window-y="49" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ style="display:inline" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="2"
+ style="display:inline">
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#0000ff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ d="M 100.87984,216.42265 L 118.42464,216.5376 L 118.65453,86.09101 L 133.85381,86.09101 L 134.0837,216.44595 L 171.25396,216.5609 L 171.25396,86.33255 L 184.4642,86.33255 L 184.57915,216.31935 L 228.76267,216.31935 L 229.10751,86.3209 L 232.85568,86.3209 L 232.97063,216.31935 L 253.30907,216.31935 L 253.30907,346.06461 L 257.51703,346.06461 L 257.51703,216.31935 L 302.40188,216.31935 L 302.40188,346.06461 L 313.62309,346.06461 L 312.92176,216.31935 L 350.09203,216.31935 L 350.09203,346.06461 L 365.52119,346.06461 L 365.52119,216.31935 L 401.99013,216.31935 L 401.99013,346.06461 L 418.12062,346.06461 L 418.12062,216.5609 L 455.99221,216.67584 L 455.99221,346.06461 L 467.21342,346.06461 L 467.21342,216.29605 L 511.39695,216.31935 L 511.39695,346.06461 L 514.90357,346.06461 L 514.90357,216.31935 L 537.346,216.31935 L 537.346,86.57409 L 541.55395,86.57409 L 541.55395,216.07781 L 586.4388,216.19276 L 586.4388,86.33255 L 596.83209,86.35586 L 596.25736,216.31935 L 634.83028,216.31935 L 634.83028,86.57409 L 650.25944,86.57409 L 650.37439,216.19276 L 666.97631,216.18111"
+ id="path4848"
+ sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccc" />
+ <rect
+ style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect1350"
+ width="565.88098"
+ height="391.42545"
+ x="101.25212"
+ y="20.101711" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#ff0000;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 101.1214,216.22698 L 120.75852,216.22698 L 134.78503,145.39308 L 173.35795,145.39308 L 183.17651,97.70293 L 228.06136,97.70293 L 230.86666,86.48172 L 253.30909,86.48172 L 256.81571,97.0016 L 302.40189,97.0016 L 313.6231,146.79573 L 350.79336,146.79573 L 365.63615,216.35357 L 402.80642,216.35357 L 416.71798,287.06088 L 455.99222,287.06088 L 466.51211,336.15368 L 509.9943,336.15368 L 515.60491,346.67356 L 536.64468,346.67356 L 538.74866,336.15368 L 584.33483,336.15368 L 594.85472,287.7622 L 632.72631,287.7622 L 649.67308,216.46852 L 666.74643,216.35357"
+ id="path3100"
+ sodipodi:nodetypes="cccccccccccccccccccccccccc" />
+ <g
+ id="g10109"
+ transform="translate(-48.86194,-134.4234)">
+ <rect
+ y="163.36218"
+ x="370.37335"
+ height="37.837833"
+ width="173.48859"
+ id="rect5724"
+ style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.00000024;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text6601"
+ y="192.36218"
+ x="427.3125"
+ style="font-size:32px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ xml:space="preserve"><tspan
+ y="192.36218"
+ x="431.75"
+ id="tspan6603"
+ sodipodi:role="line">V </tspan></text>
+ <text
+ sodipodi:linespacing="125%"
+ id="text6605"
+ y="193.36218"
+ x="524.34375"
+ style="font-size:32px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;font-family:Arial"
+ xml:space="preserve"><tspan
+ y="193.36218"
+ x="528.78125"
+ id="tspan6607"
+ sodipodi:role="line">B </tspan></text>
+ <path
+ id="path8359"
+ d="M 380,182.36218 L 411,182.36218"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#0000ff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path8361"
+ d="M 477.5,182.70267 L 508.5,182.70267"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#ff0000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ <text
+ xml:space="preserve"
+ style="font-size:28px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ x="-215.22546"
+ y="35.384766"
+ id="text1325"
+ sodipodi:linespacing="125%"
+ transform="matrix(-2.775558e-17,-1,1,-2.775558e-17,0,0)"><tspan
+ sodipodi:role="line"
+ id="tspan1327"
+ x="-215.22546"
+ y="35.384766"><tspan
+ style="fill:#ff0000;fill-opacity:1"
+ id="tspan2202">B (T)</tspan>, <tspan
+ style="fill:#0000ff;fill-opacity:1"
+ id="tspan3107">V (V)</tspan></tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ x="73.904297"
+ y="27.118042"
+ id="text3109"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3111"
+ x="73.904297"
+ y="27.118042">1.5</tspan></text>
+ <text
+ sodipodi:linespacing="125%"
+ id="text3113"
+ y="93.118042"
+ x="73.904297"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ xml:space="preserve"><tspan
+ y="93.118042"
+ x="73.904297"
+ id="tspan3115"
+ sodipodi:role="line">1.0</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ x="73.904297"
+ y="157.11804"
+ id="text3117"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3119"
+ x="73.904297"
+ y="157.11804">0.5</tspan></text>
+ <text
+ sodipodi:linespacing="125%"
+ id="text3121"
+ y="223.11804"
+ x="73.904297"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ xml:space="preserve"><tspan
+ y="223.11804"
+ x="73.904297"
+ id="tspan3123"
+ sodipodi:role="line">0</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ x="67.904297"
+ y="287.11804"
+ id="text3125"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3127"
+ x="67.904297"
+ y="287.11804">-0.5</tspan></text>
+ <text
+ sodipodi:linespacing="125%"
+ id="text3129"
+ y="353.11804"
+ x="67.904297"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ xml:space="preserve"><tspan
+ y="353.11804"
+ x="67.904297"
+ sodipodi:role="line"
+ id="tspan3135">-1.0</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ x="67.904297"
+ y="417.11804"
+ id="text3141"
+ sodipodi:linespacing="125%"><tspan
+ id="tspan3143"
+ sodipodi:role="line"
+ x="67.904297"
+ y="417.11804">-1.5</tspan></text>
+ <text
+ sodipodi:linespacing="125%"
+ id="text3145"
+ y="449.11804"
+ x="99.904297"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ xml:space="preserve"><tspan
+ y="449.11804"
+ x="99.904297"
+ sodipodi:role="line"
+ id="tspan3151">0</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ x="239.9043"
+ y="449.11804"
+ id="text3157"
+ sodipodi:linespacing="125%"><tspan
+ id="tspan3159"
+ sodipodi:role="line"
+ x="239.9043"
+ y="449.11804">5</tspan></text>
+ <text
+ sodipodi:linespacing="125%"
+ id="text3161"
+ y="449.11804"
+ x="383.9043"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ xml:space="preserve"><tspan
+ y="449.11804"
+ x="383.9043"
+ sodipodi:role="line"
+ id="tspan3163">10</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ x="523.9043"
+ y="449.11804"
+ id="text3165"
+ sodipodi:linespacing="125%"><tspan
+ id="tspan3167"
+ sodipodi:role="line"
+ x="523.9043"
+ y="449.11804">15</tspan></text>
+ <text
+ sodipodi:linespacing="125%"
+ id="text3169"
+ y="449.11804"
+ x="665.9043"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ xml:space="preserve"><tspan
+ y="449.11804"
+ x="665.9043"
+ sodipodi:role="line"
+ id="tspan3171">20</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:13px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ x="160.53394"
+ y="337.10367"
+ id="text3173"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3175"
+ x="160.53394"
+ y="337.10367"></tspan></text>
+ <text
+ sodipodi:linespacing="125%"
+ id="text3179"
+ y="447.37878"
+ x="598.71094"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial"
+ xml:space="preserve"><tspan
+ y="447.37878"
+ x="598.71094"
+ sodipodi:role="line"
+ id="tspan3181">(ms)</tspan></text>
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 95.46286,19.833417 L 101,19.833417"
+ id="path3193" />
+ <path
+ id="path3195"
+ d="M 95.46286,85.36218 L 101,85.36218"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 95.46286,149.36218 L 101,149.36218"
+ id="path3197" />
+ <path
+ id="path3199"
+ d="M 95.46286,215.87702 L 101,215.87702"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 95.46286,280.84734 L 101,280.84734"
+ id="path3201" />
+ <path
+ id="path3203"
+ d="M 95.46286,344.84734 L 101,344.84734"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 95.46286,411.36218 L 101,411.36218"
+ id="path3205" />
+ <path
+ id="path3207"
+ d="M 101.00374,416.92306 L 101.00373,411.38593"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 101.23936,416.92306 L 101.23935,411.38593"
+ id="path3209" />
+ <path
+ id="path3211"
+ d="M 243.00374,416.92306 L 243.00373,411.38593"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 385.00374,416.92306 L 385.00373,411.38593"
+ id="path3213" />
+ <path
+ id="path3215"
+ d="M 525.70893,416.92306 L 525.70892,411.38593"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 667.00093,416.92306 L 667.00092,411.38593"
+ id="path3217" />
+ </g>
+</svg>
diff --git a/docs/research.md b/docs/research.md
index 9b87324..37ce31c 100644
--- a/docs/research.md
+++ b/docs/research.md
@@ -334,3 +334,15 @@ Pulse-code modulation uses pre-sampled data to generate sounds. This causes a lo
## FPGA Circuit
+In order to create an audio signal using the FPGA we can use PWM to emulate an analog signal on an output. This makes it so that in theory any signal that would have been produceable with a sound chip can also be made with the FPGA.
+
+![Audio signal with PWM](../assets/audioPWM.svg)
+
+This figure shows an example signal (in blue), created by the FPGA. and the corosponding analog signal (in red).
+
+It is usefull to generate a few different types of signals like:
+- triangle waves
+- square waves
+- sine waves
+- sawtooth waves
+- random noise \ No newline at end of file