LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't understand why ''Terminal data type of Audio IN fpga node is 16 bit signed integer''??

Solved!
Go to solution

Hello there,

I am working with myRIO 1900 for my ANC project.  

 

The Audio IN of the fpga node is giving its terminal data type as 16 bit signed integer. So, eventually the output from the fpga nodes is fluctuating between two values -1 and 1. But I want the real values of audio data, I could not understand how to approach this problem.

 

Audio In on the RT side is giving terminal data type as real values, but I could not understand why the terminal data type of fpga Audio In is 16 bit integer. ??

 

Please help me solve this problem.

 

Thank you.

0 Kudos
Message 1 of 6
(5,201 Views)

FPGA's work best with integers.  Dealing with real, floating point numbers eat up a lot more of the logic fabric.  It is best to stay with integers for as long as you can in FPGA code.

 

You just need to rescale the I16 values (-32768 to 32767) to whatever is the range of your analog input (perhaps -10V to +10V?)

0 Kudos
Message 2 of 6
(5,183 Views)

The 16-bit integer is the value straight from the Analog To Digital Converter (ADC).  You can do a lot of processing with the value as a simple integer.  Otherwise, just do a little math and you can get the actual reading.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 6
(5,175 Views)

Can you  give a hint as to what that little math is? 

I can not  be able to understand sth,my audio singal values from microphones are between -1V to 1V real values. If Audio IN is giving 16 bit integer value as output, it is essentially rounding off these real values to either 1 or -1 directly. Now, even if I do some multiplications or modifications, the essential value is rounded off before only and I will be playing with the rounded off value. !  

 

If you meant the amplification before feeding to ADC, I will be in trouble as Audio IN of myRIO range is +2.5V to -2.5V. This will kill the accuracy of the signal.

Please help me understand this !

0 Kudos
Message 4 of 6
(5,161 Views)
Solution
Accepted by topic author charansai

If your analog range is +/- 2.5 V.  Then -32768 would be the equivalent of -2.5 V.  32767 would be +2.5V. 

 

If you are getting +/- 1 V, then you should be seeing somewhere between  +/- 13,107 on the analog input of the I16 number.

 

Basically take the I16 number, divide by 32767, multiply by 2.5.  You'll have your analog input in volts.

 

I don't know why you thing it is just rounding it to -1 to +1.  Something else must be wrong with your code or setup.

Message 5 of 6
(5,140 Views)

It was my mistake, I used fixed point conversion on the data as I am not expecting the values to be over +-1. 

I understood, the calculation but when I perform this calculation on mic data, I am getting values around 16  times less values than the values coming on the RT side. 

 

I tried several things, I suppose I am doing some mistake in the data conversions or division of FPGA.!

 

Here using simple numerical operations from Numerical pallette.

fpga.png

 

With this VI, eventually I am getting around 16 times less values than the original ( RT side values)

 

Another version on which I am keenly interested is using Fixed point conversion, but I dont know why with this I am getting 0 value.

 

Please check the VIs attached below.

 

Thank you.

Download All
0 Kudos
Message 6 of 6
(5,091 Views)