source: orbit/octave/GenerateAudioCommand/codeWaveGen.m @ 71aa88f

RawEEGRaw_EEG_PlotServoTab_Interfacepyramid
Last change on this file since 71aa88f was 6aa182f, checked in by AzureViolin <zhanghaotz@…>, 8 years ago

add octave script

  • Property mode set to 100644
File size: 350 bytes
Line 
1function codeWaveGen(code,audioFileName)
2
3% code: array of 1s and 0s. 1 means bit "1", 0 means bit "0".
4% audioFileName: like 'audio.wav'.
5
6bps = 16;       % bits per sample
7sps = 96000;     % sample rate [samples/s]
8
9codeWave=[];
10for i=1:size(code,2)
11        codeWave = [codeWave; bitGen(code(i),1)];
12endfor
13
14wavwrite(codeWave, sps, bps, audioFileName);
Note: See TracBrowser for help on using the repository browser.