필터 지우기
필터 지우기

Calculate the memory size the acquired data takes

조회 수: 2 (최근 30일)
xiaobo wu
xiaobo wu 2014년 4월 11일
댓글: xiaobo wu 2014년 4월 14일
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?

답변 (1개)

Walter Roberson
Walter Roberson 2014년 4월 12일
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
xiaobo wu
xiaobo wu 2014년 4월 14일
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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simultaneous and Synchronized Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by