<?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>FPGA: Waves 8: Fast CORDIC Sine and Cosine</title><link>/technologies/fpga-group/b/blog/posts/fpga-waves-8-fast-cordic-sine-and-cosine</link><description>Previous blogs:
 FPGA: Making Waves FPGA: Waves 2: Simple Sinewave FPGA: Waves 3: Computed Sinewave Oscillators FPGA: Waves: 4 Tinker, Taylor, Soldier, Sine FPGA: Waves: 5 CORDIC Sine FPGA: Waves 6: Reconstruction Filter 
 FPGA: Waves 7: Random ...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: FPGA: Waves 8: Fast CORDIC Sine and Cosine</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/fpga-waves-8-fast-cordic-sine-and-cosine</link><pubDate>Wed, 27 Nov 2019 13:09:04 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d3c46c16-cbc4-4254-bd85-36d322cadced</guid><dc:creator>neuromodulator</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Give delta sigma a try! Its fun! Its pretty linear, requires a single pin besides the ground and can be adapted according to your needs!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8258&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: FPGA: Waves 8: Fast CORDIC Sine and Cosine</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/fpga-waves-8-fast-cordic-sine-and-cosine</link><pubDate>Sun, 24 Nov 2019 20:34:14 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d3c46c16-cbc4-4254-bd85-36d322cadced</guid><dc:creator>jc2048</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I realised, after I&amp;#39;d posted the above comment, that it sort of implies the noise &lt;/p&gt;&lt;p&gt;is flat and therefore the trace does accurately show the filter response. That &lt;/p&gt;&lt;p&gt;isn&amp;#39;t quite true because, as the frequency moves up toward the sampling &lt;/p&gt;&lt;p&gt;frequency, the response of the output of the DAC drops off.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I thought it would be an interesting experiment to disconnect the DAC from the &lt;/p&gt;&lt;p&gt;filter and measure the spectrum at the DAC output.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here is the filter output again, and below that the output of the DAC (without &lt;/p&gt;&lt;p&gt;the filter attached - I disconnected the filter entirely because, otherwise, it &lt;/p&gt;&lt;p&gt;would affect the results)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/480x234/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-d3c46c16-cbc4-4254-bd85-36d322cadced/contentimage_5F00_205286.png:480:234]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/480x234/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-d3c46c16-cbc4-4254-bd85-36d322cadced/contentimage_5F00_205287.png:480:234]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;We can see the way the DAC output falls as it moves towards the sampling &lt;/p&gt;&lt;p&gt;frequency (fs=50Msps) [with the linear frequency scale (5MHz per div), fs is at &lt;/p&gt;&lt;p&gt;the righthand edge of the screen].&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;First observation is that with a cut-off frequency for the filter of about a &lt;/p&gt;&lt;p&gt;quarter of the sample rate, the filter output response does give a moderately &lt;/p&gt;&lt;p&gt;good indication of the cut-off frequency and the first part of the roll-off above &lt;/p&gt;&lt;p&gt;that. Further up it is going to start to be be increasingly compromised by the &lt;/p&gt;&lt;p&gt;DAC response (though with my &amp;#39;scope FFT so limited by its comparatively poor &lt;/p&gt;&lt;p&gt;resolution, compared to an actual spectrum analyser, it&amp;#39;s hardly an issue - I &lt;/p&gt;&lt;p&gt;can&amp;#39;t look at that area sensibly anyway).&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The reason for that drop is that this kind of DAC moves to a set level and then &lt;/p&gt;&lt;p&gt;sits there for the sample period. If it did that perfectly, that results in a &lt;/p&gt;&lt;p&gt;(sin x)/x spectrum envelope. That curve has nulls at multiples of the sampling &lt;/p&gt;&lt;p&gt;frequency.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If I change the settings, so that we can see up beyond the sample rate, we get &lt;/p&gt;&lt;p&gt;this with the nulls quite clear [this is now 25MHz per div].&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/480x234/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-d3c46c16-cbc4-4254-bd85-36d322cadced/contentimage_5F00_205288.png:480:234]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;A couple of observations. There&amp;#39;s quite a lot of energy at the actual sample rate &lt;/p&gt;&lt;p&gt;frequency (and its multiples) and the null around it isn&amp;#39;t all that deep. We can &lt;/p&gt;&lt;p&gt;surmise the reason if I show you the actual DAC output waveform&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/480x234/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-d3c46c16-cbc4-4254-bd85-36d322cadced/contentimage_5F00_205289.png:480:234]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Instead of a nice stepped waveform, I have the output slewing from sample to &lt;/p&gt;&lt;p&gt;sample and often only just making it before the next change. That then gives me &lt;/p&gt;&lt;p&gt;something quite messy between the delta functions of perfect sampling theory and &lt;/p&gt;&lt;p&gt;an accurate, precise step that you&amp;#39;d get with a monolithic DAC that can manage a &lt;/p&gt;&lt;p&gt;decent zero-order (stepped) output. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Perhaps I was a touch optimistic about the kind of results I could get with a &lt;/p&gt;&lt;p&gt;resistor DAC, built on stripboard, at rf frequencies [though it has been fun to &lt;/p&gt;&lt;p&gt;experiment with and the results are better than I feared they might be].&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8258&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: FPGA: Waves 8: Fast CORDIC Sine and Cosine</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/fpga-waves-8-fast-cordic-sine-and-cosine</link><pubDate>Sat, 23 Nov 2019 23:30:02 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d3c46c16-cbc4-4254-bd85-36d322cadced</guid><dc:creator>jc2048</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Here&amp;#39;s the stats&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Device utilization summary:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; GSR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100% used&lt;br /&gt;&amp;nbsp;&amp;nbsp; PIO (prelim)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19/174&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10% used&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19/100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19% bonded&lt;br /&gt;&amp;nbsp;&amp;nbsp; SLICE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 244/2376&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10% used&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;and the floorplan&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x513/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-d3c46c16-cbc4-4254-bd85-36d322cadced/2450.contentimage_5F00_205284.png:620:513]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;That looks quite reasonable, but remember it&amp;#39;s for a short wordlength (only 6 &lt;/p&gt;&lt;p&gt;bits).&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Finally, I hacked my random number generator and attached it to the DACs. The &lt;/p&gt;&lt;p&gt;oscilloscope&amp;#39;s FFT then shows, somewhat crudely, the frequency response of the &lt;/p&gt;&lt;p&gt;filter [note that the frequency scale is linear]. That suggests that my cut-off &lt;/p&gt;&lt;p&gt;frequency is around 12.5MHz, where it was meant to be. So I got that right, at &lt;/p&gt;&lt;p&gt;least.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/480x234/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-d3c46c16-cbc4-4254-bd85-36d322cadced/5582.contentimage_5F00_205285.png:480:234]&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8258&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: FPGA: Waves 8: Fast CORDIC Sine and Cosine</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/fpga-waves-8-fast-cordic-sine-and-cosine</link><pubDate>Sat, 23 Nov 2019 22:30:09 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d3c46c16-cbc4-4254-bd85-36d322cadced</guid><dc:creator>shabaz</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hi Jon,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This is a great blog post. Thanks for sharing the VHDL code too, it&amp;#39;s awesome being able to see all this as you experiment.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8258&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: FPGA: Waves 8: Fast CORDIC Sine and Cosine</title><link>https://community.element14.com/technologies/fpga-group/b/blog/posts/fpga-waves-8-fast-cordic-sine-and-cosine</link><pubDate>Sat, 23 Nov 2019 18:06:05 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d3c46c16-cbc4-4254-bd85-36d322cadced</guid><dc:creator>genebren</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Another great entry in your series of blogs.&amp;nbsp; Interesting artifact at/around the zero crossing, hopefully you will find a good solution.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8258&amp;AppID=19&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>