Home
AUX User`s Manual I. Introduction II. Basic format of signals and
Contents
1. Example 1 tone 1000 100 is a 1000 Hz tone with 100 ms tone 1000 100 gt gt 500 is the same tone but begins at 500 ms instead of 0 to B 2 3 Append operator A B concatenates A to B thatis A B A B gt gt dur A 2 4 RMS scaling operator A a gt Scale the signal A at a dB rms re 0 dB absolute scaling by the sound card output A B a Scale the signal A at a dB rms re signal B relative scaling Example 2 Let A be a waveform read from a wave file A wave bob wav Then A 20 specifies the signal rescaled to make its rms 20 dB re the full scale A wave masker 5 specifies that the signal be adjusted its scale to its rms 5 dB above that of another signal masker wav 2 5 Extraction operator version 1 3 Page 2 of 11 last updated 6 20 2011 AUX User s Manual Authors BJ Kwon JH Park A a B gt Extract a time portion between a and b millisecond from signal A If B lt a the extracted signal is time reversed Example 3 From the signal A defined in Example 2 A 300 500 is the extracted portion of the waveform from 300 to 500 ms Suppose that A has a duration of 1000 ms then A 1000 0 isa time reversal version of signal A 2 6 Playback adjustment operator The operator changes the playback rate the signal i e modulating the pitch of voice and making the duration faster or slower accordingly Example 4 Continuing from the Example 3 A 2 is
2. 1000 100 gt gt 500 2 is tone 1000 100 gt gt 500 2 so you should write it as tone 1000 100 gt gt 500 2 if that s what you meant 2 9 Programming support for looping The following syntaxes for control looping are supported the same way as in MATLAB for end while end if elseif else end Ill Signal construction functions tone Generate a tone signal or tonal glide Syntax tone freq duration initial_phase 0 Arguments freq frequency in Hz a two element vector of frequencies for a tone gilde duration duration in msec initial phase between 0 for 0 and 1 for 27 Examples tone 226 400 a 226 Hz tone from 0 to 400 ms tone 226 400 5 226 Hz tone of 400 ms 180 degrees out of phase tone 250 500 400 a tone glide from 250 Hz to 500 Hz noise Generate a white noise signal Syntax noise duration Arguments duration duration in msec fm Generate a frequency modulated tone signal Syntax fm freql freq2 mod_rate duration init_phase 0 Arguments freql freq2 the boundary frequencies in Hz mod rate how many times the frequency will swing between freql and freq2 must be a positive value duration duration in msec init phase The initial modulation phase between 0 and 1 0 means it begins with freq and 1 means it begins with freq2 xamples fm 500 700 4 2000 version 1 3 Page 6 of 11 last updated 6 20 2011 AUX User s Manual Authors BJ Kw
3. 300 The following is AUX operators in the order of precedence highest to lowest The precedence is pretty much standard except for a few AUX native operators which are placed between multiplication division and addition subtraction Their associativity indicates in what order operators of equal precedence in an expression are applied Personally I wouldn t memorize this because I think we should use parentheses whenever in doubt But I am including this information to remind you that there is a priority of operation when there are no parentheses i e don t presume that the signal you defined is unambiguous to everyone specifically the developers of AUX Parentheses sub expression function call vector indexing left to right Braces array subscript Unary plus minus sign right to left Logical negation fs Exponentiation right to left Multiplication division left to right left to right Play speed RMS Addition subtraction left to right gt gt Relational greater than greater than or equal to version 1 3 Page 5 of 11 last updated 6 20 2011 AUX User s Manual Authors BJ Kwon JH Park Logical OR left to right Assignment right to left left to right Comma separate expressions Example 8 tone 1000 100 gt gt 500 20 is tone 1000 100 gt gt 500 20 and is an ugly super duper clipped signal You should write it as tone 1000 100 gt gt 500 20 if that s what you meant But tone
4. psycon exe will be searched The extension txt can be omitted IV Signal modification functions am Amplitude Modulate the signal Syntax am signal mod_rate mod_depth 1 init_phase 0 Arguments mod_rate AM modulation rate in Hz mod depth Modulation depth between 0 no mod and 1 full mod If skipped full modulation is assumed init _phase The initial modulation phase between 0 and 1 Examples am noise 1000 8 0 5 AM ofa white noise at 8 Hz with a depth of 0 5 Ipf IIR filtering Lowpass highpass bandpass and bandstop filtering respectively Ipf hpf and hpf require at least 2 arguments signal and edge frequency and bpf and bsf bpf require at least 3 arguments signal and two edge frequencies The rest arguments bsf are optional and available for tweaking detailed filter settings Syntax lpf signal freq order 8 kind 1 dBpass 5 dBstop 40 hpf signal freq order 8 kind 1 dBpass 5 dBstop 40 bpf signal freql freq2 order 8 kind 1 dBpass 5 dBstop 40 version 1 3 Page 7 of 11 last updated 6 20 2011 AUX User s Manual Authors BJ Kwon JH Park bsf signal dBstop 40 freql freq2 order 8 kind 1 dBpass 5 Arguments order Filter order Default 8 kind 1 for Butterworth default 2 for Chebyshev and 3 for Elliptic dBpass Passband ripple in dB default 0 5 dB dBstop Stopban
5. signal version 1 3 Page 3 of 11 last updated 6 20 2011 AUX User s Manual Authors BJ Kwon JH Park 2 9 Indexing of an array Although AUX users are encouraged to consider a sound as a conceptual component rather than the manifestation of digitized samples and discouraged from considering and handling it as an array of samples it is still sometimes necessary to have an array of values for later reference Similar to MATLAB a vector or array can be represented by a series of values with brackets When a specific value is referenced the index with parentheses is specified For example a vector x can be defined as follows x 0 20 40 60 80 or another vector y can be defined as y 0 10 1000 Similar to MATLAB the indexing is one based the first index is one i e x 1 is 0 in this example Referencing consecutive indices can be done with a colon or colons similar to MATLAB e g y 3 5 would be a vector of 20 30 40 and y 1 2 5 would be 0 20 40 So far everything is the same as MATLAB but look at the following example 1 5 isequalto 1 2 3 4 5 bothin AUX and MATLAB but in AUX 5 1 isequalto 5 4 3 2 1 in MATLAB 5 1 is equalto empty array Example 6 Continuing from examples 2 and 3 A 22050 1 is identical to A 1000 0 in example 3 presuming that the sample size of A is 22050 2 10 Cell array Cell arrays can be defined in the same ways in MATLAB using braces 2 11 String management and manipula
6. 0 500 10 Make the tone with 10 ms beginning and ending ramping Note This uses the cosine square function for smoothing V Computation functions or functions retrieving properties of a signal If you want to use a dB factor for scaling the following db function comes in handy db Calculate the actual factor from a dB value Syntax db db_value Arguments db value the scale factor of the specified value in dB Examples The following expressions are the same db 6 tone 300 500 0 5 tone 300 500 tone 300 db 6 500 tone 600 500 am noise 1000 8 db 20 am noise 1000 8 0 01 20 dB Amplitude Modulation version 1 3 Page 8 of 11 last updated 6 20 2011 AUX User s Manual Authors BJ Kwon JH Park rms Compute the rms value in dB Syntax rms signal Arguments signal any valid signal dur Get the duration of signal in ms Syntax dur signal length Get the sample count of signal Syntax length signal rand Generates a double precision random number Syntax rand max_val Note Double precision random number between 0 and max val with a uniform distribution irand Generates an integer random number Syntax irand max_val Note Integer random number between 1 and max_val with a uniform distribution randperm Generates a randomly permuted array from to val Syntax randperm val Note An integer array from
7. AUX User s Manual Authors BJ Kwon JH Park l Introduction AUX stands for AUditory syntaX used to define arbitrary sound signals and operations processing of auditory signals It is semi mathematical i e signal components can be added subtracted multiplied or divided Unlike MATLAB two signals with different lengths can be added or multiplied without worrying about the indices or vector lengths even the operation between a signal and a scalar is possible Users only need to be familiar with conventions in such operations Il Basic format of signals and operators 2 1 Terminology Vector An array of values Signal Same as the vector but connoting a sound signal AUX itself doesn t differentiate a signal from vector but the different use of these words might be helpful for this document Conceptual difference you conceptualize a vector as an array of values with a certain length in sample counts whereas you conceptualize a sound as a sound with a duration in seconds By definition all signals in AUX specifications are time bound therefore a duration or sample count is determined when you define a signal Scalar A constant value a special form of vector Variable A variable can be used to denote or define a vector or signal and use it later Below A and B are signals a and b are scalars For arithmetic operations regardless of the duration of the signals the operation is applied a
8. d attenutation in dB default 40 dB Examples lpf noise 1000 2000 Lowpass noise with a cutoff frequency of 2000 Hz 8th order Butterworth hpf noise 1000 3000 6 2 Highpass noise with a cut of 3000 Hz 6th order Chebyshev bpf noise 1000 1900 2000 6 3 1 80 bandpass noise between 1900 and 2000 Hz 6th order Elliptic with 1dB ripple and 60 dB attenuation note Be sure to check the IIR filter s stability Note that some filtering specs such as very narrow bandpass filtering will be difficult to obtain stable filter coefficient filt Filter the signal with the specified coefficients Syntax filt signal num array den_array Arguments num _ array den array Numerator or denominator coefficient arrays Must use a bracket or tag see how to use tag Examples filt noise 1000 2 0 2 001 1 2 02 Filter the white noise with these coefficient arrays 2nd order IIR filt noise 1000 filters 1p1500 Filter the noise with the coefficients available in matlab variable 1p1500 stored in filters mat filtfilt Anti causal zero delay filter the signal with the specified coefficients Syntax filtfilt signal num array den_array filtfilt signal mat_file matlab_filter variable ramp Make the beginning and ending points smooth to avoid spectrum splatter Syntax ramp signal ramping_time Arguments ramping time The time in ms for ramping up at the beginning and down at the end Examples ramp tone 150
9. efined Functions go to http auditorypro com download aux UDF htm The following functions were added to assist UDF coding but they also work outside of the UDF context I will keep these for debugging purposes but it is still debatable whether these should be part of AUX specification or not fprintf Opens and writes to file the same as fopen fprintf fclose in C except that this always opens the file in the append mode Syntax fprintf filename format var_list Arguments The syntax is equivalent to the following C code FILE fp fopen filename at fprintf format var list fclose fp E show Pops up a message box and displays a string This is useful when writing to a file is not an option Syntax show format var_list Arguments See above for fprintf wavwrite Writes the signal to a file Syntax wavwrite signal filename Arguments signal AUX signal filename string in double quotation version 1 3 Page 11 of 11 last updated 6 20 2011
10. ght channel will be ignored spectrum a stereo signal containing the spectrum of a real signal i e its left and right signals must be Hermitian conjugate hilbert Discrete Hilbert Transform This computes an analytic signal complex signal of the signal and returns its imaginary part Syntax hilbert signal note The envelope of a signal x can be extracted in the following way sqrt x x hilbert x hilbert x Vil User defined function Users can make their own functions if you don t like the functions that are provided you can override them It needs to be saved with the extension of aux and accessible by the program It has the following format similar to MATLAB function outputl output2 function name inputi input2 Main body of the function that prepares and specifies output variables as results Similar to MATLAB the function keyword declared in the top of the file is visible to the program If there are more functions defined in the middle of the file using the same function keyword these are only accessible within the file i e local functions The access of aux files is determined by the actual application using AUX i e the actual program determines the location directories to look for user defined function aux files version 1 3 Page 10 of 11 last updated 6 20 2011 AUX User s Manual Authors BJ Kwon JH Park For further information on User D
11. on JH Park a 2 second FM tone between 500 and 700 Hz at 4 Hz silence Generate a silence signal dc Generate a dc signal gnoise Generate a gaussian noise signal Notes The same format as noise it takes only one argument the duration in ms wave Read a wav file Syntax wave wave_name Arguments wave name name of wave file Use double quotation marks or a string variable If path is not included current folder the same directory as the psycon exe will be searched The extension wav can be omitted Examples wave c soundData specialnoise Read the signal from specialnoise wav in the specified directory interp Create a vector with interpolated values linear interpolation Syntax interp values time_marks Arguments values and time marks must be vectors in the same length values Array of values for interpolation time marks Array of time points that correspond to each value for interpolation Examples interp 0 4 6 1 0 0 300 600 900 1200 Notes This function may be useful when dynamically scaling amplitude of a signal cf operator for dynamic scaling file Read from text ascii file the values will be read into an array delimited by a space CR LF or tab character Syntax file file name Arguments file name name of text file Use double quotation marks or a string variable If path is not included current folder the same directory as the
12. s long as each operand is valid and available For example note that we haven t discussed how a signal can be defined in AUX signals here are defined in verbal expressions A a 500 Hz tone from 300 ms til 600ms B white noise from 500 ms til 1000ms Then A B is a 500 Hz tone from 300 ms til 500 ms the same tone plus noise from 500 ms till 600 ms then noise from 600 ms til 1000 ms The same principle applies to multiplication For the operations between a scalar and a signal essentially the scalar operand applies through the version 1 3 Page 1 of 11 last updated 6 20 2011 AUX User s Manual Authors BJ Kwon JH Park entire duration of the signal From signal A defined above 0 2 A is the signal A multiplied scaled by 0 2 for the entire duration of the signal 0 2 A is the signal A plus a dc shift with the DC amplitude of 0 2 The above explanation appears more complicated than it actually is And this kind of convention allows flexible application of arithmetic operations particularly with the concept of null signal see below If you are unsure now please keep reading this By the end of section 2 you will have a clear idea about the fundamental framework of AUX Also in the examples below functions are used without explanations just keep reading it those will be covered in section 3 2 2 Time shift operator gt gt A gt gt a Shift the signal A in time forward by a milliseconds
13. the signal of the voice with the half of the pitch with doubled duration and A 5 or A 1 2 is the signal of the voice with doubled pitch and half of the duration 2 7 Stereo signal A B gt A stereo signal A on the left channel B on the right channel A and B need not have the same duration nor they may have entirely unrelated time arrangement 2 8 Null signal or null portion A null signal is defined as a signal that is not defined And null portion is the time portion that the signal is not defined As such arithmetic operations of a null signal or operations during the null portion have no effect Note that null signal is different from a signal with zero value For example in the signal defined as tone 1000 100 gt gt 500 the signal is not defined from 0 to 500 ms The concept of null signal is useful to apply arithmetic operations only for partial portion of a signal Example 5 For ramping damping of a signal envelope smoothing vector should be multiplied at the onset and offset With the concept of null signal this can be easily done as follows windowl tone 25 10 tone 25 10 cosine square function for increasing arc for 10 ms window2 window1 10 0 gt gt 490 mirror image in time for offset window windowl window2 defined during the onset and offset portions null otherwise Finally smoothing occurs only during onset and offset smoothed signal window original
14. tion A string variable can be defined a double quotation mark eg str c soundfiles test wav wave str String variables have the same rules and conventions as in MATLAB such as concatenating or accessing by indices 2 12 Dynamic amplitude scaling A v vt gt applies a dynamic amplitude v for specified time points vt Both v and vt are vectors with the same length Earlier in 2 4 we explained the operator to scale the amplitude of the signal at a dB value when version 1 3 Page 4 of 11 last updated 6 20 2011 AUX User s Manual Authors BJ Kwon JH Park using a scalar operand This operator can actually take an amplitude vector and time mark vector to specify a dynamic amplitude adjustment For example ASDR attach sustain decay and sustain can be specified with this operator Example 7 A tone with fast attack like a piano sound tone 500 300 100 2 100 0 10 300 A tone with slow attach tone 500 300 100 2 100 0 200 300 2 12 Other conventions full scale order of operations In AUX we shall use 1 as the full scale And functions tone and noise produce the sound at the full scale at the amplitude of 1 In the current form AUX does not check whether the expression leads to clipping Therefore it is the user s responsibility to avoid clipping e g tone 440 300 tone 880 300 produces clipping A proper scaling is necessary such as 0 5 tone 440 300 0 5 tone 880
15. to val and its order is randomly permuted is generated round Round up the value to the nearest integer fix Round toward zero ceil Round toward positive infinity note Usage of these functions are the same as MATLAB tbegin Get the beginning time in ms first time point where the signal is non null tend Get the ending time in ms last time point where the signal is non null mean Get the mean value of signal max min Get the maximum or minimum value of the signal Syntax tbegin signal tend signal mean signal min signal max signal Also the following functions are available for numerical calculation sin Sine cos Cosine log Natural log log10 10 base log abs Absolute value exp Exponential A a b a raised by b sqrt Sqrt root mod Modulo version 1 3 Page 9 of 11 last updated 6 20 2011 AUX User s Manual Authors BJ Kwon JH Park VI Other functions These functions were added recently I am certain that I will keep these but I haven t yet decided how to categorize them left Extract left or right channel from a stereo signal right Syntax left signal or right signal Arguments signal stereo signal fft Fast Fourier Transform or Inverse Fast Fourier Transform ifft This computes FFT of the signal and generates its spectrum in a two channeled signal Syntax fft signal nSamples 512 or ifft spectrum Arguments signal mono signal if stereo the second ri
Download Pdf Manuals
Related Search
Related Contents
MANUEL D`UTILISATION Graco Inc. Hydra-Clean 800-232 User's Manual Black & Decker MGD300 Owner's Manual Wi-Fi対応モバイル充電器 MPC 据付工事説明書 Showerhead and Arm Ducha Fija y Brazo Pomme de Douche et MB WebParts - User Manual Customer - v.3.2_FRENCH Epson XP-310 Start Here (Spanish) (B08 Barniz al agua Hidrófugo Invisible) Copyright © All rights reserved.
Failed to retrieve file