source: orbit/octave/GenerateAudioCommand/dualBitGenDirect.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: 403 bytes
RevLine 
[a0b523e]1function wave = dualBitGenDirect(bit,shortHIGH,shortLOW,longHIGH,longLOW)
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
7 
8bps = 16;       % bits per sample
9%sps = 960000;     % sample rate [samples/s]
10
11if (bit==0)     
12wave = [ones(shortHIGH,1);zeros(shortLOW,1)];
13elseif (bit==1)
14        wave=[ones(longHIGH,1);zeros(longLOW,1)];
15endif
16
17
Note: See TracBrowser for help on using the repository browser.