这是我的声卡采集,以及处理函数.
global a1 %a1是采样率;a2是采样数据的长度;a3选定的窗函数模型;
global a2 %a4是滤波模式;%a5是滤波类型;
global a3 %a6是fp; a7是fs; a8是通带波纹;a9是阻带衰减
global a4
global a5
global a6
global a7
global a8
global a9
AI = analoginput('winsound');
%2. Add channels - Add one channel to AI.
chan = addchannel(AI,1);
%3. Configure property values - Assign values to the basic setup properties, and
%create the variables blocksize and Fs, which are used for subsequent analysis.
%The actual sampling rate is retrieved since it may be set by the engine to a
%value that differs from the specified value.
set(AI,'SampleRate',a1); % 设置采样速率为?Hz
ActualRate = get(AI,'SampleRate'); % 从AI中获取实际采样速率
set(AI,'TriggerChannel',chan); % 设置触发通道
set(AI,'TriggerType','software'); % 设置触发类型
set(AI,'Triggercondition','rising'); % 设置为电压上升至某值后触发
set(AI,'TriggerConditionValue',0.0008); % 设置触发电压值
set(AI, 'TriggerDelay',-1); % 设置触发时延
set(AI, 'TriggerDelayUnits', 'seconds'