\r
% Author: Guillaume Pellerin <guillaume.pellerin@cnam.fr>\r
\r
-% Last Modified by GUIDE v2.5 12-Jan-2008 11:35:34\r
+% Last Modified by GUIDE v2.5 08-Apr-2008 16:23:22
\r
% CNAQ, by itself, creates a new CNAQ or raises the existing\r
% singleton*.\r
set(handles.in_on_off,'Value',0);\r
set(handles.gen_on_off,'Value',0);\r
set(handles.sig_type,'String','Sinus|Chirp|White noise|Pink noise');\r
-set(handles.voices_in,'String','1|1 2|1 2 3|1 2 3 4');\r
-set(handles.voices_out,'String','1|1 2|1 2 3|1 2 3 4');\r
+set(handles.channels_in,'String','1|1 2|1 2 3|1 2 3 4|1 2 3 4 5 6 7 8');\r
+set(handles.channels_out,'String','1|1 2|1 2 3|1 2 3 4|1 2 3 4 5 6 7 8');\r
\r
set(handles.mes_type,'String','Transfert function|Impulse response');\r
set(handles.in_on_off,'UserData',device);\r
set(hObject,'BackgroundColor',[.9 .9 .9]);\r
end\r
\r
-function voices_in_Callback(hObject, eventdata, handles)\r
+function channels_in_Callback(hObject, eventdata, handles)\r
\r
-function voices_in_CreateFcn(hObject, eventdata, handles)\r
+function channels_in_CreateFcn(hObject, eventdata, handles)\r
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))\r
set(hObject,'BackgroundColor','white');\r
end\r
\r
-function voices_out_Callback(hObject, eventdata, handles)\r
+function channels_out_Callback(hObject, eventdata, handles)\r
\r
-function voices_out_CreateFcn(hObject, eventdata, handles)\r
+function channels_out_CreateFcn(hObject, eventdata, handles)\r
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))\r
set(hObject,'BackgroundColor','white');\r
end\r
+++ /dev/null
-function voices_in = get_voices_in(handles)
-
- vi_ind = get(handles.voices_in,'Value');
- if vi_ind == 1
- voices_in = [1];
- elseif vi_ind == 2
- voices_in = [1 2];
- elseif vi_ind == 3
- voices_in = [1 2 3];
- elseif vi_ind == 4
- voices_in = [1 2 3 4];
- end
-
-end
\ No newline at end of file
+++ /dev/null
-function voices_out = get_voices_out(handles)
-
- vo_ind = get(handles.voices_out,'Value');
- if vo_ind == 1
- voices_out = [1];
- elseif vo_ind == 2
- voices_out = [1,2];
- elseif vo_ind == 3
- voices_out = [1,2,3];
- elseif vo_ind == 4
- voices_out = [1,2,3,4];
- end
-
-end
\ No newline at end of file
function measurement(handles)
+ % Init
pause(0.2);
device = get(handles.in_on_off,'UserData');
latency = get(handles.save_button,'UserData');
+
nfft = 32768;
f_min = str2double(get(handles.f_gen_min,'String'));
f_max = str2double(get(handles.f_gen_max,'String'));
+ time = get(handles.time_gen,'Value');
fs_id = get(handles.f_s,'Value');
- nb_id = get(handles.nbits,'Value');
f_s = get_fs(fs_id);
+ nb_id = get(handles.nbits,'Value');
nbits = get_nbits(nb_id);
- time = get(handles.time_gen,'Value');
- voices_in = get_voices_in(handles);
- voice_first = voices_in(1);
- voice_last = voices_in(length(voices_in));
+ ch_in_id = get(handles.channels_in,'Value');
+ channels_in = get_channels_in(ch_in_id);
+ channel_first = channels_in(1);
+ channel_last = channels_in(length(channels_in));
+
gain_out = get(handles.gain_out,'Value');
gain_out = 10^(gain_out/20);
sig_exc_z = [sig_exc zero];
len_sig_exc = length(sig_exc);
- % Make all voices
+ % Init all channels
sig_out = [];
- for i=1:length(voices_in)
+ for i=1:length(channels_in)
sig_out(:,i) = sig_exc_z';
end
% Measure
- sig_mes = pa_wavplayrecord(sig_out, device, f_s, 0, voice_first, voice_last, device, 'asio');
+ sig_mes = pa_wavplayrecord(sig_out, device, f_s, 0, channel_first, channel_last, device, 'asio');
% Usage:
% inputbuffer = pa_wavplayrecord(playbuffer,[playdevice],[samplerate],
% [recnsamples], [recfirstchannel], [reclastchannel],