Sine Wave Generation

Hi all

I need some help with regards to generating a sine wave. I thought abt this problem and some thoughts that came to mind are as follows:

  1. Generate sine values using spreadsheet
  2. Store these values either in ROM or make a table withing VHDL
  3. Write VHDL code and output these values.

My question is: Is it better to store these values in ROM (eg. LUT) or directly hardcode the values. Is there a website that will explain or give more explanation in this area.

Cheers

Reply to
SneakerNet
Loading thread data ...

--

--Ray Andraka, P.E. President, the Andraka Consulting Group, Inc.

401/884-7930 Fax 401/884-7950 email snipped-for-privacy@andraka.com
formatting link

"They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759

Reply to
Ray Andraka

If you need more than a few points, a ROM would be a better idea. I did this to generate a sine wave (via a D/A) for an all digital LVDT synchronous demodulation circuit. The beauty of using ROM is you can store many points, including multiple frequencies by using the upper address lines to select a different set of values.

BTW, I used C and/or Visual Basic to generate the values, writing them directly to a binary file, then using the file to program the ROM.

--
Greg
readgc.invalid@hotmail.com.invalid
 Click to see the full signature
Reply to
Gregory C. Read

You could use a single digital output to produce a square wave at the fundamental frequency, then filter out the harmonics to produce a sinewave.

It wouldn't be the most flexible soluti> Depends on the number of phase angles you need to have. For example, if you

1,0,

may

--
Andrew Greensted            Department of Electronics
Bio-Inspired Engineering    University of York, UK
 Click to see the full signature
Reply to
Andrew Greensted

There is a synthesisable sine wave generator on our website here :

formatting link

It includes a perl script to generate a sine wave lookup table of arbitrary dimensions/precision. The code will probably want modifying slightly so it uses LUT based ROM or BRAMs. If I have time, I might add an FPGA optimisd version...

HTH

Ian

-- Ian Poole, Consultant

The contents of this message may contain personal views which are not the views of Doulos Ltd., unless specifically stated.

this

the

area.

Reply to
Ian Poole

--

--Ray Andraka, P.E. President, the Andraka Consulting Group, Inc.

401/884-7930 Fax 401/884-7950 email snipped-for-privacy@andraka.com
formatting link

"They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759

Reply to
Ray Andraka

(big snip)

I seem to remember ones that had two ROMs, where the second was a linear interpolation. Adders were then used to combine the results from the ROMs. There may be some FPGA cases where that method could still be used.

-- glen

Reply to
glen herrmannsfeldt

1) write a sample counter. when the msb of the counter is '0', take all lsb. when the msb of the counter is '1', invert all lsb. The result is a triangular wawe. 2) Cut the top and bottom of your triangular wawe using comparators

3) used a filter to remove harmonics

Laurent Gauch

formatting link

Reply to
Amontec Team, Laurent Gauch

There's a fairly nice arbitrary frequency sine and cosine generator core available from Xilinx that has a whole host of options. We're playing with it on a current project. It even has a multiplex mode where you can reuse the LUTs for up to 16 different signals.

YMMV

-Marty

arbitrary

Reply to
Martin Ryba

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.