01-25-2017 04:10 AM
What is a good way to programmatically control the output amplitude of the FPGA Sine Wave Generator, before sending it to the physical AO?
I guess I should set full scale amplitude from the block diagram of the Sine Wave Generator and rescale it before sending in to the output. I use I16 for the sine output, which matches the AO connector input.
In my application I'd like to be able to rescale the sin amplitude from 0V to 10V with a fine grain, so not only dividing by 2.
Thanks
Solved! Go to Solution.
01-25-2017 04:44 AM
The only way to implement a fine gain is to add a Multiplier in your signal path before sending the data to your physical AO.
You have different approaches you can use to do this but the most correct is probably to use fixed-point arithmetic.
Your operations could for example be.
1 - convert your generator data (here assumed to be I16) to FXP <+/-, 16, 16>. This keeps your original data range and resolution
2 - multiply with a gain factor of type FXP <+, 16, 1>. The range for your gain is [0, 1.999..] but this allows you to define a gain of exactly 1.000. Note that any gain value bigger that 1.000 will end overflowing your AO data.
3 - configure the output of your multiply to FXP <+/-, 16, 16> and cast it back to I16 before sending it out to your AO