Forum Discussion
9 Replies
- Altera_Forum
Honored Contributor
If you have no VHDL knowledge, my first suggestion would be to find a good tutorial and get yourself familiar with the language.
As for the sin waves, sine and cosine are identical, but with a phase shift. It would be easy enough to build a ROM of sin values in VHDL and just read them out. - Altera_Forum
Honored Contributor
Or read up on Goertzel.
- Altera_Forum
Honored Contributor
There are many methods that can be used, A simple lookup table is the easiest, then just step through the lookup table at different rates.
If you truly want to generate Sin and Cos values, a CORDIC algorithm is the way to go. Pete - Altera_Forum
Honored Contributor
If it was me I will use the altera ip away from manual hdl coding. I think cordic is too much for a beginner to hand code or understand.
- Altera_Forum
Honored Contributor
--- Quote Start --- If it was me I will use the altera ip away from manual hdl coding. I think cordic is too much for a beginner to hand code or understand. --- Quote End --- Does altera provide cordic IP for user now? - Altera_Forum
Honored Contributor
Hi Tricky,
I have learnt VHDL and I suppose I have some knowledge of this language. But just for this application, I have not clear idea to achieve this. In my mind, I want to use Look up table, due to the ADA board is 14 bits, and I have generated the different values in Excel for one cycle, I am not sure should I generate all 2^14 values or not. Thanks for your reply. Best wishes, peipei --- Quote Start --- If you have no VHDL knowledge, my first suggestion would be to find a good tutorial and get yourself familiar with the language. As for the sin waves, sine and cosine are identical, but with a phase shift. It would be easy enough to build a ROM of sin values in VHDL and just read them out. --- Quote End --- - Altera_Forum
Honored Contributor
Hi Jerry,
I am planning to use LUT. Do you have specific suggestions? My ADA board is 14 bits. Thanks, Best wishes, peipei --- Quote Start --- Does altera provide cordic IP for user now? --- Quote End --- - Altera_Forum
Honored Contributor
Remember Sin and cosine are reflective, so you only need 2^13 values in the rom, you use the 14th bit as the sign bit.
- Altera_Forum
Honored Contributor
CORDIC is suitable for generating the sin/cos of an angle.
You can generate sin(a + delta) from sin(a - delta) and sin(a) with a single multiply (and a shift). The only slight problen is that the amplitude can drift.