Ignore:
Timestamp:
12/04/12 19:47:09 (10 years ago)
Author:
dorabot <dorabot@…>
Branches:
master, RawEEG, Raw_EEG_Plot, Servo, Tab_Interface, pyramid
Children:
f323fb4
Parents:
dccf843
Message:

add comment to script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • octave/GenerateAudioCommand/halfSineGenDirect.m

    ra0b523e rcb3655b  
    22 
    33% dir: 'u' means UP, 'd' means down. 
    4 % halfPeriod: half period of cosine signal[us]. 
     4% halfPeriod: half period of sine signal[us]. 
    55% zero: zero level of cosine signal. 
    66% amp: amplitude of cosine signal, in percentage.  
     
    1313freq = floor(sps/(halfPeriod_in_samples*2));       % frequency of the tone [Hz] 
    1414 
    15  
     15%linspace is an octave function that generates a sequence with certain step. 
    1616time = linspace(1/sps, halfPeriod, halfPeriod_in_samples); 
    1717if (dir== 'u')  
    18         wave = sin(time*2*pi*freq)'.*amp+zero; 
     18        wave = sin(time*2*pi*freq)'.*amp+zero;%'u' indicates above zero line 
    1919elseif (dir=='d') 
    20         wave = sin((time+halfPeriod)*2*pi*freq)'.*amp+zero; 
     20        wave = sin((time+halfPeriod)*2*pi*freq)'.*amp+zero;%'d' indicates below zero line 
    2121endif 
    2222 
Note: See TracChangeset for help on using the changeset viewer.