Keyboard-controlled interactive power spectrum demonstrator, useful for teaching and learning about the power spectra of different types of signals and the effect of signal duration and sampling rate. Single keystrokes allow you to select the type of signal (12 different signals included), the total duration of the signal, the sampling rate, and the global variables f1 and f2 which are used in different ways in the different signals. When the Enter key is pressed, the signal (y) is sent to the Windows WAVE audio device. Press K to see a list of all the keyboard commands.
T. C. O'Haver (email@example.com), Version 2, October, 2011. Added: 'Y' key cycles through 4 plot modes: linear x,y. linear x, log y; log x, linear y; and log-log. 'H' key switches between frequency and period x scale on power spectrum graph in lower window.
Adjust signal duration 10% up/down......A,Z
Adjust sampling rate 10% up/down........S,X
Adjust first variable 10% up/down...... D,C
Adjust second variable 10% up/down..... F,V
Cycle through Linear/Log plot modes.......L
Switch X-axis scale of power spectrum.....H
Print keyboard commands...................K
Play signal as sound.............Enter or P
` Sine wave, frequency f1 (Hz), phase f2
1 Square wave, frequency f1 (Hz), phase f2
2 Sawtooth wave, frequency Ff1(Hz)
3 Triangle wave, frequency f1 (Hz), phase f2
4 Sine wave burst of frequency f1 (Hz) and length f2 sec
5 440 Hz carrier amplitude modulated by sine wave, frequency f1 (Hz) and amplitude f2
6 440 Hz carrier frequency modulated by sine wave of frequency f1 (Hz) and amplitude f2
7 Sine wave, frequency f1 (Hz), modulated with Gaussian of width f2 sec
8 Sine wave, frequency f1 (Hz) with non-linear transfer function f2
9 Sine wave sweep from 0 to f1 (Hz)
0 Sine wave of frequency f1 (Hz) and amplitude f2 plus random white noise
- Pink (1/f) noise
= Sine wave, frequency f1 (Hz), amplitude f2 plus pink noise
Tom O'Haver (2022). iPower: Interactive Power Spectrum Demonstrator, Version 2 (https://www.mathworks.com/matlabcentral/fileexchange/31462-ipower-interactive-power-spectrum-demonstrator-version-2), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Inspired by: Interactive Power Spectrum Demo, Version 2
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!