|
- AI = analoginput('winsound');
- addchannel(AI,1);
- duration = 10;
- ActualRate = get(AI,'SampleRate');
- set(AI,'SamplesPerTrigger',duration*ActualRate);
- figure
- set(gcf,'doublebuffer','on');
- P = plot(zeros(1000,1));
- T = title([sprintf('Peekdata calls:'),num2str(0)]);
- xlabel('Samples'); axis([0 1000 -.01 .01]),grid on
- start(AI);
- k = 1;
- while AI.SamplesAcquired <AI.SamplesPerTrigger
- while AI.SamplesAcquired<1000*k
- end
- data = peekdata(AI,1000);
- set(P,'ydata',data);
- set(T,'String',[sprintf('Peekdata calls:'),num2str(k)]);
- drawnow
- k = k+1;
- end
- waittilstop(AI,2);
- delete(AI);
- clear AI;
复制代码
以上是来自萝卜驿站的一个关于采集系统的程序,对象是声卡
其中data就是采集下来的某一时段数据
你可以用save、fwrite之类的命令保存就行了,和普通数据一样
具体采用什么格式看你自己的选择了 |
评分
-
1
查看全部评分
-
|