• 0
Raghu0860

Sine wave generation using DA4

Question

I have a task, as a part of my master thesis, to generate a sine wave using Pmod DA4. I found the solution, however, to generate a sine wave using look-up table. The online LUT generators are for fixed amplitude i.e., sine wave is generated with a dc offset of 1.25V and an amplitude of 1.25Vp-p (considering DA4 with a reference of 1.25V and an internal gain of 2). However, I want to generate a sine wave with different amplitude and frequency (changing frequency is possible with the help of timers, so that is not a problem). Therefore, I want to know if it is really possible to generate a different amplitude sine wave? Is there any algorithm for doing that?

My requirements are,

1. Sine wave with the frequency of around 10Hz (which is possible).

2. With 500mV of dc offset and around 50mVp-p of amplitude.  

I am using zeboard for the development. 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello, @Raghu0860!

If you are using a lookup table I suppose you are iterating through it with a loop. In order to make your amplitude variable you can use a variable that should be added to the value you are getting from the lookup table. That variable could be controlled by buttons or switchs, for example.

Good luck!

Share this post


Link to post
Share on other sites
  • 0

Well, the more or less obvious approach is to take the data of your existing sine wave and multiply it with a scaling factor. This needs a bit of planning (fixed point math).

You can find a somewhat related example here

https://forum.digilentinc.com/topic/9096-fpga-audio-adc-and-dac/?do=findComment&comment=30172

This involves sine wave generation (based on splines, consider them a lookup table for interpolation over polynomial segments) and fixed point multiplication.

If you allow me one opinion, what I'm reading between the lines is that you have quite a bit of work ahead in FPGA land (several working weeks or more). Don't underestimate it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now