comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » converting ieee-float-format to pw-wave-float-format
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
converting ieee-float-format to pw-wave-float-format [message #2667] Thu, 25 August 1994 04:40
SLAMECZKA is currently offline  SLAMECZKA
Messages: 4
Registered: August 1994
Junior Member
In <Cv1q43.JJ4@hpl.hp.com> peter@hpl.hp.com writes:
> SLAMECZKA,MICHAEL (SLAMECZKA@EZINFO.VMSMAIL.ETHZ.CH) wrote:
> : I have an 4 byte float in the ieee-format and should convert it into the
> : pw_wave-format.

> There's a difference?

Yes there had to be a difference. Every computer has its own format to save
floats into a byte array and that programm produces an output in the ieee-
format.

> : To do so, I had to shift the byte by 2, that means:
> : byte1 byte2 byte3 byte4 had to be shifted:
> : --> byte3 byte4 byte1 byte2
> : in pw_wave I do the following
> : readu,1,flo
> : print,flo ---> byte3 byte4 byte1 byte2
> : print,float(flo,0) ---> floaatingpointnumber

> Ah, maybe you need to byteswap your data (did you transfer it from one
> CPU type to another?) Try the BYTEORDER command. From your
> description, I think you need BYTEORDER, /LSWAP.

Sorry, BYTEORDER does not produce the right output, I have tried all the
'input keywords'.

> : now my problem realy starts:
> : the result is only one quarter of the original number, that means, if I had
> : a 10 then i get as result in pw_wave 2.5!!!
> Never seen this!
> : thanks a lot
> Hope this helps,
> Peter

your solution Peter does not help,

is anybody out there, who has a better solution?

Thanks in advance

Michael
Re: converting ieee-float-format to pw-wave-float-format [message #2676 is a reply to message #2667] Wed, 24 August 1994 08:38 Go to previous message
peter is currently offline  peter
Messages: 80
Registered: February 1994
Member
SLAMECZKA,MICHAEL (SLAMECZKA@EZINFO.VMSMAIL.ETHZ.CH) wrote:
: Hi everybody!!

: My problem is the following:

: I have an 4 byte float in the ieee-format and should convert it into the
: pw_wave-format.

There's a difference?

: To do so, I had to shift the byte by 2, that means:
: byte1 byte2 byte3 byte4 had to be shifted:

: --> byte3 byte4 byte1 byte2

: in pw_wave I do the following

: readu,1,flo
: print,flo ---> byte3 byte4 byte1 byte2
: print,float(flo,0) ---> floaatingpointnumber

Ah, maybe you need to byteswap your data (did you transfer it from one
CPU type to another?) Try the BYTEORDER command. From your
description, I think you need BYTEORDER, /LSWAP.


: now my problem realy starts:
: the result is only one quarter of the originally number, that means, if I had
: a 10 then i get as result in pw_wave 2.5!!!

Never seen this!

: thanks a lot


Hope this helps,

Peter
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Cursor color????
Next Topic: Smith Charts in IDL/PV-WAVE?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 20:02:57 PDT 2025

Total time taken to generate the page: 0.75823 seconds