Unit conversion

Recommended Posts

OK, so here's the dumb question of the day.

I'm trying to figure out the best way to convert U16 array to an array of DBL 150 uV Peak to Peak.

Thanks in advance for the help.

Can't you just use 'To Double Precision Float' primitive on the numeric >> conversion pallete? It takes arrays.

What's the significance of "150 uV Pk-Pk"?

~Dan

QUOTE (Dan DeFriese @ Oct 10 2008, 06:27 PM)

Can't you just use 'To Double Precision Float' primitive on the numeric >> conversion pallete? It takes arrays.

What's the significance of "150 uV Pk-Pk"?

~Dan

No that conversion isn't quite sufficient because of the 150 microvolt Peak to Peak range to which the U16 array needs to be mapped: ie a 0 U16 needs to equal -75 microvolts while a 65535 needs to equal +75 microvolts.

Now the trick in this is that I'm actually mapping an ASCII string to U8s then reversing the hi/low bytes to get the U16s so maybe someone knows of an even better way to go directly from the ASCII to DBLs that map to +/- 75 uV (ie 150 uV peak to peak).

Here's my approach...

~Dan

QUOTE (B Chavez @ Oct 10 2008, 07:37 PM)

I think that will work but is there no way to do this without using the division?

QUOTE (Val Brown @ Oct 10 2008, 07:57 PM)

I think that will work but is there no way to do this without using the division?

I'm no math wiz, but my first thought is that if you need scaling, you've gotta multiply or divide. I'd be interested if someone has another way.

QUOTE (B Chavez @ Oct 11 2008, 09:48 AM)

I'm no math wiz, but my first thought is that if you need scaling, you've gotta multiply or divide. I'd be interested if someone has another way.

Yes, that's why I was posting this as I was starting from the same point of view but thinking/hoping that there might be some native function or primitive that I wasn't aware of that might work more effectively/efficiently.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.