source: orbit/octave/GenerateAudioCommand/bitGenDirect.m @ f22b7ab

RawEEGRaw_EEG_PlotServoTab_Interfacepyramid
Last change on this file since f22b7ab was a0b523e, checked in by AzureViolin <zhanghaotz@…>, 8 years ago

flyOrbit.m can now generate arbitry control code for play from laptop. update read.me

  • Property mode set to 100644
File size: 575 bytes
Line 
1function wave = bitGenDirect(bit,num,sps,longHIGH_s,longLOW_s,shortHIGH_s,shortLOW_s)
2
3% bit: 1 means bit "1", 0 means bit "0".
4% num: how many certain bit to generate.
5% audioFileName: like 'audio.wav'.
6
7longHIGH=875;
8longLOW=729;
9shortHIGH=458;
10shortLOW=333;
11
12bps = 16;       % bits per sample
13%sps = 960000;     % sample rate [samples/s]
14
15wave = [];
16if bit==1
17        wave = [halfSineGenDirect('u',longHIGH_s,0,1,sps);halfSineGenDirect('d',longLOW_s,0,1,sps)];
18elseif bit==0
19        wave = [halfSineGenDirect('u',shortHIGH_s,0,1,sps);halfSineGenDirect('d',shortLOW_s,0,1,sps)];
20endif
Note: See TracBrowser for help on using the repository browser.