5.3.1 Basic demos
These demos illustrate the use of certain stars without necessarily performing functions that are sophisticated. The palette is shown in figure
5-22. The demos are described below from left to right, top to bottom.
butterflyUse sines and cosines to compute a curve known as the butterfly curve, invented by T. Fay. The curve is plotted in polar form.
chaoticNoiseChaotic Markov map example with a nonlinear feedback loop.
comparisonCompare two sinusoidal signals using the
complexExponentialGenerate and plot a complex exponential.
delayTestIllustrates the use of initializable delays.
lmsFreqDetectIllustrate the use of the LMS algorithm to estimate the dominant sinusoidal frequency in the input signal.
freqPhaseOffsetImpose frequency jitter and phase offset on a sinusoid using the
gaussianGenerate a Gaussian white noise signal, and plot its histogram and estimated autocorrelation.
integratorDemonstrate the features of the integrator star, such as limiting, leakage, and resetting.
ModuloDemonstrate modulus computation for float and integer data types.
DeMuxstars, which perform multiplexing and demultiplexing. Contrast with the
quantizeDemonstrate the use of the
scrambleThis system rearranges the order of samples of signal using the
Distributorstars. Note that because these are multirate stars, one iteration involves more than one sample. Contrast with the
sinModModulate a sinusoid by multiplying by another sinusoid.
tbusIllustrate the bus facility in Ptolemy, in which multiple signals are combined onto a single graphical connection.
FIRCxstar filter to reduce the sample rate of a sinusoid by a factor of 8/5, and at the same time produce a complex approximately analytic signal (one that has no negative frequency components).
brokenGive an example of an inconsistent SDF system. It fails to run, generating an error message instead.
downSampleConvert from the digital audio tape sampling rate (48 kHz) to the compact disc sampling rate (44.1 kHz). The conversion is performed in multiple stages for better performance.
filterBankImplement an eight-level perfect reconstruction one-dimensional filter bank based on the biorthogonal wavelet decomposition.
filterBank-NonUniformImplement a simple split of the frequency domain into two non-uniform frequency bands.
interpUse an FIR filter to upsample by a factor of 8 and linearly interpolate between samples.
multirateUpsample a sinusoidal signal by a ratio of 5/2 using a polyphase lowpass interpolating FIR filter.
upSampleConvert from the compact disc sampling rate (44.1 kHz) to the digital audio tape sampling rate (48 kHz). The conversion is performed in multiple stages for better performance.
constellationA 16-QAM signal is sent through a baseband equivalent channel that simulates the following impairments: frequency offset, phase jitter and white Gaussian noise.
DTMFCodecDual-Tone Modulated Frequency Demo. Generate touch tones and decode the based on the Goertzel Algorithm.
eyePlot an eye diagram for a binary antipodal signal with a raised-cosine pulse shape and user controlled noise.
lmsDTMFCodecDual-Tone Modulated Frequency Demo. Generate touch tones
lossySpeechIllustrate the effect on speech of a zero-substitution policy in a network (such as ATM) with 48 byte packets and a variable loss probability. Note that this demo requires audio capability and will probably only work on Sun workstations.
modemBaseband model of a 16-QAM modem.
pseudoRandomGenerate a pseudo-random sequence of zeros and ones using a maximal-length shift register and test its randomness by estimating it autocorrelation.
pulsesGenerate raised cosine and square-root raised cosine pulses and demonstrate matched filtering with the square-root raised cosine pulse.
xmitberBit Error determination through simulation at various noise levels.
xmit2recSimple 2-level PAM communication system (matched filtering at the receiver).
xmit4recSimple 4-level PAM communication system (no filtering at the receiver).
qamProduce a 16-point quadrature amplitude modulated (QAM) signal and displays the eye diagram for the in-phase part, the constellation, and the modulated transmited signal.
QAM4withDFEThis is a model of a digital communication system that uses quadrature amplitude modulation (QAM) and a fractionally spaced decision feedback equalizer.
codeDecodeEncode and decode a 16-QAM signal using differential encoding for the quadrant and Gray coding for the point within the quadrant.
plldemoSimulate a fourth-power optical phase-locked loop with laser phase noise and additive Gaussian white noise operating on a complex baseband envelope model of the signal.
telephoneChannelTestAssuming a sampling rate of 8 kHz, a sinusoid at 500 Hz is transmitted through a simulation of a telephone channel with additive Gaussian noise, nonlinear distortion, and phase jitter.
adaptFilterAn LMS adaptive filter converges so that its transfer function matches that of a fixed FIR filter.
allPoleTwo realizations of an all-pole filter are shown to be equivalent. One uses an FIR filter in a feedback path, the other uses the
animatedLMSAn LMS adaptive filter is configured as in the
adaptFilterdemo, but this time the filter taps are displayed as they adapt.
animatedLMSCxA complex LMS adaptive filter is configured as in the
adaptFilterdemo, but in addition, user-controlled noise is added to the feedback loop using an on-screen slider to control the amount of noise. The filter taps are displayed as they adapt.
cepGiven the coefficients of any polynomial, this demo uses the cepstrum to find a minimum-phase polynomial. Thus, given the coefficients of the denominator polynomial of an unstable filter, this demo will compute the coefficients of a stable denominator polynomial that has the same magnitude frequency response.
chaosThis is a simple demonstration of chaos, in which the phase-space plot of the famous Henon map is given.
convolveConvolve two rectangular pulses in order to demonstrate the
dftCompute a discrete Fourier transform of a finite signal using the
FFTstar. The magnitude and phase (unwrapped) are plotted.
dopplerA sine wave is subjected to four successive amounts of doppler shift. The doppler shift is accomplished by the
phaseShiftgalaxy, which forms an analytic signal (using a Hilbert transform) that modulates a complex exponential.
DTFTstar, showing how it is different from the
FFTCxstar. Specifically, the range, number, and spacing of frequency samples is arbitrary.
freqsampleThis system designs FIR filters using the frequency sampling method. Samples of the frequency response are converted into FIR filter coefficients.
iirDemoTwo equivalent implementations of IIR filtering.
latticeDemonstrate the use of lattice filters to synthesize an auto-regressive (AR) random process.
latticeDesignUse of Levinson-Durbin algorithm to design a lattice filter with a specified transfer function.
levinsonDurbinUse the Levinson-Durbin algorithm to estimate the parameters of an AR process.
overlapAddFFTConvolution is implemented in the frequency domain using overlap and add.
phasedArraySimulate a plane wave approaching a phased array with four sensors. The plane wave approaches from angles starting from head on and slowly rotating 360 degrees. The response of the antenna is plotted as a function of direction of arrival in polar form.
powerSpectrumCompare three methods for estimating a power spectrum of a signal with three sinusoids plus colored noise. The three methods are the periodogram method, the autocorrelation method, and Burg's method.
timeVarSpecA time-varying spectrum is computed using the autocorrelation method and displayed using a waterfall plot.
windowGenerate and display four window functions and the magnitude of their Fourier transforms. The windows displayed are the Hanning, Hamming, Blackman, and steep Blackman.
ptplayis in your path, and that it accepts data of an appropriate format and will play it over a workstation speaker at an 8 kHz sample rate. If you are using a Sun SPARCStation, these conditions will most likely be satisfied, if your path is correct. The
ptplayprogram has also been used on SGI Indigos and HP 700s and 800s. If you are on an HP, you may need other publicly available software.The samples are written into a file before they are played. Since a large number of samples must be generated, these demos can take some time to run. By contrast, the CGC domain has some audio demos that generate sounds in real time at 44.1kHz, assuming a reasonably fast workstation. For further information about playing audio files, see "Sounds" on page 2-38.
chirpplayChirp generator that plays on the workstation speaker.
fmplaySound generator using FM modulation that plays on the workstation speaker.
speechRead a speech signal from a file, and encode it at two bits per sample using adaptive differential pulse code modulation with a feedback-around-quantizer structure. The signal is then reconstructed from the quantized data. The original and reconstructed speech are played over the workstation speaker.
KSchordSimulation of plucked string sounds using the Karplus-Strong algorithm.
voxCoarticulation with an Adaptive Vocoder. The resulting FM synthesized sound is played over the workstation speaker.
blockVoxA block processed version of the vox demo.
lossySpeechIllustrate the effect on speech of a zero-substitution policy in a network (such as ATM) with 48 byte packets and a variable loss probability. This demo also appears in the basic demos palette
subbandcodingFour channel subband speech coding with APCM at 16kps.
BlendImageCombine two images and display the result.
bwDitherDemonstrate four different forms of black and white dithering: error diffusion, clustered dither, dispersed dither, and use custom mask.
cntrastEnhanceContrast enhancement by histogram modification.
ColorImageConvert an RGB (red-green-blue) format color image to YUV (luminance-hue-saturation) format and back, and then display it on the workstation screen.
CompareMedianMedian filter an image to reduce artifacts due to interleaved scanning in video sequences.
DctImagePerform discrete cosine transform (DCT) coding of an image sequence.
DpcmImagePerform differential pulse code modulation (DPCM) on an image sequence.
EdgeDetectDemonstrate four different forms of edge detection: Sobel, Roberts, Prewitt, and Frei-Chen.
MC_DCTPerform motion compensation and DCT encoding of video.
MotionCompPerform motion compensation video coding.
fullVQCodebkGenerate a codebook for full search vector quantization.
fullVQFull search vector quantization using codebook generated by
SGVQCodebkGenerate codebooks for shape-gain vector quantization.
SGVQShape-gain vector quantization using codebook from
MRVQCodeBkGenerate codebooks for mean-removed vector quantization using independent quantizer structure.
MRVQmeanCBGenerate codebook for mean-removed vector quantization.
MRVQshapeCBGenerate the shape codebook for mean-removed quantization using alternate structure. This universe uses the codebook generated by
MRVQMean-removed vector quantization.
fixConversionIllustration of the different masking options available.
fixFIREffect of filter tap precision on the frequency response.
fixIIRdfComparison of a fourth-order direct-form IIR filter implemented with floating-point arithmetic and a similar filter implemented with fixed-point arithmetic.
fixMpyTestTesting of fixed-point multiplication over a range of numbers by comparison against floating-point multiplication. The results should be the same.
animatedLMSSee "Digital signal processing demos" on page 5-55.
animatedLMSCxSee "Digital signal processing demos" on page 5-55.
TkSliderby creating a vertical array of radar sensors that can be move in the horizontal plane. Note that small movements of the sensors radically change the polar gain plot. This simulation demonstrates the importance of sensor calibration to performance of the sensor array.
TkBarGraphby generating and displaying a complex exponential.
TclScriptby generating two interactive X window follies that consist of circles that move in the same playing field.
TkMeterby creating three bar meters. The first oscillates sinusoidally. The second displays a random number between zero and one. The third displays a random walk.
TkTextby displaying the ASCII form of two ramp sequences.
xyplotDemonstrate the dynamic plotting capabilities of the
MatrixTest1Demonstrate the use of the Matrix stars that have one input. These include the operations inverse, transpose, and multiply by a scalar gain for all matrix types. Also conjugate and Hermitian transpose are available for the complex matrix type.
MatrixTest2Demonstrate the use of some simple Matrix stars with two inputs. These include multiply, add, and subtract.
MatrixTest3Demonstrate the use of the Matrix conversion stars. These convert between the scalar particles and the matrix particles as well as between the various matrix types.
initDelaysIllustrate the use of initializable delays with the
Kalman_MCompare the convergence properties of a Kalman filter to those of an LMS filter when addressing the problem of adaptive equalization of a process in noise.
SVD_MUSIC_1Show the use of singular-value decomposition (SVD) and the Multiple-Signal Characterization (MUSIC) algorithm to identify the frequency of a single sinusoid in a signal that has two different signal to noise ratios.
SVD_MUSIC_2Demonstrate the use of the Multiple-Signal Characterization (MUSIC) algorithm to identify three sinusoids in noise that have frequencies very close to each other.
matlab_hilbThis demo uses MATLAB as a signal source to produce a Hilbert matrix. The Hilbert matrix is an ill-conditioned matrix used to test the robustness of numerical linear algebra routines. The matrix element (i,j) has the value of 1 / (i + j - 1). The matrix values appear similar to the coefficients of a discrete Hilbert transformer.
matlab_eigThis demo shows the use of MATLAB to perform eigendecomposition of a 2 x 2 Hermitian symmetric complex matrix. A matrix of eigenvectors and a matrix of eigenvalues are produced. The eigenvalues are real because the input matrix is Hermitian symmetric
sombreroThis demo is an entire universe composed of a cascade of four MATLAB stars. The MATLAB stars are used a signal source and a signal sink. The overall system generates and plots a mathematical model of a two-dimensional sinc function that resembles a sombrero.
filterPrototypeThis system uses a halfband lowpass filter prototype for the lowpass and highpass filters. All parameters are computed using MATLAB.
5.3.12 Scripted Runs
A scripted run executes the tcl code in the run control panel tcl script window. Scripted runs can be used to set up interactive tutorials.The demos shown in figure
5-33 illustrate the use of scripted runs.
demoscriptAn interactive tutorial that leads a user through a session that runs a simple universe.
sinescriptThis demo runs the same sine wave modulation universe three times, each time with a different frequency.
xmitberThis demo runs a bit error determination universe at various noise levels and then plots the output.