]> git.parisson.com Git - cnaq.git/commitdiff
* Add 8 channels
authoryomguy <yomguy@5fc3e0e6-29bc-4d03-b52b-c088cb822bde>
Tue, 8 Apr 2008 14:20:14 +0000 (14:20 +0000)
committeryomguy <yomguy@5fc3e0e6-29bc-4d03-b52b-c088cb822bde>
Tue, 8 Apr 2008 14:20:14 +0000 (14:20 +0000)
* Create an Analysis box

git-svn-id: http://svn.parisson.org/svn/CNAQ/trunk@176 5fc3e0e6-29bc-4d03-b52b-c088cb822bde

CNAQ.fig
CNAQ.m
tools/get_voices_in.m [deleted file]
tools/get_voices_out.m [deleted file]
tools/measurement.m

index 2a84be1457d75d24e865b51dfb19ed4379fe9bb8..d4f963f0bec572c7cd3714afea84a0d6cfc1baa2 100644 (file)
Binary files a/CNAQ.fig and b/CNAQ.fig differ
diff --git a/CNAQ.m b/CNAQ.m
index f63438b940c9340e48eb48fe4a59a99ecc575d45..d52b03b704e3978794f79b51dadd1c74c9a791d7 100644 (file)
--- a/CNAQ.m
+++ b/CNAQ.m
@@ -34,7 +34,7 @@ function varargout = CNAQ(varargin)
 \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
@@ -166,8 +166,8 @@ set(handles.f_s,'String','44100|48000|88200|96000|192000');
 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
@@ -248,16 +248,16 @@ function gain_out_CreateFcn(hObject, eventdata, handles)
         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
diff --git a/tools/get_voices_in.m b/tools/get_voices_in.m
deleted file mode 100644 (file)
index 33e1eab..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-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
diff --git a/tools/get_voices_out.m b/tools/get_voices_out.m
deleted file mode 100644 (file)
index 0dd1f4f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-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
index 9be2f259e028a559407bcaef559436054b69bc81..471f67441feabb56285d6656d1ae863622c39da9 100644 (file)
@@ -1,19 +1,23 @@
 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);
     
@@ -50,14 +54,14 @@ function measurement(handles)
     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],