Log in

View Full Version : inverse sine FPGA


Betty Boop
22-01-2012, 12:04
I’m implementing inverse sine inside the FPGA VI. To do that, I use lookup table/LUT. I found the attached VI. I’m just wondering if there’s a way that I could be the one to set the input values in the LUT? In the attached VI, the input value is between 0-1023 which is the ‘address’. Is there a way that I could customize LUT for the input value (i.e. input values could be: -1, 0.8, 0.6.... not necessarily the address which is 0,1,...1023)? It’s because I’m having a hard time utilizing the attached VI in mapping the input and output to their true values (i.e. -1 to 1 for input, -pi/2 to pi/2 for output). Thank you very much for your time!

MotorHead
22-01-2012, 13:54
I am confused why you are using a look up table. There is an arc sine function built into LabVIEW. You can find in the Functions Pallet group -> Mathematics -> Elementary & Special Functions -> Trigonometric -> asin

I modified and attached your vi with the asin function in it. If you need to shift the value or do a unit change, you can do it to the output of the asin function.

Ether
22-01-2012, 15:15
I’m having a hard time utilizing the attached VI in mapping the input and output to their true values (i.e. -1 to 1 for input, -pi/2 to pi/2 for output).

I'll answer your lookup table question, even though I too wonder why you are doing this.

For indices from 0 to 1022, populate your table with arcsine(index/511-1).

To use the table to find arcsine(X) (where -1<=X<=+1), calculate the index as 511*(X+1) and look up the arcsine for that index in the table.

Betty Boop
22-01-2012, 18:34
I am confused why you are using a look up table. There is an arc sine function built into LabVIEW. You can find in the Functions Pallet group -> Mathematics -> Elementary & Special Functions -> Trigonometric -> asin

I modified and attached your vi with the asin function in it. If you need to shift the value or do a unit change, you can do it to the output of the asin function.

The built-in asin function cannot be implemented inside FPGA VI. That's why LUT is necessary. :)

Betty Boop
23-01-2012, 00:42
I'll answer your lookup table question, even though I too wonder why you are doing this.

For indices from 0 to 1022, populate your table with arcsine(index/511-1).

To use the table to find arcsine(X) (where -1<=X<=+1), calculate the index as 511*(X+1) and look up the arcsine for that index in the table.



Hi, Sir! :D Thanks for giving me an idea! :D I've successfully created the LUT for the inverse sine! :D Thank you very much again! :D Btw, the questions I've posted in the forums are for my thesis :D Thanks for all the help! :D