source: orbit/octave/GenerateAudioCommand/sinWaveGen.m @ 6aa182f

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

add octave script

  • Property mode set to 100644
File size: 392 bytes
Line 
1% function sinWaveGen(
2
3bps = 16;       % bits per sample
4sps = 96000;     % sample rate [samples/s]
5period = 1.6;   %period of the wave [ms]
6freq = floor(10^3/period);       % frequency of the tone [Hz]
7nsecs = 0.0008;      % number of seconds of the audio file
8nsamples = sps*nsecs;
9
10time = linspace(0, nsecs, nsamples);
11wave = sin(time*2*pi*freq)';
12
13wavwrite(wave, sps, bps, '1.6ms.wav')
Note: See TracBrowser for help on using the repository browser.