hi molly,

i think most engineers and programmers that deal with fixed point numbers
prefer to use fractional representation between -1 and +1,
as then it doesn't make much difference how many bits the numbers have -
they will all have the same range.
a 16 bit number will range from -1 to +1, and so will an 8 bit number.
the 16 bit number will have more bits to the right of the decimal point (15
bits to the right, and 1 bit to the left),
vs an eight bit number will only have 7 bits to the right of the decimal
point, so it won't be as precise.

if you prefer, you can rescale the 8 bit adc value to be an integer between
-128 and +127.
but if you do this, you might have to rescale things for the casper FFT and
PFB or other casper blocks.
i think it's probably best to keep the scaling as it is, between -1 and +1,
as that's what casper blocks usually expect.

best wishes,

dan





On Sun, Aug 9, 2020 at 7:31 PM 'Molly Smith' via casper@lists.berkeley.edu <
casper@lists.berkeley.edu> wrote:

>
> Hello,
>
> I'm trying to get 8-bit real values from the katADC yellow block in
> Simulink. I was wondering why the block outputs fixed 8.7 bit values
> instead? I found the following  explanation on one of the CASPER wikis but
> I'm still confused.
>
> "The ADC block converts analog inputs to digital outputs. Every clock
> cycle, the inputs are sampled and digitized to 8 bit binary point numbers
> in the range of -1 to 1 and are then output by the ADC. This is achieved
> through the use of two's-compliment representation with the binary point
> placed after the seven least significant bits. This means we can represent
> numbers from -128/128 through to 127/128 including the number 0. Simulink
> represents such numbers with a fix_8_7 moniker. "
>
> Does it make sense to use a reinterpret block to convert it back to
> 8-bits?
>
> Thanks,
> Molly
>
> --
> You received this message because you are subscribed to the Google Groups "
> casper@lists.berkeley.edu" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to casper+unsubscr...@lists.berkeley.edu.
> To view this discussion on the web visit
> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/d197809c-a3a9-4618-9b0f-bcafaaf4c1a7n%40lists.berkeley.edu
> <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/d197809c-a3a9-4618-9b0f-bcafaaf4c1a7n%40lists.berkeley.edu?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"casper@lists.berkeley.edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to casper+unsubscr...@lists.berkeley.edu.
To view this discussion on the web visit 
https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAGHS_vGYMTxjsHuuBvPkf4JQ8uwobZXUDFhehCcogzLCPmirQg%40mail.gmail.com.

Reply via email to