Ignore:
Timestamp:
12/04/12 19:47:09 (10 years ago)
Author:
dorabot <dorabot@…>
Branches:
master, RawEEG, Raw_EEG_Plot, Servo, Tab_Interface, pyramid
Children:
f323fb4
Parents:
dccf843
Message:

add comment to script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • octave/GenerateAudioCommand/flyOrbit.m

    rf22b7ab rcb3655b  
    33% code: array of 1s and 0s. 1 means bit "1", 0 means bit "0". 
    44% audioFileName: like 'audio.wav'. 
    5 % space: space between codes [us] 
     5% space: space between codes [uS] 
    66bps = 16;       % bits per sample 
    77%sps = 96000;     % sample rate [samples/s] 
    8  
    9 space=floor(space*48000/1e6); 
     8%repeatTime: the number of same commands you want to generate 
     9%AndroidOriOS: 'Android' 'iOS' generates two different style of codes 
     10%flipOrNot: 'flip' 'notF' some android device needs a flipped signal. 
     11space=floor(space*48000/1e6);% turn uS into samples 
    1012 
    1113if length(AndroidOriOS)==3 %iOS 
     
    1416elseif length(AndroidOriOS)==7 %Android 
    1517 
    16         if AndroidOriOS=='Android' 
    17         fullCodeWave=[flyCommand(code,space,'temp1,wav',sps,4,AndroidOriOS,flipOrNot);initCodeGenAndroid('temp2.wav',sps);zeros(1,1);flyCommand(code,space,'temp3.wav',sps,repeatTime,AndroidOriOS,flipOrNot)]; 
    18         elseif AndroidOriOS=='Command' 
     18        if AndroidOriOS=='Android'%generate android style command with init 
     19 
     20%Android style command consists of 4(any number larger than 2) command, init code, and certain repeat of command. 
     21%function initCodeGenAndroid can generate init 
     22%function flyCommand can generate command 
     23        fullCodeWave=[flyCommand(code,space,'temp1.wav',sps,4,AndroidOriOS,flipOrNot);initCodeGenAndroid('temp2.wav',sps);zeros(1,1);flyCommand(code,space,'temp3.wav',sps,repeatTime,AndroidOriOS,flipOrNot)]; 
     24        elseif AndroidOriOS=='Command'%generate command only 
    1925        fullCodeWave=[flyCommand(code,space,'temp3.wav',sps,repeatTime,AndroidOriOS,flipOrNot)]; 
    2026        endif 
Note: See TracChangeset for help on using the changeset viewer.