Mercurial > hg > ltpda
comparison m-toolbox/classes/@sigBuilder/cb_drawControls.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % CB_DRAWCONTROLS draws the user controls depending on which signal type is | |
2 % selected. | |
3 % | |
4 % M Hewitson | |
5 % | |
6 % $Id: cb_drawControls.m,v 1.1 2008/10/19 11:42:40 hewitson Exp $ | |
7 % | |
8 | |
9 function cb_drawControls(varargin) | |
10 | |
11 % Settings | |
12 hmarg = 0.01; | |
13 vmarg = 0.02; | |
14 commHeight = 0.08; | |
15 | |
16 % Get selected signal type | |
17 sigType = varargin{2}; | |
18 % main figure | |
19 mainfig = varargin{1}; | |
20 % Panel to draw on | |
21 pan = findobj(mainfig.handle, 'Tag', 'ControlsPanel'); | |
22 | |
23 % Delete all children | |
24 delete(get(pan, 'Children')) | |
25 drawnow | |
26 | |
27 % Draw the requested controls | |
28 switch lower(sigType) | |
29 case 'sine wave' | |
30 draw_Sine_Wave(pan,mainfig,commHeight,hmarg,vmarg); | |
31 case 'white noise' | |
32 draw_WhiteNoise(pan,mainfig,commHeight,hmarg,vmarg); | |
33 case 'chirp' | |
34 draw_Chirp(pan,mainfig,commHeight,hmarg,vmarg); | |
35 case 'gaussian pulse' | |
36 draw_GaussPulse(pan,mainfig,commHeight,hmarg,vmarg); | |
37 case 'square wave' | |
38 draw_SquareWave(pan,mainfig,commHeight,hmarg,vmarg); | |
39 case 'sawtooth' | |
40 draw_Sawtooth(pan,mainfig,commHeight,hmarg,vmarg); | |
41 case 'noise generator' | |
42 draw_NoiseGenerator(pan,mainfig,commHeight,hmarg,vmarg); | |
43 case 'polynomial' | |
44 draw_Polynomial(pan,mainfig,commHeight,hmarg,vmarg); | |
45 case 'custom' | |
46 draw_Custom(pan,mainfig,commHeight,hmarg,vmarg); | |
47 otherwise | |
48 warning('!!! No controls for signal type: %s', sigType); | |
49 end | |
50 | |
51 end | |
52 | |
53 %-------------------------------------------------------------------------- | |
54 % Draw controls for a polynomial | |
55 % | |
56 function draw_Polynomial(pan,mainfig,commHeight,hmarg,vmarg) | |
57 | |
58 Lwidth = 0.25; | |
59 Ewidth = 0.65; | |
60 h = commHeight; | |
61 | |
62 %--- Coeffs | |
63 | |
64 l = hmarg; | |
65 b = 1-2*vmarg-h; | |
66 sth = uicontrol(pan, 'Style','text',... | |
67 'String', 'Coeffs',... | |
68 'Units', 'normalized', ... | |
69 'HorizontalAlignment', 'right',... | |
70 'BackgroundColor', 'w', ... | |
71 'Fontsize', mainfig.Gproperties.fontsize, ... | |
72 'Position',[l b Lwidth h]); | |
73 | |
74 % edit box | |
75 l = l + Lwidth + hmarg; | |
76 clsh = uicontrol(pan, ... | |
77 'Style', 'edit', ... | |
78 'Units', 'normalized',... | |
79 'Fontsize', mainfig.Gproperties.fontsize, ... | |
80 'BackgroundColor', 'w', ... | |
81 'String', '1', ... | |
82 'Position', [l b Ewidth h],... | |
83 'Tag', 'Poly_Coeffs', ... | |
84 'Tooltip', 'Polynomial coefficients'); | |
85 | |
86 % nsecs | |
87 l = hmarg; | |
88 b = b - h - 2*vmarg; | |
89 sth = uicontrol(pan, 'Style','text',... | |
90 'String', 'Length [s]',... | |
91 'Units', 'normalized', ... | |
92 'HorizontalAlignment', 'right',... | |
93 'BackgroundColor', 'w', ... | |
94 'Fontsize', mainfig.Gproperties.fontsize, ... | |
95 'Position',[l b Lwidth h]); | |
96 | |
97 % edit box | |
98 l = l + Lwidth + hmarg; | |
99 sth = uicontrol(pan, 'Style','edit',... | |
100 'String', '1',... | |
101 'Units', 'normalized', ... | |
102 'BackgroundColor', 'w', ... | |
103 'Fontsize', mainfig.Gproperties.fontsize, ... | |
104 'Position',[l b Ewidth h], ... | |
105 'Tag', 'Poly_Length',... | |
106 'Tooltip', 'Length of signal in seconds'); | |
107 | |
108 | |
109 end | |
110 | |
111 %-------------------------------------------------------------------------- | |
112 % Draw controls for a custom f(t) | |
113 % | |
114 function draw_Custom(pan,mainfig,commHeight,hmarg,vmarg) | |
115 | |
116 Lwidth = 0.25; | |
117 Ewidth = 0.65; | |
118 h = commHeight; | |
119 | |
120 %--- Fcn | |
121 | |
122 l = hmarg; | |
123 b = 1-2*vmarg-h; | |
124 sth = uicontrol(pan, 'Style','text',... | |
125 'String', 'F(t)',... | |
126 'Units', 'normalized', ... | |
127 'HorizontalAlignment', 'right',... | |
128 'BackgroundColor', 'w', ... | |
129 'Fontsize', mainfig.Gproperties.fontsize, ... | |
130 'Position',[l b Lwidth h]); | |
131 | |
132 % edit box | |
133 l = l + Lwidth + hmarg; | |
134 clsh = uicontrol(pan, ... | |
135 'Style', 'edit', ... | |
136 'Units', 'normalized',... | |
137 'Fontsize', mainfig.Gproperties.fontsize, ... | |
138 'BackgroundColor', 'w', ... | |
139 'String', 't', ... | |
140 'Position', [l b Ewidth h],... | |
141 'Tag', 'Custom_Fcn', ... | |
142 'Tooltip', 'A valid MATLAB function of the variable ''t'''); | |
143 | |
144 % nsecs | |
145 l = hmarg; | |
146 b = b - h - 2*vmarg; | |
147 sth = uicontrol(pan, 'Style','text',... | |
148 'String', 'Length [s]',... | |
149 'Units', 'normalized', ... | |
150 'HorizontalAlignment', 'right',... | |
151 'BackgroundColor', 'w', ... | |
152 'Fontsize', mainfig.Gproperties.fontsize, ... | |
153 'Position',[l b Lwidth h]); | |
154 | |
155 % edit box | |
156 l = l + Lwidth + hmarg; | |
157 sth = uicontrol(pan, 'Style','edit',... | |
158 'String', '1',... | |
159 'Units', 'normalized', ... | |
160 'BackgroundColor', 'w', ... | |
161 'Fontsize', mainfig.Gproperties.fontsize, ... | |
162 'Position',[l b Ewidth h], ... | |
163 'Tag', 'Custom_Length',... | |
164 'Tooltip', 'Length of signal in seconds'); | |
165 | |
166 | |
167 end | |
168 | |
169 %-------------------------------------------------------------------------- | |
170 % Draw controls for a noise generation | |
171 % | |
172 function draw_NoiseGenerator(pan,mainfig,commHeight,hmarg,vmarg) | |
173 | |
174 Lwidth = 0.25; | |
175 Ewidth = 0.65; | |
176 h = commHeight; | |
177 | |
178 %--- Gains | |
179 | |
180 l = hmarg; | |
181 b = 1-2*vmarg-h; | |
182 sth = uicontrol(pan, 'Style','text',... | |
183 'String', 'Gain',... | |
184 'Units', 'normalized', ... | |
185 'HorizontalAlignment', 'right',... | |
186 'BackgroundColor', 'w', ... | |
187 'Fontsize', mainfig.Gproperties.fontsize, ... | |
188 'Position',[l b Lwidth h]); | |
189 | |
190 % edit box | |
191 l = l + Lwidth + hmarg; | |
192 clsh = uicontrol(pan, ... | |
193 'Style', 'edit', ... | |
194 'Units', 'normalized',... | |
195 'Fontsize', mainfig.Gproperties.fontsize, ... | |
196 'BackgroundColor', 'w', ... | |
197 'String', '1', ... | |
198 'Position', [l b Ewidth h],... | |
199 'Tag', 'NoiseGen_Gain', ... | |
200 'Tooltip', 'Overall Gain'); | |
201 | |
202 | |
203 % Poles | |
204 l = hmarg; | |
205 b = b - h - 2*vmarg; | |
206 sth = uicontrol(pan, 'Style','text',... | |
207 'String', 'Poles',... | |
208 'Units', 'normalized', ... | |
209 'HorizontalAlignment', 'right',... | |
210 'BackgroundColor', 'w', ... | |
211 'Fontsize', mainfig.Gproperties.fontsize, ... | |
212 'Position',[l b Lwidth h]); | |
213 | |
214 l = l + Lwidth + hmarg; | |
215 sth = uicontrol(pan, 'Style','edit',... | |
216 'String', '{1,1}',... | |
217 'Units', 'normalized', ... | |
218 'BackgroundColor', 'w', ... | |
219 'Fontsize', mainfig.Gproperties.fontsize, ... | |
220 'Position',[l b Ewidth h], ... | |
221 'Tag', 'NoiseGen_Poles',... | |
222 'Tooltip', 'Pole Frequencies (and Q''s). (help pzmodel)'); | |
223 | |
224 % Poles | |
225 l = hmarg; | |
226 b = b - h - 2*vmarg; | |
227 sth = uicontrol(pan, 'Style','text',... | |
228 'String', 'Zeros',... | |
229 'Units', 'normalized', ... | |
230 'HorizontalAlignment', 'right',... | |
231 'BackgroundColor', 'w', ... | |
232 'Fontsize', mainfig.Gproperties.fontsize, ... | |
233 'Position',[l b Lwidth h]); | |
234 | |
235 l = l + Lwidth + hmarg; | |
236 sth = uicontrol(pan, 'Style','edit',... | |
237 'String', '10',... | |
238 'Units', 'normalized', ... | |
239 'BackgroundColor', 'w', ... | |
240 'Fontsize', mainfig.Gproperties.fontsize, ... | |
241 'Position',[l b Ewidth h], ... | |
242 'Tag', 'NoiseGen_Zeros',... | |
243 'Tooltip', 'Zero Frequencies (and Q''s). (help pzmodel)'); | |
244 | |
245 % nsecs | |
246 l = hmarg; | |
247 b = b - h - 2*vmarg; | |
248 sth = uicontrol(pan, 'Style','text',... | |
249 'String', 'Length [s]',... | |
250 'Units', 'normalized', ... | |
251 'HorizontalAlignment', 'right',... | |
252 'BackgroundColor', 'w', ... | |
253 'Fontsize', mainfig.Gproperties.fontsize, ... | |
254 'Position',[l b Lwidth h]); | |
255 | |
256 % edit box | |
257 l = l + Lwidth + hmarg; | |
258 sth = uicontrol(pan, 'Style','edit',... | |
259 'String', '1',... | |
260 'Units', 'normalized', ... | |
261 'BackgroundColor', 'w', ... | |
262 'Fontsize', mainfig.Gproperties.fontsize, ... | |
263 'Position',[l b Ewidth h], ... | |
264 'Tag', 'NoiseGen_Length',... | |
265 'Tooltip', 'Length of signal in seconds'); | |
266 | |
267 | |
268 end | |
269 | |
270 %-------------------------------------------------------------------------- | |
271 % Draw controls for a sawtooth | |
272 % | |
273 function draw_Sawtooth(pan,mainfig,commHeight,hmarg,vmarg) | |
274 | |
275 Lwidth = 0.25; | |
276 Ewidth = 0.65; | |
277 h = commHeight; | |
278 | |
279 %--- F | |
280 | |
281 l = hmarg; | |
282 b = 1-2*vmarg-h; | |
283 sth = uicontrol(pan, 'Style','text',... | |
284 'String', 'Frequency [Hz]',... | |
285 'Units', 'normalized', ... | |
286 'HorizontalAlignment', 'right',... | |
287 'BackgroundColor', 'w', ... | |
288 'Fontsize', mainfig.Gproperties.fontsize, ... | |
289 'Position',[l b Lwidth h]); | |
290 | |
291 % edit box | |
292 l = l + Lwidth + hmarg; | |
293 clsh = uicontrol(pan, ... | |
294 'Style', 'edit', ... | |
295 'Units', 'normalized',... | |
296 'Fontsize', mainfig.Gproperties.fontsize, ... | |
297 'BackgroundColor', 'w', ... | |
298 'String', '0', ... | |
299 'Position', [l b Ewidth h],... | |
300 'Tag', 'Sawtooth_F', ... | |
301 'Tooltip', 'Frequency [Hz] (help sawtooth)'); | |
302 | |
303 | |
304 % Width | |
305 l = hmarg; | |
306 b = b - h - 2*vmarg; | |
307 sth = uicontrol(pan, 'Style','text',... | |
308 'String', 'Width [0-1]',... | |
309 'Units', 'normalized', ... | |
310 'HorizontalAlignment', 'right',... | |
311 'BackgroundColor', 'w', ... | |
312 'Fontsize', mainfig.Gproperties.fontsize, ... | |
313 'Position',[l b Lwidth h]); | |
314 | |
315 l = l + Lwidth + hmarg; | |
316 sth = uicontrol(pan, 'Style','edit',... | |
317 'String', '1',... | |
318 'Units', 'normalized', ... | |
319 'BackgroundColor', 'w', ... | |
320 'Fontsize', mainfig.Gproperties.fontsize, ... | |
321 'Position',[l b Ewidth h], ... | |
322 'Tag', 'Sawtooth_Width',... | |
323 'Tooltip', 'Width [0-1] (help sawtooth)'); | |
324 | |
325 % nsecs | |
326 l = hmarg; | |
327 b = b - h - 2*vmarg; | |
328 sth = uicontrol(pan, 'Style','text',... | |
329 'String', 'Length [s]',... | |
330 'Units', 'normalized', ... | |
331 'HorizontalAlignment', 'right',... | |
332 'BackgroundColor', 'w', ... | |
333 'Fontsize', mainfig.Gproperties.fontsize, ... | |
334 'Position',[l b Lwidth h]); | |
335 | |
336 % edit box | |
337 l = l + Lwidth + hmarg; | |
338 sth = uicontrol(pan, 'Style','edit',... | |
339 'String', '1',... | |
340 'Units', 'normalized', ... | |
341 'BackgroundColor', 'w', ... | |
342 'Fontsize', mainfig.Gproperties.fontsize, ... | |
343 'Position',[l b Ewidth h], ... | |
344 'Tag', 'Sawtooth_Length',... | |
345 'Tooltip', 'Length of signal in seconds'); | |
346 | |
347 | |
348 end | |
349 | |
350 %-------------------------------------------------------------------------- | |
351 % Draw controls for a square wave | |
352 % | |
353 function draw_SquareWave(pan,mainfig,commHeight,hmarg,vmarg) | |
354 | |
355 Lwidth = 0.25; | |
356 Ewidth = 0.65; | |
357 h = commHeight; | |
358 | |
359 %--- F | |
360 | |
361 l = hmarg; | |
362 b = 1-2*vmarg-h; | |
363 sth = uicontrol(pan, 'Style','text',... | |
364 'String', 'Frequency [Hz]',... | |
365 'Units', 'normalized', ... | |
366 'HorizontalAlignment', 'right',... | |
367 'BackgroundColor', 'w', ... | |
368 'Fontsize', mainfig.Gproperties.fontsize, ... | |
369 'Position',[l b Lwidth h]); | |
370 | |
371 % edit box | |
372 l = l + Lwidth + hmarg; | |
373 clsh = uicontrol(pan, ... | |
374 'Style', 'edit', ... | |
375 'Units', 'normalized',... | |
376 'Fontsize', mainfig.Gproperties.fontsize, ... | |
377 'BackgroundColor', 'w', ... | |
378 'String', '0', ... | |
379 'Position', [l b Ewidth h],... | |
380 'Tag', 'SquareWave_F', ... | |
381 'Tooltip', 'Frequency [Hz]'); | |
382 | |
383 | |
384 % Duty | |
385 l = hmarg; | |
386 b = b - h - 2*vmarg; | |
387 sth = uicontrol(pan, 'Style','text',... | |
388 'String', 'Duty Cycle [%]',... | |
389 'Units', 'normalized', ... | |
390 'HorizontalAlignment', 'right',... | |
391 'BackgroundColor', 'w', ... | |
392 'Fontsize', mainfig.Gproperties.fontsize, ... | |
393 'Position',[l b Lwidth h]); | |
394 | |
395 l = l + Lwidth + hmarg; | |
396 sth = uicontrol(pan, 'Style','edit',... | |
397 'String', '1',... | |
398 'Units', 'normalized', ... | |
399 'BackgroundColor', 'w', ... | |
400 'Fontsize', mainfig.Gproperties.fontsize, ... | |
401 'Position',[l b Ewidth h], ... | |
402 'Tag', 'SquareWave_Duty',... | |
403 'Tooltip', 'Duty Cycle [%]'); | |
404 | |
405 % nsecs | |
406 l = hmarg; | |
407 b = b - h - 2*vmarg; | |
408 sth = uicontrol(pan, 'Style','text',... | |
409 'String', 'Length [s]',... | |
410 'Units', 'normalized', ... | |
411 'HorizontalAlignment', 'right',... | |
412 'BackgroundColor', 'w', ... | |
413 'Fontsize', mainfig.Gproperties.fontsize, ... | |
414 'Position',[l b Lwidth h]); | |
415 | |
416 % edit box | |
417 l = l + Lwidth + hmarg; | |
418 sth = uicontrol(pan, 'Style','edit',... | |
419 'String', '1',... | |
420 'Units', 'normalized', ... | |
421 'BackgroundColor', 'w', ... | |
422 'Fontsize', mainfig.Gproperties.fontsize, ... | |
423 'Position',[l b Ewidth h], ... | |
424 'Tag', 'SquareWave_Length',... | |
425 'Tooltip', 'Length of signal in seconds'); | |
426 | |
427 | |
428 end | |
429 | |
430 %-------------------------------------------------------------------------- | |
431 % Draw controls for a gaussian pulse | |
432 % | |
433 function draw_GaussPulse(pan,mainfig,commHeight,hmarg,vmarg) | |
434 | |
435 Lwidth = 0.25; | |
436 Ewidth = 0.65; | |
437 h = commHeight; | |
438 | |
439 %--- F0 | |
440 | |
441 l = hmarg; | |
442 b = 1-2*vmarg-h; | |
443 sth = uicontrol(pan, 'Style','text',... | |
444 'String', 'F0 [Hz]',... | |
445 'Units', 'normalized', ... | |
446 'HorizontalAlignment', 'right',... | |
447 'BackgroundColor', 'w', ... | |
448 'Fontsize', mainfig.Gproperties.fontsize, ... | |
449 'Position',[l b Lwidth h]); | |
450 | |
451 % edit box | |
452 l = l + Lwidth + hmarg; | |
453 clsh = uicontrol(pan, ... | |
454 'Style', 'edit', ... | |
455 'Units', 'normalized',... | |
456 'Fontsize', mainfig.Gproperties.fontsize, ... | |
457 'BackgroundColor', 'w', ... | |
458 'String', '0', ... | |
459 'Position', [l b Ewidth h],... | |
460 'Tag', 'GPulse_F0', ... | |
461 'Tooltip', 'Center Frequency [Hz]'); | |
462 | |
463 | |
464 % BW | |
465 l = hmarg; | |
466 b = b - h - 2*vmarg; | |
467 sth = uicontrol(pan, 'Style','text',... | |
468 'String', 'BW',... | |
469 'Units', 'normalized', ... | |
470 'HorizontalAlignment', 'right',... | |
471 'BackgroundColor', 'w', ... | |
472 'Fontsize', mainfig.Gproperties.fontsize, ... | |
473 'Position',[l b Lwidth h]); | |
474 | |
475 l = l + Lwidth + hmarg; | |
476 sth = uicontrol(pan, 'Style','edit',... | |
477 'String', '1',... | |
478 'Units', 'normalized', ... | |
479 'BackgroundColor', 'w', ... | |
480 'Fontsize', mainfig.Gproperties.fontsize, ... | |
481 'Position',[l b Ewidth h], ... | |
482 'Tag', 'GPulse_BW',... | |
483 'Tooltip', 'Fractional Bandwidth [Hz]'); | |
484 | |
485 % nsecs | |
486 l = hmarg; | |
487 b = b - h - 2*vmarg; | |
488 sth = uicontrol(pan, 'Style','text',... | |
489 'String', 'Length [s]',... | |
490 'Units', 'normalized', ... | |
491 'HorizontalAlignment', 'right',... | |
492 'BackgroundColor', 'w', ... | |
493 'Fontsize', mainfig.Gproperties.fontsize, ... | |
494 'Position',[l b Lwidth h]); | |
495 | |
496 % edit box | |
497 l = l + Lwidth + hmarg; | |
498 sth = uicontrol(pan, 'Style','edit',... | |
499 'String', '1',... | |
500 'Units', 'normalized', ... | |
501 'BackgroundColor', 'w', ... | |
502 'Fontsize', mainfig.Gproperties.fontsize, ... | |
503 'Position',[l b Ewidth h], ... | |
504 'Tag', 'GPulse_Length',... | |
505 'Tooltip', 'Length of signal in seconds'); | |
506 | |
507 | |
508 end | |
509 | |
510 %-------------------------------------------------------------------------- | |
511 % Draw controls for a chirp signal | |
512 % | |
513 function draw_Chirp(pan,mainfig,commHeight,hmarg,vmarg) | |
514 | |
515 Lwidth = 0.25; | |
516 Ewidth = 0.65; | |
517 h = commHeight; | |
518 | |
519 %--- F0 | |
520 | |
521 l = hmarg; | |
522 b = 1-2*vmarg-h; | |
523 sth = uicontrol(pan, 'Style','text',... | |
524 'String', 'F0',... | |
525 'Units', 'normalized', ... | |
526 'HorizontalAlignment', 'right',... | |
527 'BackgroundColor', 'w', ... | |
528 'Fontsize', mainfig.Gproperties.fontsize, ... | |
529 'Position',[l b Lwidth h]); | |
530 | |
531 % edit box | |
532 l = l + Lwidth + hmarg; | |
533 clsh = uicontrol(pan, ... | |
534 'Style', 'edit', ... | |
535 'Units', 'normalized',... | |
536 'Fontsize', mainfig.Gproperties.fontsize, ... | |
537 'BackgroundColor', 'w', ... | |
538 'String', '0', ... | |
539 'Position', [l b Ewidth h],... | |
540 'Tag', 'Chirp_F0', ... | |
541 'Tooltip', 'Instantaneous frequency at t=0'); | |
542 | |
543 | |
544 % F1 | |
545 l = hmarg; | |
546 b = b - h - 2*vmarg; | |
547 sth = uicontrol(pan, 'Style','text',... | |
548 'String', 'F1',... | |
549 'Units', 'normalized', ... | |
550 'HorizontalAlignment', 'right',... | |
551 'BackgroundColor', 'w', ... | |
552 'Fontsize', mainfig.Gproperties.fontsize, ... | |
553 'Position',[l b Lwidth h]); | |
554 | |
555 l = l + Lwidth + hmarg; | |
556 sth = uicontrol(pan, 'Style','edit',... | |
557 'String', '1',... | |
558 'Units', 'normalized', ... | |
559 'BackgroundColor', 'w', ... | |
560 'Fontsize', mainfig.Gproperties.fontsize, ... | |
561 'Position',[l b Ewidth h], ... | |
562 'Tag', 'Chirp_F1', ... | |
563 'Tooltip', 'Instantaneous freuqency at t=T1'); | |
564 | |
565 % T1 | |
566 l = hmarg; | |
567 b = b - h - 2*vmarg; | |
568 sth = uicontrol(pan, 'Style','text',... | |
569 'String', 'T1',... | |
570 'Units', 'normalized', ... | |
571 'HorizontalAlignment', 'right',... | |
572 'BackgroundColor', 'w', ... | |
573 'Fontsize', mainfig.Gproperties.fontsize, ... | |
574 'Position',[l b Lwidth h]); | |
575 | |
576 l = l + Lwidth + hmarg; | |
577 sth = uicontrol(pan, 'Style','edit',... | |
578 'String', '1',... | |
579 'Units', 'normalized', ... | |
580 'BackgroundColor', 'w', ... | |
581 'Fontsize', mainfig.Gproperties.fontsize, ... | |
582 'Position',[l b Ewidth h], ... | |
583 'Tag', 'Chirp_T1', ... | |
584 'Tooltip', 'Time at which F1 is reached'); | |
585 | |
586 % nsecs | |
587 l = hmarg; | |
588 b = b - h - 2*vmarg; | |
589 sth = uicontrol(pan, 'Style','text',... | |
590 'String', 'Length [s]',... | |
591 'Units', 'normalized', ... | |
592 'HorizontalAlignment', 'right',... | |
593 'BackgroundColor', 'w', ... | |
594 'Fontsize', mainfig.Gproperties.fontsize, ... | |
595 'Position',[l b Lwidth h]); | |
596 | |
597 % edit box | |
598 l = l + Lwidth + hmarg; | |
599 sth = uicontrol(pan, 'Style','edit',... | |
600 'String', '1',... | |
601 'Units', 'normalized', ... | |
602 'BackgroundColor', 'w', ... | |
603 'Fontsize', mainfig.Gproperties.fontsize, ... | |
604 'Position',[l b Ewidth h], ... | |
605 'Tag', 'Chirp_Length',... | |
606 'Tooltip', 'Length of the signal in seconds'); | |
607 | |
608 | |
609 end | |
610 | |
611 %-------------------------------------------------------------------------- | |
612 % Draw controls for a white noise signal | |
613 % | |
614 function draw_WhiteNoise(pan,mainfig,commHeight,hmarg,vmarg) | |
615 | |
616 Lwidth = 0.25; | |
617 Ewidth = 0.65; | |
618 h = commHeight; | |
619 %--- Type | |
620 | |
621 l = hmarg; | |
622 b = 1-2*vmarg-h; | |
623 sth = uicontrol(pan, 'Style','text',... | |
624 'String', 'Noise Type',... | |
625 'Units', 'normalized', ... | |
626 'HorizontalAlignment', 'right',... | |
627 'BackgroundColor', 'w', ... | |
628 'Fontsize', mainfig.Gproperties.fontsize, ... | |
629 'Position',[l b Lwidth h]); | |
630 | |
631 % edit box | |
632 l = l + Lwidth + hmarg; | |
633 clsh = uicontrol(pan, ... | |
634 'Style', 'popupmenu', ... | |
635 'Units', 'normalized',... | |
636 'Fontsize', mainfig.Gproperties.fontsize, ... | |
637 'BackgroundColor', 'w', ... | |
638 'String', {'Normal', 'Uniform'}, ... | |
639 'Position', [l b Ewidth h],... | |
640 'Tag', 'WhiteNoise_Type'); | |
641 | |
642 | |
643 % sigma | |
644 l = hmarg; | |
645 b = b - h - 2*vmarg; | |
646 sth = uicontrol(pan, 'Style','text',... | |
647 'String', 'Sigma',... | |
648 'Units', 'normalized', ... | |
649 'HorizontalAlignment', 'right',... | |
650 'BackgroundColor', 'w', ... | |
651 'Fontsize', mainfig.Gproperties.fontsize, ... | |
652 'Position',[l b Lwidth h]); | |
653 | |
654 l = l + Lwidth + hmarg; | |
655 sth = uicontrol(pan, 'Style','edit',... | |
656 'String', '1',... | |
657 'Units', 'normalized', ... | |
658 'BackgroundColor', 'w', ... | |
659 'Fontsize', mainfig.Gproperties.fontsize, ... | |
660 'Position',[l b Ewidth h], ... | |
661 'Tag', 'WhiteNoise_Sigma'); | |
662 | |
663 % nsecs | |
664 l = hmarg; | |
665 b = b - h - 2*vmarg; | |
666 sth = uicontrol(pan, 'Style','text',... | |
667 'String', 'Length [s]',... | |
668 'Units', 'normalized', ... | |
669 'HorizontalAlignment', 'right',... | |
670 'BackgroundColor', 'w', ... | |
671 'Fontsize', mainfig.Gproperties.fontsize, ... | |
672 'Position',[l b Lwidth h]); | |
673 | |
674 % edit box | |
675 l = l + Lwidth + hmarg; | |
676 sth = uicontrol(pan, 'Style','edit',... | |
677 'String', '1',... | |
678 'Units', 'normalized', ... | |
679 'BackgroundColor', 'w', ... | |
680 'Fontsize', mainfig.Gproperties.fontsize, ... | |
681 'Position',[l b Ewidth h], ... | |
682 'Tag', 'WhiteNoise_Length'); | |
683 | |
684 | |
685 end | |
686 | |
687 %-------------------------------------------------------------------------- | |
688 % Draw controls for a sine wave signal | |
689 % | |
690 function draw_Sine_Wave(pan,mainfig,commHeight,hmarg,vmarg) | |
691 | |
692 Lwidth = 0.25; | |
693 Ewidth = 0.65; | |
694 h = commHeight; | |
695 %--- Amplitudes | |
696 % label | |
697 l = hmarg; | |
698 b = 1-2*vmarg-h; | |
699 sth = uicontrol(pan, 'Style','text',... | |
700 'String', 'Amplitudes',... | |
701 'Units', 'normalized', ... | |
702 'HorizontalAlignment', 'right',... | |
703 'BackgroundColor', 'w', ... | |
704 'Fontsize', mainfig.Gproperties.fontsize, ... | |
705 'Position',[l b Lwidth h]); | |
706 | |
707 % edit box | |
708 l = l + Lwidth + hmarg; | |
709 sth = uicontrol(pan, 'Style','edit',... | |
710 'String', '1',... | |
711 'Units', 'normalized', ... | |
712 'BackgroundColor', 'w', ... | |
713 'Fontsize', mainfig.Gproperties.fontsize, ... | |
714 'Position',[l b Ewidth h], ... | |
715 'Tag', 'SineWave_Amplitudes'); | |
716 | |
717 %--- Frequencies | |
718 % label | |
719 l = hmarg; | |
720 b = b - h - 2*vmarg; | |
721 sth = uicontrol(pan, 'Style','text',... | |
722 'String', 'Frequencies [Hz]',... | |
723 'Units', 'normalized', ... | |
724 'HorizontalAlignment', 'right',... | |
725 'BackgroundColor', 'w', ... | |
726 'Fontsize', mainfig.Gproperties.fontsize, ... | |
727 'Position',[l b Lwidth h]); | |
728 | |
729 % edit box | |
730 l = l + Lwidth + hmarg; | |
731 sth = uicontrol(pan, 'Style','edit',... | |
732 'String', '1',... | |
733 'Units', 'normalized', ... | |
734 'BackgroundColor', 'w', ... | |
735 'Fontsize', mainfig.Gproperties.fontsize, ... | |
736 'Position',[l b Ewidth h], ... | |
737 'Tag', 'SineWave_Frequencies'); | |
738 | |
739 %--- Phases | |
740 % label | |
741 l = hmarg; | |
742 b = b - h - 2*vmarg; | |
743 sth = uicontrol(pan, 'Style','text',... | |
744 'String', 'Phases [deg]',... | |
745 'Units', 'normalized', ... | |
746 'HorizontalAlignment', 'right',... | |
747 'BackgroundColor', 'w', ... | |
748 'Fontsize', mainfig.Gproperties.fontsize, ... | |
749 'Position',[l b Lwidth h]); | |
750 | |
751 % edit box | |
752 l = l + Lwidth + hmarg; | |
753 sth = uicontrol(pan, 'Style','edit',... | |
754 'String', '0',... | |
755 'Units', 'normalized', ... | |
756 'BackgroundColor', 'w', ... | |
757 'Fontsize', mainfig.Gproperties.fontsize, ... | |
758 'Position',[l b Ewidth h], ... | |
759 'Tag', 'SineWave_Phases'); | |
760 | |
761 %--- Nsecs | |
762 l = hmarg; | |
763 b = b - h - 2*vmarg; | |
764 sth = uicontrol(pan, 'Style','text',... | |
765 'String', 'Lengths [s]',... | |
766 'Units', 'normalized', ... | |
767 'HorizontalAlignment', 'right',... | |
768 'BackgroundColor', 'w', ... | |
769 'Fontsize', mainfig.Gproperties.fontsize, ... | |
770 'Position',[l b Lwidth h]); | |
771 | |
772 % edit box | |
773 l = l + Lwidth + hmarg; | |
774 sth = uicontrol(pan, 'Style','edit',... | |
775 'String', '1',... | |
776 'Units', 'normalized', ... | |
777 'BackgroundColor', 'w', ... | |
778 'Fontsize', mainfig.Gproperties.fontsize, ... | |
779 'Position',[l b Ewidth h], ... | |
780 'Tag', 'SineWave_Lengths'); | |
781 | |
782 %--- Toffs | |
783 l = hmarg; | |
784 b = b - h - 2*vmarg; | |
785 sth = uicontrol(pan, 'Style','text',... | |
786 'String', 'Starts [s]',... | |
787 'Units', 'normalized', ... | |
788 'HorizontalAlignment', 'right',... | |
789 'BackgroundColor', 'w', ... | |
790 'Fontsize', mainfig.Gproperties.fontsize, ... | |
791 'Position',[l b Lwidth h]); | |
792 | |
793 % edit box | |
794 l = l + Lwidth + hmarg; | |
795 sth = uicontrol(pan, 'Style','edit',... | |
796 'String', '0',... | |
797 'Units', 'normalized', ... | |
798 'BackgroundColor', 'w', ... | |
799 'Fontsize', mainfig.Gproperties.fontsize, ... | |
800 'Position',[l b Ewidth h], ... | |
801 'Tag', 'SineWave_Starts'); | |
802 end |