Changeset f22b7ab in orbit


Ignore:
Timestamp:
11/29/12 15:14:27 (7 years ago)
Author:
AzureViolin <zhanghaotz@…>
Branches:
master, RawEEG, Raw_EEG_Plot, Servo, Tab_Interface, pyramid
Children:
a2d894c
Parents:
2cd475f
Message:

flyOrbit Works should for EVERY Android (not tested)

Location:
octave/GenerateAudioCommand
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • octave/GenerateAudioCommand/flyOrbit.m

    r2cd475f rf22b7ab  
    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 [samples] 
     5% space: space between codes [us] 
    66bps = 16;       % bits per sample 
    77%sps = 96000;     % sample rate [samples/s] 
     8 
     9space=floor(space*48000/1e6); 
     10 
    811if length(AndroidOriOS)==3 %iOS 
    912fullCodeWave=[flyCommand(code,space,'temp1.wav',sps,2,AndroidOriOS,flipOrNot);initCodeGen('temp2.wav');flyCommand(code,space,'temp3.wav',sps,repeatTime,AndroidOriOS,flipOrNot)]; 
     
    1215 
    1316        if AndroidOriOS=='Android' 
    14         fullCodeWave=[flyCommand(code,space,'temp1,wav',sps,20,AndroidOriOS,flipOrNot);initCodeGenAndroid('temp2.wav');zeros(1,1);flyCommand(code,space,'temp3.wav',sps,repeatTime,AndroidOriOS,flipOrNot)]; 
     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)]; 
    1518        elseif AndroidOriOS=='Command' 
    1619        fullCodeWave=[flyCommand(code,space,'temp3.wav',sps,repeatTime,AndroidOriOS,flipOrNot)]; 
  • octave/GenerateAudioCommand/initCodeGenAndroid.m

    ra0b523e rf22b7ab  
    1 function initWave=initCodeGenAndroid(audioFileName);  
     1function initWave=initCodeGenAndroid(audioFileName,sps);  
    22 
    33% code: array of 1s and 0s. 1 means bit "1", 0 means bit "0". 
     
    55% Multiplyer: value around 1, to change "carrier" period. 
    66bps = 16;       % bits per sample 
    7 sps = 48000;     % sample rate [samples/s] 
    87 
    9 longHIGH=45+3; 
    10 longLOW=89+7; 
    11 mediumLOW=21+2; 
    12 shortHIGH=5; 
    13 shortLOW=8; 
    14 pause=480; 
    15 space=4049; 
     8_longHIGH=1000; %[us] 
     9_longLOW=2000;  
     10_mediumLOW=500; 
     11_shortHIGH=100; 
     12_shortLOW=180; 
     13_pause=10000; 
     14_space=84354; 
     15 
     16longHIGH=floor(_longHIGH*sps/1e6)-1; 
     17longLOW=floor(_longLOW*sps/1e6)+1; 
     18mediumLOW=floor(_mediumLOW*sps/1e6)-1; 
     19shortHIGH=floor(_shortHIGH*sps/1e6)+1; 
     20shortLOW=floor(_shortLOW*sps/1e6); 
     21pause=floor(_pause*sps/1e6); 
     22space=floor(_space*sps/1e6); 
    1623 
    1724initWave=[halfSineGenDirect('u',longHIGH,0,1,sps);zeros(longLOW,1);halfSineGenDirect('u',longHIGH,0,1,sps);zeros(longLOW,1);halfSineGenDirect('u',longHIGH,0,1,sps);halfSineGenDirect('d',mediumLOW,0,1,sps);halfSineGenDirect('u',shortHIGH,0,1,sps)]; 
Note: See TracChangeset for help on using the changeset viewer.