beautypg.com

Data processing, Data packing (wavebook/512 only) – Measurement Computing WaveBook rev.3.0 User Manual

Page 150

background image

8-16 Theory of Operation,

6-24-99

WaveBook User’s Manual

Data Processing

Data Packing (WaveBook/512 Only)

WaveBook/512 requires up to 2 bytes to transfer each sample (sampling at 500K samples/sec, data must be
transferred to the PC at 1 Mbyte/sec). Normally, WaveBook/512 transfers each 12-bit sample as a 16-bit
word. However, to increase transfer efficiency from 75% to 100%, four 12-bit samples can be packed into
three 16-bit words. This data packing reduces the number of data words to be transferred, and the effective
transfer rate will be 4/3 higher—useful with slow PCs and fast acquisitions.

Note:

With WaveBook/516, each 16-bit sample uses exactly 2 bytes. Data packing is not available, and
sustained high transfer rates are a function of PC architecture.

Advantages of packed data are:

Less Data to Transfer (faster effective rate): Transferring 3 words instead of 4 from WaveBook/512

to the PC reduces the transfer time similarly—25% shorter time. A PC's 800 KB/sec EPP port without
packing can acquire data up to 400 Ksamples/sec; but with packing, the rate will increase to 533
Ksamples/sec—33% faster rate, 4 samples instead of 3.

Less Data to Store: Packed data taking fewer words effectively increases the buffer size for more

samples. For example, the 65536-word internal data buffer in WaveBook/512 can hold 87380 samples
of packed data instead of only 65536 samples of unpacked data. Similarly, the PC's memory is used
more efficiently when storing packed data.

Less Data to Archive: Storing packed data to disk is both faster (because there are fewer words to

transfer) and more economical (the disk files are smaller) than with unpacked data.

Disadvantages of packed data are:

Extra Processing Steps: The packed data must be unpacked before it can be interpreted, increasing

the complexity of programs that use packed data.

Loss of Resolution: Although WaveBook/512 is a 12-bit device, it uses 16-bit arithmetic internally to

compensate the digitized data. Rounding these results to 12 bits, so they can be packed, slightly
reduces the accuracy (by much less than ½ LSB on average).

Special Cases: If an acquisition is not a multiple of 4 samples long, then the last 3-word packed data

group will only be partially filled with the final sample(s). These end conditions must be taken into
account when directly processing packed data.

Bits

Word

15-12

11-0

1

1L

Sample 2

2

1M

Sample 3

3

1H

Sample 4

The packed-data format packs four 12-bit samples into three 16-bit
words
. The first sample is broken into three 4-bit nibbles, H, M, and L,
where H is the most-significant (high) nibble, M is the middle nibble, and L
is the least-significant (low) nibble. These 3 nibbles are then combined with
the three subsequent samples to form three 16-bit words (see table). The
daqAdcSetDataFormat

function is used to enable/disable data packing.

The next figure shows how 4 scans of 3 samples each are transferred to the PC. If data packing is not used
(first diagram), each of the 12 samples occupies a separate 16-bit word of memory. If data packing is used
(second diagram), the samples are packed into 9 words without regard for the scan boundaries. Each group
of 3 words includes 4 consecutive samples that may come from more than one scan.

s

c

a

n
1
s

a

m

p

l

e
1

s

c

a

n
1
s

a

m

p

l

e
2

s

c

a

n
1
s

a

m

p

l

e
2

s

c

a

n
1
s

a

m

p

l

e
3

s

c

a

n
1
s

a

m

p

l

e
3

s

c

a

n
2
s

a

m

p

l

e
1

s

c

a

n
2
s

a

m

p

l

e
1

s

c

a

n
2
s

a

m

p

l

e
2

s

c

a

n
2
s

a

m

p

l

e
3

s

c

a

n
2
s

a

m

p

l

e
3

s

c

a

n
3
s

a

m

p

l

e
1

s

c

a

n
3
s

a

m

p

l

e
1

s

c

a

n
3
s

a

m

p

l

e
2

s

c

a

n
3
s

a

m

p

l

e
2

s

c

a

n
3
s

a

m

p

l

e
3

s

c

a

n
4
s

a

m

p

l

e
1

s

c

a

n
4
s

a

m

p

l

e
1

s

c

a

n
4
s

a

m

p

l

e
2

s

c

a

n
4
s

a

m

p

l

e
2

s

c

a

n
4
s

a

m

p

l

e
3

s

c

a

n
4
s

a

m

p

l

e
3

scan 1
sample 1

scan 3
sample 3

scan 2

sample 2

12 words

9 words

Each 16-bit word holds 12 bits of data

12 words × 12 bits/word = 144 bits

Each 16-bit word holds 16 bits of data

9

(same amount of data in 25% less space)

words × 16 bits/word = 144 bits

Data Packing

1 2 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9

12 bits

(used)

16 bits
(used)

4 bits

(empty)

Unpacked Buffer - 4 scans of 3 samples

Packed Buffer - 4 scans of 3 samples