Question

Right now I'm doing spectral analysis with sounds, and it is strange that drawing a graph with Periodogram[] doesn't give the same result as using PeridogramArray[] and then using ListLinePlot[]. Is there anything I am understanding wrong?

Source code:

test1 = Import["/Users/phillipchang/Desktop/sounds/test1.wav", 
  "SampledSoundList"]

Periodogram[test1]

ListLinePlot[PeriodogramArray[test1], PlotRange -> Automatic] 

No correct solution

OTHER TIPS

Any possibility you are working with stereo (or better) sounds?

http://reference.wolfram.com/mathematica/ref/PeriodogramArray.html "For multichannel sound and image objects, a list of power spectra of each channel is returned."

http://reference.wolfram.com/mathematica/ref/Periodogram.html "Periodogram also works with SampledSoundList objects. When applied to a multichannel sound object, it plots power spectra of all channels."

Click on "Details and Options" on each of those and read all the details. People seem to routinely skip right over "Details and Options."

I can't guess what your sound file is, but you might also consider using a windowing function to minimize artifacts introduced if your sound file does not contain an integral multiple of cycles for every frequency present in the file.

Good debugging method might be to construct a sound that is a single pure sine wave with an integral number of cycles, convince yourself that you are absolutely positive that file is correct and then try your code on it. Debug until the spectra is correct. Then add a second frequency, still integral number of cycles, to the file and repeat. When all that has been done then you may have eliminated the problem with your original file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top