Filter löschen
Filter löschen

Calculate the memory size the acquired data takes

2 Ansichten (letzte 30 Tage)
xiaobo wu
xiaobo wu am 11 Apr. 2014
Kommentiert: xiaobo wu am 14 Apr. 2014
Here is a simple data acquisition code:
ai=analoginput('winsound');
addchannel(ai,1);
rate=setverify(ai,'SampleRate',8000);
set(ai,'SamplesPerTrigger',8000);
set(ai,'TriggerType','Immediate');
1. daqmem(ai);
start(ai)
2. daqmem(ai)
stop (ai)
delete ai
clear ai
*1. daqmem(ai): I execute daqmem here, I get:
winsound0-AI
UsedBytes = 30.00 KB
MaxBytes = 1024.00 MB
2. daqmem(ai): I get:
winsound0-AI
UsedBytes = 16.00 KB
MaxBytes = 1024.00 MB*
UsedBytes =30.00KB, what used the memory?
UsedBytes = 16.00 KB, I know it is acquired data, but the totoal number is 8000, which is double type, how to correspond 8000 to 16 KB?

Antworten (1)

Walter Roberson
Walter Roberson am 12 Apr. 2014
As speculation: before you have done the start() the internal buffer would be the default, which might be 30 KB. In some ways it makes sense to delay re-sizing the buffer until the next start(), just in case the buffer gets resized yet again (e.g., more channels added.)
winsound normally works internally at 16 bits (2 bytes) per channel, so 8000 samples corresponds to 16000 bytes.
  1 Kommentar
xiaobo wu
xiaobo wu am 14 Apr. 2014
I am using Dataq hardware DI-148U for data acquisition. I also get the data with 16 bits (2 bytes). Is it feasible to exchange 16 bits and 32 bits? Thank you

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Simultaneous and Synchronized Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by