GenerateTone - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


SignalProcessing

  

GenerateTone

  

generate a tone

 

Calling Sequence

Parameters

Options

Description

Thread Safety

Examples

Compatibility

Calling Sequence

GenerateTone( n, magnitude, frequency, phase )

Parameters

n

-

posint, number of samples to generate

magnitude

-

realcons, magnitude of the signal

frequency

-

realcons, the frequency relative to the sampling frequency; with value 0 <= frequency < 1/2 (Nyquist sampling frequency)

phase

-

realcons, the phase of the signal (0 <= phase < 2Pi)

Options

• 

container : Array, predefined Array for holding results

Description

• 

The GenerateTone(n, magnitude, frequency, phase ) command generates n samples for a tone (sinusoidal) signal with the indicated values for the magnitude, frequency and phase. The result is returned in an Array with datatype float[8].

• 

If the container=c option is provided, then the results are put into c and c is returned. With this option, no additional memory is allocated to store the result. The container must be an Array of size n having datatype float[8].

Thread Safety

• 

The SignalProcessing[GenerateTone] command is thread-safe as of Maple 17.

• 

For more information on thread safety, see index/threadsafe.

Examples

withSignalProcessing&colon;

GenerateTone10&comma;1&comma;1π&comma;π

−1.0.4161468364414230.653643621350038−0.9601702863236710.1455000321309760.839071530285352−0.843853957257653−0.1367372214521720.957659481417870−0.660316704993773

(1)

The container option can be used to put generated values into a predefined Array.

cArray1..10&comma;datatype=float8&comma;order=C_order&colon;

GenerateTone10&comma;1&comma;1π&comma;π&comma;container=c

−1.0.4161468364414230.653643621350038−0.9601702863236710.1455000321309760.839071530285352−0.843853957257653−0.1367372214521720.957659481417870−0.660316704993773

(2)

c

−1.0.4161468364414230.653643621350038−0.9601702863236710.1455000321309760.839071530285352−0.843853957257653−0.1367372214521720.957659481417870−0.660316704993773

(3)

SignalPlotGenerateTone100&comma;1&comma;1π&comma;π

 

nSamples200&colon;

RelativeFrequency0.02&colon;

signalArrayGenerateTonenSamples&comma;1&comma;RelativeFrequency&comma;0

signal1.&comma;0.992114701314478&comma;0.968583161128631&comma;0.929776485888252&comma;0.876306680043864&comma;0.809016994374948&comma;0.728968627421413&comma;0.637423989748692&comma;0.535826794978999&comma;0.425779291565076&comma;0.309016994374951&comma;0.187381314585729&comma;0.0627905195293178&comma;−0.0627905195293086&comma;−0.187381314585719&comma;−0.309016994374942&comma;−0.425779291565067&comma;−0.535826794978991&comma;−0.637423989748685&comma;−0.728968627421407&comma;−0.809016994374943&comma;−0.876306680043860&comma;−0.929776485888248&comma;−0.968583161128629&comma;−0.992114701314477&comma;−1.00000000000000&comma;−0.992114701314479&comma;−0.968583161128633&comma;−0.929776485888255&comma;−0.876306680043868&comma;−0.809016994374954&comma;−0.728968627421419&comma;−0.637423989748699&comma;−0.535826794979006&comma;−0.425779291565084&comma;−0.309016994374959&comma;−0.187381314585738&comma;−0.0627905195293262&comma;0.0627905195292995&comma;0.187381314585711&comma;0.309016994374934&comma;0.425779291565060&comma;0.535826794978984&comma;0.637423989748678&comma;0.728968627421401&comma;0.809016994374938&comma;0.876306680043856&comma;0.929776485888245&comma;0.968583161128627&comma;0.992114701314475&comma;1.&comma;0.992114701314480&comma;0.968583161128636&comma;0.929776485888258&comma;0.876306680043873&comma;0.809016994374959&comma;0.728968627421425&comma;0.637423989748705&comma;0.535826794979014&comma;0.425779291565092&comma;0.309016994374968&comma;0.187381314585746&comma;0.0627905195293359&comma;−0.0627905195292909&comma;−0.187381314585702&comma;−0.309016994374925&comma;−0.425779291565051&comma;−0.535826794978976&comma;−0.637423989748671&comma;−0.728968627421394&comma;−0.809016994374932&comma;−0.876306680043851&comma;−0.929776485888242&comma;−0.968583161128624&comma;−0.992114701314474&comma;−1.00000000000000&comma;−0.992114701314481&comma;−0.968583161128638&comma;−0.929776485888262&comma;−0.876306680043877&comma;−0.809016994374965&comma;−0.728968627421431&comma;−0.637423989748713&comma;−0.535826794979022&comma;−0.425779291565100&comma;−0.309016994374976&comma;−0.187381314585755&comma;−0.0627905195293443&comma;0.0627905195292813&comma;0.187381314585693&comma;0.309016994374916&comma;0.425779291565043&comma;0.535826794978968&comma;0.637423989748664&comma;0.728968627421388&comma;0.809016994374927&comma;0.876306680043846&comma;0.929776485888238&comma;0.968583161128622&comma;0.992114701314473&comma;&comma;⋯ 100 Array entries not shown

(4)

A plot of the signal vs the index position (note that this is not equal to time):

SignalPlotsignal

To plot the signal vs time, the sampling rate and signal frequency are required:

SamplingRate1000&colon;

SignalPlotsignal&comma;samplerate=SamplingRateRelativeFrequency

Compatibility

• 

The SignalProcessing[GenerateTone] command was introduced in Maple 17.

• 

For more information on Maple 17 changes, see Updates in Maple 17.

See Also

GenerateSlope

GenerateTriangle

SignalPlot