Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

Using VHDL to generate 20Mhz sine wave and visualizing with a 10bit DAC

Altera_Forum
Honored Contributor II
4,347 Views

Hi all. I want to generate a 20MHz sine wave in VHDL but have no clue of how to do it. Also, with a device like EP3C10E144C8N, is it possible to achieve that frequency? Also, I intend to use 10-bit output , and use a 10-bit DAC to convert it. Would you please giving me some suggestions about the sine wave generator , and recommending any DIP (I cant use SMD) DAC device that could operate at that frequency? I used to use this CMOS DAC, http://www.analog.com/static/imported-files/data_sheets/ad7533.pdf, but it turned out that it is not fast enough for my case. Thanks for the help.

0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
3,203 Views

The most simple way is to generate a 20 MHz square wave and extract the fundamental wave by a low-pass filter. Otherwise you need to generate a higher output data rate (e.g. 100 or 200 MS/s) to get a halfway continuous output signal. Data rates of several 100 MS/s aren't a problem for recent FPGA and DAC devices, but I fear you won't find a suitable DAC in DIP package. There are a few devices like ADV7120 (8 Bit, 80 MS/s). You may want to use a SOIC to DIP adapter board however.

0 Kudos
Altera_Forum
Honored Contributor II
3,203 Views

 

--- Quote Start ---  

The most simple way is to generate a 20 MHz square wave and extract the fundamental wave by a low-pass filter. Otherwise you need to generate a higher output data rate (e.g. 100 or 200 MS/s) to get a halfway continuous output signal. Data rates of several 100 MS/s aren't a problem for recent FPGA and DAC devices, but I fear you won't find a suitable DAC in DIP package. There are a few devices like ADV7120 (8 Bit, 80 MS/s). You may want to use a SOIC to DIP adapter board however. 

--- Quote End ---  

Wow, that sounds pretty neat and clever. If I am about to opt for quadrature modulation, is using square wave and low-pass filter still a valid option?
0 Kudos
Altera_Forum
Honored Contributor II
3,203 Views

 

--- Quote Start ---  

Wow, that sounds pretty neat and clever. If I am about to opt for quadrature modulation, is using square wave and low-pass filter still a valid option? 

--- Quote End ---  

 

 

QAM normally requires clean sine wave. A filtered approach will not produce a clean tone. A rectangular pulse has wide band that will not be filtered clean into a tone. You will need proper nco for that purpose.
0 Kudos
Altera_Forum
Honored Contributor II
3,203 Views

 

--- Quote Start ---  

QAM normally requires clean sine wave. A filtered approach will not produce a clean tone. A rectangular pulse has wide band that will not be filtered clean into a tone. You will need proper nco for that purpose. 

--- Quote End ---  

 

 

Oh, now I understand. How about Cordic algorithm?
0 Kudos
Altera_Forum
Honored Contributor II
3,203 Views

 

--- Quote Start ---  

Oh, now I understand. How about Cordic algorithm? 

--- Quote End ---  

 

 

First try simple solution. If your required tone is 20MHz and your sampling clock is multiple of 20 e.g. 100MHz then all you need is a cycle of sine data of 100/20 = 5 data points. This can be implemented as basic logic with a counter to read them sequentially. 

 

If your sampling clock divides with fractional result then you need a larger LUT (possibly altera NCO ip). people use cordic to avoid multipliers at the expense of more logic.
0 Kudos
Altera_Forum
Honored Contributor II
3,203 Views

 

--- Quote Start ---  

A rectangular pulse has wide band that will not be filtered clean into a tone. 

--- Quote End ---  

 

Both will need a filter, and with low sampling frequency of 100 MHz, the filter effort isn't so much lower than for a square wave.
0 Kudos
Altera_Forum
Honored Contributor II
3,203 Views

 

--- Quote Start ---  

Both will need a filter, and with low sampling frequency of 100 MHz, the filter effort isn't so much lower than for a square wave. 

--- Quote End ---  

 

 

I think you are talking about post DAC filter. For a proper NCO you only need the usual anti-image filter. For rectangular pulses you need a shaping filter for the tone's fundamental itself. 

 

However I am talking about QAM in digits. The normal procedure is to get a clean digital tone for modulation. The DAC output will then just need anti image filter.
0 Kudos
Altera_Forum
Honored Contributor II
3,203 Views

I just mentioned, that the filter effort won't be much different for 100 MHz sampling frequency. You can calculate yourself, you get 80 MHz first image frequency versus 60 MHz 3 harmonic, with similar energy. So the difference is probably one more filter order.

0 Kudos
Reply