Code covered by the BSD License  

Highlights from
Interactive Power Spectrum Demo, Version 2

4.0

4.0 | 1 rating Rate this file 24 Downloads (last 30 days) File Size: 119.17 KB File ID: #14951
image thumbnail

Interactive Power Spectrum Demo, Version 2

by Tom O'Haver

 

10 May 2007 (Updated 01 May 2011)

Interactive signal generator with power spectrum display and sound output

| Watch this File

File Information
Description

Digital signal generator (simulator) with power spectrum display and sliders for "real time" control, useful for teaching and demonstrating the power spectra of different types of signals and the effect of signal duration and sampling rate. Version 1.1 adds sound output. The signal slider selects from 10 different signals (you can change these in RedrawSpectrum.m). The Time slider controls the total duration of signal, the Rate slider controls the sample rate, and the F1 and F2 sliders control the global variables f1 and f2 which are used in different ways in the different signals. The Sound slider has only two settings: OFF (down) and ON (up). When Sound is ON, each time a slider is moved, the signal (y) is sent to the Windows WAVE audio device. When Sound is OFF, no sound is played when a slider is moved. However, even when Sound is OFF, clicking on the Sound slider plays the signal once for each click.

The 10 pre-programmed signals are:

Sine wave of frequency f1 (Hz) and phase f2;

Sine wave burst of frequency f1 (Hz) and duration f2;

Square wave of frequency f1 (Hz) and phase f2;

Sawtooth wave of frequency f1(Hz);
 
440 Hz carrier amplitude modulated by sine wave of frequency f1 (Hz) and amplitude f2;

440 Hz carrier frequency modulated by sine wave of frequency f1 (Hz) and amplitude f2;

Sine wave of frequency f1 (Hz) modulated by Gaussian pulse of width f2;

Random white noise;

Sine wave of frequency f1 (Hz) and amplitude f2 plus random white noise;

Sine wave sweep from 0 to f1 (Hz).

See http://terpconnect.umd.edu/~toh/spectrum/HarmonicAnalysis.html

T. C. O'Haver (toh@umd.edu), version 1.1, May, 2007

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
06 May 2008 Kartika Munir  
12 Aug 2008 Lei Qiu

good package

17 May 2011 Tom O'Haver

I've recently uploaded a new version of this, called "iPower" (File ID: #31462) that uses keyboard controls rather than sliders; works in recent version of Matlab.

Please login to add a comment or rating.
Updates
16 May 2007

Enhancements

18 Sep 2009

Slider function modified by commenting out lines 337 and 373
to prevent crash on Matlab 2008 and 2009.

01 May 2011

Expanded the description

Tag Activity for this File
Tag Applied By Date/Time
spectral analysis Tom O'Haver 22 Oct 2008 09:12:27
power spectrum signal harmonic sampling aliasing frequency times Tom O'Haver 22 Oct 2008 09:12:27
power spectrum signal harmonic sampling aliasing frequency times jay zhao 10 Jul 2010 07:11:16
spectral analysis SYSU 10 May 2011 05:21:43
spectral analysis Raffaele 19 Jul 2011 05:26:18

Contact us at files@mathworks.com