07-07-2020 05:04 PM - edited 07-07-2020 05:31 PM
I'm just looking for an explanation for what the look-up table size does to the actual signals being produced. I see the power spectrum preview but I'm quite confused as to how that pertains to generating a low power, low frequency sine wave. I am sending the output of this VI straight into a scaling math function and then sending that out to a C series output module. I am noticing the higher look-up table size I use; the drastically more block RAMs the build takes up. Is there really any benefit to using a higher look-up table size?
07-08-2020 12:55 AM - edited 07-08-2020 12:56 AM
Hi M,
@MGardner5 wrote:
I am noticing the higher look-up table size I use; the drastically more block RAMs the build takes up. Is there really any benefit to using a higher look-up table size?
The larger the LUT, the more accurate the output data: when using a (theoretical) LUT of just 2 values you would not get a sine signal at all with linear scaling between those two values. When the LUT provides a value for each 5 degree (19 samples from 0° to 90°) even with linear scaling inbetween the signal will look much more like a sine. With a LUT size of 91 samples (0° to 90° with steps of 1°) you will hardly notice a difference to a real sine…
That's a typical trade-off: how much BRAM (or FPGA fabric) do you can afford compared to the signal quality you get/need!
07-08-2020 05:15 PM
Hi Gerd,
Thanks for the reply, how does this play into the output resolution settings? I notice some of the LUT selections get grayed out depending on which resolution I choose. I am noticing I threw all my LUT selections to the minimum (512?) and now my external circuitry is not picking up the sine waves at all. I was using about 100% of my block RAMs before I switched them all to the minimum. I have about 10 sine wave generator VIs in my build and they worked the way I had them I was just worried if I ever had to expand the project I did not want to hurt my performance if I had to add more RAM demand. Is there any worry of using near 100% all the time?
Thanks
Matt
07-09-2020 02:28 AM
Hi Matt,
why do you need 10 sine wave generators? IMHO you need only one sine wave generator to create any sine signal…
07-09-2020 09:47 AM
I have a large project requiring 10 different sinusoidal signals along with a lot of other logic.
07-09-2020 09:57 AM
Hi Matt,
@MGardner5 wrote:
I have a large project requiring 10 different sinusoidal signals along with a lot of other logic.
Please explain the term "different sinusoidal signals". A sine signal is a sine, you maybe just need to adjust amplitude scaling afterwards…
07-09-2020 10:00 AM
3 of them are 60Hz and 120 degrees a part, 3 are the same but phase adjusted for a power factor calculation. The other 4 are all set at different frequencies.
07-09-2020 10:05 AM
07-09-2020 10:07 AM
That doesn't matter.
You just need to do math on your inputs to select the correct part of your look up table. So something that is at twice the frequency, you'd multiply your X value by a factor so it looks up the correct part of the base sine wave signal. For a different phase, then you add some constant to your X to get to the correct part of the sine wave. For a larger amplitude, then you'd multiple the result of the lookup table by a factor.
All you need is a basic sine wave that has an amplitude of 1, and nominal number of data points for a full period.
07-09-2020 02:19 PM
I am not seeing how I can manipulate a sinewave on the fpga since it is represented as a single precision integer at any point in time. I cannot find any frequency changing methods or VIs within the fpga. The only way I have found is to have 10 separate sine wave generator VIs which takes up near 100% of block RAM usage. From what I can tell the sine wave generator VI doesn't create an actual sine wave function, it just outputs data points that correspond to a sinewave. I am using cRIO fpga chip hardware.