Re: graphing frequency & amplitude?
- To: mathgroup at smc.vnet.net
- Subject: [mg79209] Re: [mg79153] graphing frequency & amplitude?
- From: DrMajorBob <drmajorbob at bigfoot.com>
- Date: Sat, 21 Jul 2007 04:24:09 -0400 (EDT)
- References: <21958580.1184920759674.JavaMail.root@m35>
- Reply-to: drmajorbob at bigfoot.com
ListPlot's x-scale, as you're using it, is the numbers 1 to n, where n = 101 is the length of "data". If you want a different scale, you need to construct it. For instance, data = Table[10*Sin[200 t] + 10*Sin[100 t], {t, 0, 100}]; absF = Abs@Fourier@data; The corresponding frequencies (per cycle) are frequencies = Range[0, 100]/101; ListPlot[Transpose@{frequencies, absF}, Joined -> True, PlotRange -> All] Bobby On Fri, 20 Jul 2007 02:16:20 -0500, <efifer at fas.harvard.edu> wrote: > Hi, > > I am trying to create a graph that graphs frequency versus amplitude of > a sound > made by the sum of two sine waves. I tried fourier transforming them and > graphing it, yet it looks to me like the graph is plotting time rather > than > frequency. How do I change this? > > Plot[10*Sin[200t] + 10*Sin[100t], {t, 0, 1}] > > data = Table[10*Sin[200t] + 10*Sin[100t], {t, 0, 100}] > > ListPlot[Abs[Fourier[data]], PlotJoined -> True, PlotRange -> All] > > Thank you for the help! > Emily > > > -- DrMajorBob at bigfoot.com