From: aaronde on
Hi

I reading a Wav file in C++. I need to convert the PCM values to float
values for further DSP manipulation (Filtering etc ...). Do I need to do
this through a conversion from Hex to binary unsigned 2 complement values
then to integers ? Thus anyone know of any available function in C/C++ ? Am
I missing something ?

Thanks and Regards
Aaron
From: Jerry Avins on
aaronde wrote:
> Hi
>
> I reading a Wav file in C++. I need to convert the PCM values to float
> values for further DSP manipulation (Filtering etc ...). Do I need to do
> this through a conversion from Hex to binary unsigned 2 complement values
> then to integers ? Thus anyone know of any available function in C/C++ ? Am
> I missing something ?

I suspect that you are in serious trouble if you don't know that hex and
binary represent exactly the same thing.

Jerry
--
Engineering is the art of making what you want from things you can get.
�����������������������������������������������������������������������
From: Vladimir Vassilevsky on


aaronde wrote:

> Hi
>
> I reading a Wav file in C++. I need to convert the PCM values to float
> values for further DSP manipulation (Filtering etc ...). Do I need to do
> this through a conversion from Hex to binary unsigned 2 complement values
> then to integers ? Thus anyone know of any available function in C/C++ ? Am
> I missing something ?

Sometimes the idiocy of modern programmers is just unbelievable.

VLV
From: aaronde on
>
>
>aaronde wrote:
>
>> Hi
>>
>> I reading a Wav file in C++. I need to convert the PCM values to float
>> values for further DSP manipulation (Filtering etc ...). Do I need to
do
>> this through a conversion from Hex to binary unsigned 2 complement
values
>> then to integers ? Thus anyone know of any available function in C/C++
? Am
>> I missing something ?
>
>Sometimes the idiocy of modern programmers is just unbelievable.
>
>VLV
>

Hi

Thanks for calling me an idiot. Really nice of you I suppose you were born
knowing everything and you never asked a simple and dumb question. No one
forced you to reply or read the post if you think it so stupid. On the
other hand I would appreciate any help as this is the first time I am doing
such work.

Okey I know that hex and binary are the representation of the same thing.
My question was that you can't apply a dsp operation using the PCM values.
If I read the wav file and get a Hex value of 8A this has to be
represented as an float type ie conveted and rescaled to a range between -1
and 1 in order to apply further operations. My question was weather there
is a built in fucntion in C/C++. Please excuse me if I am not clear with my
question

Thanks and Regards
Aaron
From: Les Cargill on
aaronde wrote:
>>
>> aaronde wrote:
>>
>>> Hi
>>>
>>> I reading a Wav file in C++. I need to convert the PCM values to float
>>> values for further DSP manipulation (Filtering etc ...). Do I need to
> do
>>> this through a conversion from Hex to binary unsigned 2 complement
> values
>>> then to integers ? Thus anyone know of any available function in C/C++
> ? Am
>>> I missing something ?
>> Sometimes the idiocy of modern programmers is just unbelievable.
>>
>> VLV
>>
>
> Hi
>
> Thanks for calling me an idiot. Really nice of you I suppose you were born
> knowing everything and you never asked a simple and dumb question. No one
> forced you to reply or read the post if you think it so stupid. On the
> other hand I would appreciate any help as this is the first time I am doing
> such work.
>
> Okey I know that hex and binary are the representation of the same thing.
> My question was that you can't apply a dsp operation using the PCM values.
> If I read the wav file and get a Hex value of 8A this has to be
> represented as an float type ie conveted and rescaled to a range between -1
> and 1 in order to apply further operations. My question was weather there
> is a built in fucntion in C/C++. Please excuse me if I am not clear with my
> question
>
> Thanks and Regards
> Aaron


You need to use either the plain assignment operator or a cast.

short number = 55;
double dnumber = number;
-- or --
double dnumber = (double) number;
depending on which sort of compiler you use and
what options are enabled.

--
Les Cargill