### Demos - MATLAB

#### 2. Sinusoids7

Here's a demo that shows the nearly sinusoidal waveforms produced by two clay whistles.
PhasorRaces began as a speed drill for testing complex addition. Now it includes many other related operations that can be tested in a "drill" scenario: adding sinusoids, z-transforms, etc. A timer starts as soon as the problem is posed, so that a student can try to solve questions quickly and accurately.
Here are four movies showing rotating phasors and how the real part of the phasor traces out a sinusoid versus time. Two of the movies show how rotating phasors of different frequencies interact to produce complicated waveforms such as beat signals.
Sine Drill (sindrill) is a program that tests the users ability to determine basic parameters of a sinusoid. After a plot of a sinusoid is displayed, the user must correctly guess its amplitude, frequency, and phase.
This is an introduction to plotting sinusoids (both sine and cosine waves) from equations. The tutorial also reviews how to write the equation of the sinusoid given a plot of the waveform.
This demo shows how the size and stiffness of a tuning fork affect the tone produced by three different tuning forks.
ZDrill is a program that tests the users ability to calculate the result of simple operations on complex numbers. The program emphasizes the vectorial view of a complex number. The following six operations are supported:
• Subtract
• Multiply
• Divide
• Inverse
• Conjugate

#### 3. Spectrum Representation6

This demo shows the interesting situation that occurs when we have two sinusoidal signals of slightly different frequencies.
This demo gives the mathematical derivation of how instrument sounds can be synthesized using the principles of frequency modulation. The example sounds include a bell and a clarinet.
This MATLAB demo reconstructs a square, triangle, or sawtooth waveform, using a given number of Fourier Series coefficients.
Here are four movies showing rotating phasors and how the real part of the phasor traces out a sinusoid versus time. Two of the movies show how rotating phasors of different frequencies interact to produce complicated waveforms such as beat signals.
This demo illustrates the connection between a variety of sounds and their spectrograms. Among the different sounds are:
This demonstrates the idea of harmonic sinusoids. Five sinusoids with a common fundamental frequency are added together, one at a time.

#### 4. Sampling and Aliasing6

Here are some movies that illustrate the concepts of aliasing and folding when a sinusoid is sampled below the Nyquist rate.
By visualizing the spectrogram of a synthesized chirp and listening to the sound, we experience the fact that a D-to-C converter cannot create output signals with frequencies higher than one half of the sampling frequency.
The Continuous-Discrete Sampling Demo (con2dis) is a program that shows the continuous and discrete spectra (and signals) during sampling.
Features:
• Users can change the input frequency and sampling rate.
• Frequency axis can be labeled in hertz or radians/sec.
• Reconstruction through D/A is also shown.
Here are some movies that illustrate the reconstruction process
These movies give an alternate view of the sampling process by using the strobing nature of a camcorder (30 frames per second) to show aliasing of a pattern on a rotating disk.
These movies were generated in MATLAB to show the strobe/sampling effect on a rotating disk. With MATLAB the rotation rate can be calibrated exactly, so that forward and backward movement of the spokes on the disk (due to aliasing) can be tracked.

#### 5. FIR Filters3

The Discrete Convolution Demo (dconvdemo) is a program that helps visualize the process of discrete-time convolution.
Features:
• Users can choose from a variety of different signals.
• Signals can be dragged around with the mouse with results displayed in real-time.
• Tutorial mode lets students hide convolution result until requested.
• Various plot options enable the tool to be effectively used as a lecture aid in a classroom environment.
This block diagram demo illustrates the property of linearity in FIR filters. Click on any of the blocks, the input or the output for a close-up.
This block diagram demo illustrates the property of time-invariance in FIR filters. Click on any of the blocks, the input or the output for a close-up.

#### 6. Frequency Response of FIR Filters3

LTI FIR filters are used to process images, thus demonstrating that low-pass filtering is blurring, while high-pass filtering will sharpen edges.
DLTIDemo is a program that illustrates the relationship between the input and output of a discrete-time linear time-invariant (LTI) filter when the input is a sinusoidal function. The user is allowed to control the parameters of both the input sinusoid and the digital filter.
A brief introduction to FIR filters and how they can change the sound of speech signals.

