Effacer les filtres
Effacer les filtres

Calculate the memory size the acquired data takes

2 vues (au cours des 30 derniers jours)
xiaobo wu
xiaobo wu le 11 Avr 2014
Commenté : xiaobo wu le 14 Avr 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?

Réponses (1)

Walter Roberson
Walter Roberson le 12 Avr 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 commentaire
xiaobo wu
xiaobo wu le 14 Avr 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

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simultaneous and Synchronized Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by