Changeset 655a816 in orbit


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

flyCommand updated for 44.1kHz)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • octave/GenerateAudioCommand/flyCommand.m

    ra0b523e r655a816  
    77%sps = 96000;     % sample rate [samples/s] 
    88 
    9  
     9if length(code)==5 
    1010if code=='demo1' 
    1111        code=[1 0 1 1 0 1 1 1 0 1 0 0 1 1 0 0 1 0 0 1 1 1 1 1 0 1 1 0];%minimum rotating throttle 
     
    1818        code=[1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 0 0 ];%test for Untitled 04 
    1919        endif 
     20 
     21endif 
    2022 
    2123if (length(AndroidOriOS)==3)%'iOS' 
     
    4850elseif length(AndroidOriOS)==7 %'Android' 
    4951 
    50 longHIGH=875;longHIGH_s=floor(longHIGH*sps/1e6)-4;%longHIGH[us]  longHIGH_s[sample] 
    51 longLOW=729;longLOW_s=floor(longLOW*sps/1e6+3); 
    52 shortHIGH=458;shortHIGH_s=floor(shortHIGH*sps/1e6)-2; 
    53 shortLOW=333;shortLOW_s=floor(shortLOW*sps/1e6)+1; 
     52longHIGH=875;longHIGH_s=floor(longHIGH*sps/1e6)-3;%longHIGH[us]  longHIGH_s[sample] 
     53longLOW=729;longLOW_s=floor(longLOW*sps/1e6+3)+1; 
     54shortHIGH=458;shortHIGH_s=floor(shortHIGH*sps/1e6)-3; 
     55shortLOW=333;shortLOW_s=floor(shortLOW*sps/1e6)+1+2; 
    5456 
    55 codeWave=[halfSineGenDirect('d',longLOW_s-1,0,1,sps);halfSineGenDirect('u',longHIGH_s-2,0,1,sps);             halfSineGenDirect('d',shortLOW_s-1,0,1,sps);halfSineGenDirect('u',longHIGH_s-2,0,1,sps); halfSineGenDirect('d',shortLOW_s,0,1,sps);0]; %starting 5 half period 
     57 
     58shortLOW_ss=floor(shortLOW*sps/1e6)+2; 
     59 
     60codeWave=[halfSineGenDirect('d',longLOW_s-1,0,1,sps);halfSineGenDirect('u',longHIGH_s-2,0,1,sps);    halfSineGenDirect('d',shortLOW_ss+2,0,1,sps);halfSineGenDirect('u',longHIGH_s-2,0,1,sps); halfSineGenDirect('d',shortLOW_ss+3,0,1,sps)]; %starting 5 half period 
    5661 
    5762% notice that the "code" here should be a 28 bit binary array. 
    58 m=0; 
    59 n=0; 
    6063for i=1:size(code,2) 
    6164codeWave = [codeWave; bitGenDirect(code(i),1,sps,longHIGH_s,   longLOW_s,shortHIGH_s,shortLOW_s)]; 
    62 if code(i)==1 
    63         n=n+1; 
    64 elseif code(i)==0 
    65         m=m+1; 
    66 endif 
    67  
    68 if n==115  
    69         n=0; 
    70         codeWave=[codeWave;0]; 
    71 endif 
    72 if m==101 
    73         m=0; 
    74         codeWave=[codeWave;0]; 
    75 endif 
    7665         
    7766endfor 
Note: See TracChangeset for help on using the changeset viewer.