SignalProcessing
GenerateTone
generate a tone
Calling Sequence
Parameters
Options
Description
Thread Safety
Examples
Compatibility
GenerateTone( n, magnitude, frequency, phase )
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)
container : Array, predefined Array for holding results
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].
The SignalProcessing[GenerateTone] command is thread-safe as of Maple 17.
For more information on thread safety, see index/threadsafe.
with⁡SignalProcessing:
GenerateTone⁡10,1,1π,π
−1.0.4161468364414230.653643621350037−0.9601702863236700.1455000321309770.839071530285352−0.843853957257653−0.1367372214521730.957659481417869−0.660316704993774
The container option can be used to put generated values into a predefined Array.
c≔Array⁡1..10,datatype=float8,order=C_order:
GenerateTone⁡10,1,1π,π,container=c
c
SignalPlot⁡GenerateTone⁡100,1,1π,π
nSamples≔200:
RelativeFrequency≔0.02:
signal≔Array⁡GenerateTone⁡nSamples,1,RelativeFrequency,0
signal≔1.,0.992114701314478,0.968583161128631,0.929776485888251,0.876306680043864,0.809016994374947,0.728968627421412,0.637423989748690,0.535826794978997,0.425779291565073,0.309016994374947,0.187381314585725,0.0627905195293133,−0.0627905195293134,−0.187381314585725,−0.309016994374947,−0.425779291565073,−0.535826794978997,−0.637423989748690,−0.728968627421411,−0.809016994374947,−0.876306680043864,−0.929776485888251,−0.968583161128631,−0.992114701314478,−1.,−0.992114701314478,−0.968583161128631,−0.929776485888251,−0.876306680043863,−0.809016994374948,−0.728968627421412,−0.637423989748690,−0.535826794978996,−0.425779291565072,−0.309016994374948,−0.187381314585725,−0.0627905195293132,0.0627905195293128,0.187381314585724,0.309016994374947,0.425779291565072,0.535826794978997,0.637423989748689,0.728968627421411,0.809016994374947,0.876306680043864,0.929776485888251,0.968583161128631,0.992114701314478,1.,0.992114701314478,0.968583161128631,0.929776485888251,0.876306680043864,0.809016994374947,0.728968627421412,0.637423989748690,0.535826794978996,0.425779291565073,0.309016994374948,0.187381314585725,0.0627905195293142,−0.0627905195293136,−0.187381314585725,−0.309016994374947,−0.425779291565073,−0.535826794978997,−0.637423989748691,−0.728968627421412,−0.809016994374947,−0.876306680043864,−0.929776485888251,−0.968583161128631,−0.992114701314478,−1.,−0.992114701314478,−0.968583161128631,−0.929776485888252,−0.876306680043863,−0.809016994374948,−0.728968627421412,−0.637423989748691,−0.535826794978996,−0.425779291565072,−0.309016994374948,−0.187381314585726,−0.0627905195293134,0.0627905195293126,0.187381314585725,0.309016994374947,0.425779291565072,0.535826794978997,0.637423989748689,0.728968627421412,0.809016994374947,0.876306680043864,0.929776485888251,0.968583161128631,0.992114701314478,…,⋯ 100 Array entries not shown
A plot of the signal vs the index position (note that this is not equal to time):
SignalPlot⁡signal
To plot the signal vs time, the sampling rate and signal frequency are required:
SamplingRate≔1000:
SignalPlot⁡signal,samplerate=SamplingRate⁢RelativeFrequency
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
Download Help Document
What kind of issue would you like to report? (Optional)