Waveforms and Spectrograms

Manipulate[Grid[{{Style["two sine waves and their sum",FontFamily->"Times"],Style["spectrogram of sum with frequencies scaled by 100",FontFamily->"Times"]},{Plot[{amplitude1 Sin[frequency1 2 π t],amplitude2 Sin[frequency2 2 π t],amplitude1 Sin[frequency1 2 π t]+amplitude2 Sin[frequency2 2 π t]},{t,0,timewindow},PlotRange->{Automatic,(amplitude1+amplitude2){-1,1}},ImageSize->{300,250},PlotStyle->{{Red,Thick},{Blue,Thick},{Dashed,Black}}],Play[amplitude1 Sin[100 frequency1 2 π t]+amplitude2 Sin[100 frequency2 2 π t],{t,0,1},SampleRate->(2^13)]}}],{{frequency1,4,Style["frequency of wave 1",Red]},2,20,.05},{{amplitude1,2,"amplitude of wave 1"},0,3,.5},{{frequency2,10,Style["frequency of wave 2",Blue]},2,20,.05},{{amplitude2,1,"amplitude of wave 2"},0,3,.5},{{timewindow,1,"time window"},.25,2,.05}]

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Waveforms and Spectrograms" from The Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/WaveformsAndSpectrograms/

Contributed by: Charles Reiss (Concordia University, Montreal)

A full-function Wolfram Mathematica 6 system is required to edit this notebook.
GET WOLFRAM MATHEMATICA 6 »

© The Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »