Val Brown Posted October 12, 2008 Report Share Posted October 12, 2008 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. Quote Link to comment
Dan DeFriese Posted October 12, 2008 Report Share Posted October 12, 2008 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 Link to comment
Val Brown Posted October 12, 2008 Author Report Share Posted October 12, 2008 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). Quote Link to comment
B Chavez Posted October 12, 2008 Report Share Posted October 12, 2008 I think this is what you're after. Download File:post-1591-1223692606.vi Quote Link to comment
Dan DeFriese Posted October 12, 2008 Report Share Posted October 12, 2008 Here's my approach... ~Dan Quote Link to comment
Val Brown Posted October 12, 2008 Author Report Share Posted October 12, 2008 QUOTE (B Chavez @ Oct 10 2008, 07:37 PM) I think this is what you're after.http://lavag.org/old_files/post-1591-1223692606.vi'>Download File:post-1591-1223692606.vi I think that will work but is there no way to do this without using the division? Quote Link to comment
B Chavez Posted October 12, 2008 Report Share Posted October 12, 2008 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 Link to comment
Val Brown Posted October 12, 2008 Author Report Share Posted October 12, 2008 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. Quote Link to comment
TobyD Posted October 14, 2008 Report Share Posted October 14, 2008 QUOTE (Val Brown @ Oct 10 2008, 05:39 PM) I'm trying to figure out the best way to convert U16 array to an array of DBL 150 uV Peak to Peak. I would run your Array through an interpolation table (and add units if desired). This makes calibrating your hardware simple by manually measuring a series of points and adding them to the cluster array. The VI I posted assumes a linear interpolation from 0 to 65535. Download File:post-8758-1223914426.vi Saved in 8.6 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.