#### 7. Discrete-Time Fourier Transform2

A table of DTFT pairs is usually given as a list of formulas for the signal $$x[n]$$ and its DTFT $$X(e^{j \hat\omega})$$. These formulas can be visualized as plots, and this demo focuses on the ability to recognize signals and transforms in a graphical form.
The Filter Design Demo is a program that designs simple FIR (and IIR) digital filters, along with tutorial visualizations of the filter design process.

Features:

• FIR Design with many different window types
• Numerous plot options: magnitude/phase response, pole-zero diagram, and impulse response
• IIR Design of Butterworth filters
• Parks-McClellan FIR Design showing the iterations of the Remez Exchange method

#### 8. Discrete Fourier Transform1

specgramdemo provides interactive control of the important parameters that define a spectrogram.

Features:

• Change window length and window type
• Change window overlap
• Change FFT length (zero padding)
• Show 1-D slice of spectrogram
• Plot options: zooming, 30, 40, 50 and 60 dB magnitude ranges, four color maps
• Three signal types: Sum of sinusoids, Linear chirp, Recorded signal, e.g., speech

#### 9. z-Transforms3

PeZ (pezdemo) is a MATLAB tool for pole/zero manipulation. Poles and zeros can be placed anywhere on a map of the $$z$$-plane. The corresponding time domain ($$n$$) and frequency domain ($$\hat\omega$$) plots will be displayed. When a zero pair (or pole pair) is dragged, the impulse response and frequency response plots will be updated in real time.
The connection between the Z-transform domain of poles and zeros and the time domain, and also the frequency domain is illustrated with several movies where individual zeros or zero pairs are moved continuously.
A demo that illustrates the connection between the complex $$z$$-plane and the frequency response of a system. The frequency response is obtained by evaluating $$H(z)$$ on the unit circle in the complex $$z$$-plane.

#### 10. IIR Filters5

The Filter Design Demo is a program that designs simple IIR (and FIR) digital filters, along with tutorial visualizations of the filter design process.

Features:

• IIR Design of Butterworth filters
• Numerous plot options: magnitude/phase response, pole-zero diagram, and impulse response
• FIR Design with many different window types
• Parks-McClellan FIR Design showing the iterations of the Remez Exchange method
A short tutorial on first- and second-order IIR (infinite-length impulse response) filters. This demo shows plots in the three domains for a variety of IIR filters with different filter coefficients.
PeZ (pezdemo) is a MATLAB tool for pole/zero manipulation. Poles and zeros can be placed anywhere on a map of the $$z$$-plane. The corresponding time domain ($$n$$) and frequency domain ($$\hat\omega$$) plots will be displayed. When a zero pair (or pole pair) is dragged, the impulse response and frequency response plots will be updated in real time.
The connection between the $$z$$-transform domain of poles and zeros and the time domain, and also the frequency domain is illustrated with several movies where individual poles, or zeros or pole pairs of IIR filters are moved continuously.
A demo that illustrates the connection between the complex $$z$$-plane and the frequency response of a system. The frequency response is obtained by evaluating $$H(z)$$ on the unit circle in the complex $$z$$-plane.

#### A. Complex Numbers3

Examples of how complex numbers and complex exponentials can be handled by MATLAB.
PhasorRaces began as a speed drill for testing complex addition. Now it includes many other related operations that can be tested in a "drill" scenario: adding sinusoids, z-transforms, etc. A timer starts as soon as the problem is posed, so that a student can try to solve questions quickly and accurately.
ZDrill is a program that tests the users ability to calculate the result of simple operations on complex numbers. The program emphasizes the vectorial view of a complex number. The following six operations are supported:
• Subtract
• Multiply
• Divide
• Inverse
• Conjugate

#### C. Fourier Series1

This MATLAB demo reconstructs a square, triangle, or sawtooth waveform, using a given number of Fourier Series coefficients.