Questions about data type conversion in GRC. (ADC, encoder)

Hi all,

Here I have a question regarding data type conversion in GRC. Since the
output of audio source is analog signal. So, I am going to encode the
analog
output of audio source(float, -1 to +1 ??) to digital bit streams(byte)
for
digital signal Processing later on. But I found there’s no ADC or
encoder in
GRC which could properly convert float: -1~+1 to Byte: 00~FF. Is there
any
way to achieve that?

Thank you,

Milo

Milo W. wrote:

So, I am going to encode the analog output of audio source(float, -1
to +1 ??) to digital bit streams(byte) for digital signal Processing
later on.
What exactly are you trying to accomplish? The samples you get from an
audio source, like any other GNU radio source, have already been
digitized. Are you trying to extract a modulated signal that contains
digital data (i.e. FSK, PSK) from your audio source?
But I found there’s no ADC or encoder in GRC which could properly
convert float: -1~+1 to Byte: 00~FF. Is there any way to achieve that?
If you’re just looking to convert floats to bytes, use either
gr.float_to_char (range -128 to 127) or gr.float_to_uchar (range 0 to
255). However, be aware that you will lose a lot of dynamic range—the
input is converted to a long integer first, then clipped. You will need
to scale your signal by adding 1 and dividing by 2/255 before you
convert it.

You

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs