Changeset 655a816 in orbit for octave/GenerateAudioCommand/flyCommand.m
- Timestamp:
- 11/29/12 14:26:14 (10 years ago)
- Branches:
- master, RawEEG, Raw_EEG_Plot, Servo, Tab_Interface, pyramid
- Children:
- f323fb4, 2cd475f
- Parents:
- a0b523e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
octave/GenerateAudioCommand/flyCommand.m
ra0b523e r655a816 7 7 %sps = 96000; % sample rate [samples/s] 8 8 9 9 if length(code)==5 10 10 if code=='demo1' 11 11 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 … … 18 18 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 19 19 endif 20 21 endif 20 22 21 23 if (length(AndroidOriOS)==3)%'iOS' … … 48 50 elseif length(AndroidOriOS)==7 %'Android' 49 51 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 ;52 longHIGH=875;longHIGH_s=floor(longHIGH*sps/1e6)-3;%longHIGH[us] longHIGH_s[sample] 53 longLOW=729;longLOW_s=floor(longLOW*sps/1e6+3)+1; 54 shortHIGH=458;shortHIGH_s=floor(shortHIGH*sps/1e6)-3; 55 shortLOW=333;shortLOW_s=floor(shortLOW*sps/1e6)+1+2; 54 56 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 58 shortLOW_ss=floor(shortLOW*sps/1e6)+2; 59 60 codeWave=[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 56 61 57 62 % notice that the "code" here should be a 28 bit binary array. 58 m=0;59 n=0;60 63 for i=1:size(code,2) 61 64 codeWave = [codeWave; bitGenDirect(code(i),1,sps,longHIGH_s, longLOW_s,shortHIGH_s,shortLOW_s)]; 62 if code(i)==163 n=n+1;64 elseif code(i)==065 m=m+1;66 endif67 68 if n==11569 n=0;70 codeWave=[codeWave;0];71 endif72 if m==10173 m=0;74 codeWave=[codeWave;0];75 endif76 65 77 66 endfor
Note: See TracChangeset
for help on using the changeset viewer.