Re: graphing frequency & amplitude?
- To: mathgroup at smc.vnet.net
- Subject: [mg79232] Re: graphing frequency & amplitude?
- From: Bill Rowe <readnewsciv at sbcglobal.net>
- Date: Sat, 21 Jul 2007 04:36:03 -0400 (EDT)
On 7/20/07 at 3:16 AM, efifer at fas.harvard.edu wrote:
>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]
I don't see why you see the plot as plotting time. Possibly part
of the issue is your choice as to sampling interval and the
number of samples.
Rather than sample over a large number of cycles, try sampling
over one cycle, i.e.,
data = Table[N[10*Sin[200*t] + 10*Sin[100*t]],
{t, 0, 2*(Pi/50), Pi/(128*50)}];
Also, I think the plot you get from
ListPlot[Abs[Fourier[data]], PlotRange -> All]
will be clearer than if you join the points.
--
To reply via email subtract one hundred and four