Index-> contents reference index search Up-> SPT_HELP SignalGeneratorMain sawwave Prev Next SPT_HELP-> SPTFunctionsByCategory Mathematical Functions Data Manipulation Functions SignalGeneratorMain AnalogFilterFunctions FIR Filter Design Window Functions IIR Filter Design FourierFunctions Plotting Functions Histogram Functions SignalGeneratorMain-> binbits nrzbits awgn cawgn ammod pmmod fmmod quadmod sinwave triwave sawwave sqrwave RandNumGens OtherSigGen sawwave Headings-> Description Example

Create a SAWTOOTH Waveform
 Syntax `y = sawwave(`fc,pc,fs,N`)` Syntax `y = sawwave(`fc,pc,fs,N,M`)` Include: `include spt\sawwave.oms` See Also sinwave , sqrwave , triwave
``` ARGUMENTS:    INPUTS:      'fc'       = SCALAR, any numerical type. Center frequency [Hz]                   Coerced to DOUBLE for local processing.      'pc   '    = SCALAR, any numerical type, Constant phase angle                   of carrier [radians]. Coerced to DOUBLE for                   local processing.      'fs'       = SCALAR, any numerical type. Sampling rate                   [Samples/second]. Coerced to DOUBLE for local                   processing.      'N'        = SCALAR, any numerical type. Requested row                   dimension (number of samples). Coerced to DOUBLE                   for local processing.      'M'        = SCALAR, any numerical type. Requested column                   dimension (optional). Coerced to DOUBLE for local                   processing.    RETURN: MATRIX, DOUBLE, each column being a sampled sawtooth            waveform with the requested parameters. ```
Description ``` ```This function generates samples from a sawtooth shaped waveform. The frequency of the waveform in [Hz] is specified through argument 'fc'. A delay in the waveform, expressed in [radians] is input via argument 'pc'. The sampling rate of the system is given through 'fs' in [Samples/second]. All of these may be of any numerical type and are all coerced to DOUBLE for local processing. The number of requested samples in given through argument 'N' and will be the row dimension of the returned matrix. If 'M' is included a matrix will be returned where each of M columns is an identical copy of the requested waveform. If 'M' is omitted a column vector is returned. ``` ```The returned waveform starts at zero for zero 'pc' and consists of samples taken from a waveform with peak value 1.0.

Example
Create 2 columns of 16 samples of a 1 Hz sawtooth waveform sampled at 16 Samples/second. ``` O>format double "f6.3" O>sawwave(1,0,16,16,2) { [  0.000 ,  0.000 ] [  0.125 ,  0.125 ] [  0.250 ,  0.250 ] [  0.375 ,  0.375 ] [  0.500 ,  0.500 ] [  0.625 ,  0.625 ] [  0.750 ,  0.750 ] [  0.875 ,  0.875 ] [ -1.000 , -1.000 ] [ -0.875 , -0.875 ] [ -0.750 , -0.750 ] [ -0.625 , -0.625 ] [ -0.500 , -0.500 ] [ -0.375 , -0.375 ] [ -0.250 , -0.250 ] [ -0.125 , -0.125 ] ```