03-15-2012 07:03 AM
I have a question regarding the AC'97 demo for SDK that digilent has released.
I am wondering how the 32 bits samples Sample_L and Sample_R are built up?
Since the AC'97 codec samples are 18 bits two's compliment (as i have come to understand), i am not sure how the Xuint32 Samples are built up, and what the different bits in the 32 bit Xuint represent.
All help is apreciated!
Solved! Go to Solution.
04-09-2012 10:03 PM
I couldn't say for sure, but the values are probably either extended to 32 bits since there's no native 18-bit C type, or the upper bits are ignored completely. The easiest way to check would be to debug the test application and see what range the values fall within. If the top 14 bits are always zero, the values are probably just truncated. Sign extending them is probably desirable if you're manipulating the values in C code.
04-16-2012 02:14 PM
Thanks for the advice! =)
i found out eventually, i read som samples into hyper terminal, and found that the samples are extended.
So if the sample is negative, all the top 12 bits are all 1's, and if its positive, they are all zeroes. The two bottom bits also follow this pattern it seems, and the audio data only lies in bit nr 2 -20