       Re: Spectrum of a sound

• To: mathgroup at smc.vnet.net
• Subject: [mg39563] Re: Spectrum of a sound
• From: Bill Rowe <listuser at earthlink.net>
• Date: Sun, 23 Feb 2003 05:00:46 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```On 2/22/03 at 3:37 AM, thomasmartinuzzo at hotmail.com (thomas martinuzzo)
wrote:

>Can you explain to me this problem

>ClearAll["Global`*"]

>la3[t_]:=Sin[2 ¶­ 440 t]

>suite=Table[la3[t],{t,0,1/2,.0001}];

>ListPlot[suite,PlotJoined\[Rule] True]; nPoints=Length[suite]

>amplitude=Abs[Fourier[suite]];

>ListPlot[amplitude,PlotJoined\[Rule] True,PlotRange\[Rule]
>All,AxesLabel\[Rule] {Hz,dB}];

There are a couple of problems here.

First[ Fourier returns a list with the zero frequency term first. Generally, you want this to be in the center of the list. So, you need to ListPlot[RotateRight[amplitude,n/2]] to move the zero frequency term to the center.

Second, your labels imply you want the vertical axis in dB. But what you've plotted are the absolute values of the coefficients which will not be in dB. The usual scheme is to reference everything to the coefficient with the largest absolute value. So, to get dB you need 10 Log[10,amplitude/Max[amplitude]]

```

• Prev by Date: Re: Programing in MATHEMATICA
• Next by Date: Cursors in graphics
• Previous by thread: Spectrum of a sound
• Next by thread: How to use vector analysis without using suffix notation