Borrar filtros
Borrar filtros

Calculate the memory size the acquired data takes

2 visualizaciones (últimos 30 días)
xiaobo wu
xiaobo wu el 11 de Abr. de 2014
Comentada: xiaobo wu el 14 de Abr. de 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?

Respuestas (1)

Walter Roberson
Walter Roberson el 12 de Abr. de 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 comentario
xiaobo wu
xiaobo wu el 14 de Abr. de 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

Iniciar sesión para comentar.

Categorías

Más información sobre Simultaneous and Synchronized Operations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by