<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SystemVerilog Study Notes. DDFS. Direct Digital Frequency Synthesis for Sound</title><link>/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-ddfs-direct-digital-frequency-synthesis-for-sound</link><description>DDFS - Direct Digital Frequency Synthesis
DDFS is a digitally-controlled method of generating multiple frequencies from a reference frequency source. DDFS is a method of producing a tunable digital or analog waveform. First the data points of the wav</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: SystemVerilog Study Notes. DDFS. Direct Digital Frequency Synthesis for Sound</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-ddfs-direct-digital-frequency-synthesis-for-sound</link><pubDate>Sun, 05 Mar 2023 18:10:58 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:018fb115-09d4-4d6f-9cbe-4cce54d60c97</guid><dc:creator>javagoza</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;First attempts with the ADSR module using a triangle wave.&lt;/p&gt;
&lt;p&gt;Attack 100ms, Decay 50ms, Sustain 100ms, Release 50ms. Frequency 262Hz. Sustain amplitude level 90%&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="698" src="/resized-image/__size/2292x1396/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-018fb115-09d4-4d6f-9cbe-4cce54d60c97/ADSR_5F00_100_5F00_50_5F00_100_5F00_50_5F00_262Hz.png" width="1146" /&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25213&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SystemVerilog Study Notes. DDFS. Direct Digital Frequency Synthesis for Sound</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-ddfs-direct-digital-frequency-synthesis-for-sound</link><pubDate>Sat, 25 Feb 2023 01:58:11 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:018fb115-09d4-4d6f-9cbe-4cce54d60c97</guid><dc:creator>dang74</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Very informative blog.&amp;nbsp; It had never occurred to me to use a triangle pattern in the memory instead of a sine wave.&amp;nbsp; I also like how you used a 1 bit DAC.&amp;nbsp; This general approach can be very helpful to me in one of my audio projects.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25213&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SystemVerilog Study Notes. DDFS. Direct Digital Frequency Synthesis for Sound</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-ddfs-direct-digital-frequency-synthesis-for-sound</link><pubDate>Tue, 21 Feb 2023 19:39:38 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:018fb115-09d4-4d6f-9cbe-4cce54d60c97</guid><dc:creator>DAB</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Very good blog.&lt;/p&gt;
&lt;p&gt;You did a great job of walking through the design and explaining each section.&lt;/p&gt;
&lt;p&gt;Well done.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25213&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SystemVerilog Study Notes. DDFS. Direct Digital Frequency Synthesis for Sound</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-ddfs-direct-digital-frequency-synthesis-for-sound</link><pubDate>Mon, 20 Feb 2023 19:39:17 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:018fb115-09d4-4d6f-9cbe-4cce54d60c97</guid><dc:creator>shabaz</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Great blog!&lt;/p&gt;
&lt;p&gt;In case you&amp;#39;re researching ideas, there&amp;#39;s a classic &amp;quot;operator&amp;quot; style system&amp;nbsp;that might be worth investigating, since you already have the basic mechanism for the DDS oscillator to work at any desired frequency. It allows configuration into FM synthesis, which doesn&amp;#39;t require any wave shapes except the existing sine-waves.&amp;nbsp;Many instances of the oscillator get used as blocks that are chained together.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s an explanation and example C code here:&amp;nbsp;&amp;nbsp;[mention:907197179023413fba3f9097d979bfbf:f7d226abd59f475c9d224a79e3f0ec07]&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve put the &lt;a href="https://github.com/shabaz123/ucsynth"&gt;synth code describe there on GitHub&lt;/a&gt; since the file link at that blog post doesn&amp;#39;t seem to&amp;nbsp;be clickable.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In brief the diagram below shows 4 &amp;quot;operators&amp;quot;, which ended up being two oscillators, and two ADSR modules (actually they are the same code as the oscillator, but the oscillator gets switched off) and then they are chained together into the setup here, and then there are just the size parameters at the top (Amplitude, Note Duration, Carrier Freq and so on) to describe any sound possible with that combination of the operators. The orange shapes have two inputs, the left one represents amplitude control, the right one is frequency control (they are not AND gates, that&amp;#39;s just an unfortunate shape that is used).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-018fb115-09d4-4d6f-9cbe-4cce54d60c97/synth_2D00_alg.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Regarding the 32-bit to 16-bit,&amp;nbsp;it may be best to stick to 32-bit in-between each operation too, (or at least 24-bit) otherwise it doesn&amp;#39;t sound as good. I made the mistake of doing 16-bit computation,&amp;nbsp;throughout (because I was trying to do it all with minimal resources for microcontrollers), and it is noticeable in the sound quality. The synth demo program plays a basic tune, nothing interesting, but the tune is played with a sort of woodwind instrument sound (which was due to the parameters supplied to the setup. It uses 16-bit calculations. I took the woodwind instrument parameters from the original FM synthesis inventer&amp;#39;s paper (the paper only had that example, so that was all I had, since I&amp;#39;m not knowledgeable enough to invent my own instrument sounds!), but it would be possible to take them from any real music synth too, if people have deciphered their ROMs (which they probably have), or from their custom synth setup files for say Yamaha etc (but I don&amp;#39;t know the formats).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Anyway, the above is just some info in case you&amp;#39;re looking for any ideas.&amp;nbsp;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25213&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SystemVerilog Study Notes. DDFS. Direct Digital Frequency Synthesis for Sound</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-ddfs-direct-digital-frequency-synthesis-for-sound</link><pubDate>Mon, 20 Feb 2023 12:09:12 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:018fb115-09d4-4d6f-9cbe-4cce54d60c97</guid><dc:creator>jc2048</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&amp;quot;Generation of some notes in the 4th octave. I really don&amp;#39;t really know what that means.&amp;quot;&lt;/p&gt;
&lt;p&gt;Numbering octaves like that is scientific pitch notation. This Wikipedia page tells you most of what you&amp;#39;d need for doing anything practical.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Scientific_pitch_notation"&gt;https://en.wikipedia.org/wiki/Scientific_pitch_notation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The table in that article is based on &amp;#39;equal temperament&amp;#39; tuning. That means the octave is formed of 12 notes, where each note is the twelth-root-of-two times the frequency of the preceding one. Once you&amp;#39;ve applied that twelve times, the ratio across twelve notes is then two, which is the octave. Obviously, there has to be one note that sets the frequency that all the ratios are done from. For modern music played by an orchestra, the basic note that the instruments are tuned to is A4, which is nowadays defined as 440Hz.&lt;/p&gt;
&lt;p&gt;Although you could calculate the frequencies as you go, you&amp;#39;ll find it easier to precompute them and put them in a table. Get them in the right places and the MIDI note number can be used directly as the index to the table (if you want to play MIDI).&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25213&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SystemVerilog Study Notes. DDFS. Direct Digital Frequency Synthesis for Sound</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-ddfs-direct-digital-frequency-synthesis-for-sound</link><pubDate>Mon, 20 Feb 2023 08:34:59 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:018fb115-09d4-4d6f-9cbe-4cce54d60c97</guid><dc:creator>michaelkellett</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Great blog. Any chance you could get a scale on the spectrum plot of the sine output - I&amp;#39;m very interested in the linearity and noise from your 1 bit ds DAC.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;MK&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25213&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SystemVerilog Study Notes. DDFS. Direct Digital Frequency Synthesis for Sound</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/systemverilog-study-notes-ddfs-direct-digital-frequency-synthesis-for-sound</link><pubDate>Sun, 19 Feb 2023 22:26:55 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:018fb115-09d4-4d6f-9cbe-4cce54d60c97</guid><dc:creator>genebren</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Very nice blog.&amp;nbsp; I look forward to seeing your ADSR design.&amp;nbsp; Thanks for sharing!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25213&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>