({{, (RefLink[PeriodogramArray, paclet:ref/PeriodogramArray])[list] 
returns the squared magnitude of the discrete Fourier transform (power spectrum) of list.}, {, (RefLink[PeriodogramArray, paclet:ref/PeriodogramArray])[list,n]
averages the power spectra of non-overlapping partitions of length n.}, {, (RefLink[PeriodogramArray, paclet:ref/PeriodogramArray])[list,n,d]
uses partitions with offset d.}, {, (RefLink[PeriodogramArray, paclet:ref/PeriodogramArray])[list,n,d,wfun]
applies a smoothing window wfun to each partition.}, {, (RefLink[PeriodogramArray, paclet:ref/PeriodogramArray])[list,n,d,wfun,m]
pads partitions with zeros to length m prior to the computation of the transform.}, {, (RefLink[PeriodogramArray, paclet:ref/PeriodogramArray])[image,…]
returns the squared power spectrum of image.}, {, (RefLink[PeriodogramArray, paclet:ref/PeriodogramArray])[audio,…]
returns the squared power spectrum of audio.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[PeriodogramArray, paclet:ref/PeriodogramArray]) works with numeric arrays of any rank, 2D and 3D images, and sound objects.

In (RefLink[PeriodogramArray, paclet:ref/PeriodogramArray])[list,n,d,wfun], the smoothing window wfun can be specified using a window function that will be sampled between -1/2 and 1/2 or a list of length n. The default window is (RefLink[DirichletWindow, paclet:ref/DirichletWindow]), which effectively does no smoothing.

(RefLink[PeriodogramArray, paclet:ref/PeriodogramArray])[list,n] is equivalent to (RefLink[PeriodogramArray, paclet:ref/PeriodogramArray])[list,n,n,(RefLink[DirichletWindow, paclet:ref/DirichletWindow]),n].

(RefLink[PeriodogramArray, paclet:ref/PeriodogramArray])[list,{(Subscript[n, 1]),(Subscript[n, 2]),…}] partitions a nested list into blocks of size (Subscript[n, 1])×(Subscript[n, 2])×… .

For multidimensional arrays, n is taken to be equivalent to {n,n,…}.

(RefLink[PeriodogramArray, paclet:ref/PeriodogramArray]) works with numeric lists, as well as (RefLink[Audio, paclet:ref/Audio]) and (RefLink[Sound, paclet:ref/Sound]) objects.

For multichannel sounds and images, (RefLink[PeriodogramArray, paclet:ref/PeriodogramArray]) is computed for each channel separately.

(RefLink[PeriodogramArray, paclet:ref/PeriodogramArray]) accepts the (RefLink[FourierParameters, paclet:ref/FourierParameters]) option. The default setting is (RefLink[FourierParameters, paclet:ref/FourierParameters])->{0,1}.

OpenersPrimaryExamplesSection(Spacer1)Examples  (14)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Power spectrum of a list:

PeriodogramArray[{0,1,0,-1,0,1,0,-1}]

Power spectrum of a noisy dataset:

data=Table[0.7 Sin[0.2 π n]+Sin[0.5 π n]+RandomReal[{-1,1}],{n,0,127}];

ListLinePlot[PeriodogramArray[data],PlotRange->All]

Power spectrum of a texture image:

s=PeriodogramArray[];
ImageAdjust[Image[Log10[s]]]

OpenersExampleSection1(Spacer1)Scope  (4)

Specify the partition length:

PeriodogramArray[{0,1,0,-1,0,1,1,-1},4]

Use overlapping partitions:

PeriodogramArray[{0,1,0,-1,0,1,1,-1},4,2]

Smooth with a Hamming window:

PeriodogramArray[{0,1,0,-1,0,1,1,-1},4,2,HammingWindow]

Use a numerical array as a custom smoothing window:

PeriodogramArray[{0,1,0,-1,0,1,1,-1},4,2,{.5,1,1,.2}]

Increase the length of the discrete Fourier transform to smooth the power spectrum data:

data=Table[0.7 Sin[0.2 π n]+Sin[0.5 π n]+RandomReal[{-1,1}],{n,0,127}];

Table[ListLinePlot[10 Log[10,PeriodogramArray[data,32,32,DirichletWindow,m][[1;;Floor[m/2]]]],PlotRange->All],{m,{32,128}}]

Power spectrum of an image:

PeriodogramArray[]//MatrixForm

Visualization of a 3D power spectrum of a modulated pulse:

data3D=PadRight[ConstantArray[1,{15,15,20}],{64,64, 64}] Table[Cos[(π/32)11z]Cos[(π/32) 9 y] Cos[(π/32) 15 x] ,{z,0,63},{y,0,63},{x,0,63}];

power3=PeriodogramArray[data3D][[1;;32,1;;32,1;;32]];
Image3D[power3,ImageSize->200,Axes->True,AxesLabel->{"x","y","z"}]

OpenersExampleSection2(Spacer1)Options  (1)

OpenersExampleSubsection0(Spacer1)FourierParameters  (1)

Change in the first Fourier parameter affects scaling:

PeriodogramArray[{1,0,0,0,0,0,0,0},FourierParameters->{0, -1}]

PeriodogramArray[{1,0,0,0,0,0,0,0},FourierParameters->{1, -1}]

Change in the second Fourier parameter does not affect the result:

PeriodogramArray[{1,0,0,0,0,0,0,0},FourierParameters->{0, 1}]

OpenersExampleSection3(Spacer1)Properties & Relations  (4)

Verification of Parseval's theorem:

x=RandomReal[{-1,1}, 8];
Total[x^2]==Total[PeriodogramArray[x]]

Comparison with (RefLink[ListFourierSequenceTransform, paclet:ref/ListFourierSequenceTransform]):

x=Table[Sin[0.45 π n + 1.]+RandomReal[{-1,1}],{n,0,31}];

dtft=Abs[ListFourierSequenceTransform[x,ω]^2]/32;

dft = PeriodogramArray[x];

{ListLinePlot[dft, DataRange->{0, 2Pi}, PlotRange->All],Plot[dtft, {ω, 0, 2Pi}, PlotRange->All]}

With partitions longer than the list, a zero-padded version of the list is used:

PeriodogramArray[{0,1,0,-1,0,1,0,-1},16]

Use logarithmic scaling to visualize the power spectra of an image:

s=PeriodogramArray[];
ImageAdjust[Image[Log[10,RotateLeft[#,{64,64}]]]]&/@s

ColorCombine[%]

OpenersExampleSection4(Spacer1)Possible Issues  (1)

When averaging over partitions, Parseval's theorem may be violated:

x=Table[Sin[0.45 π n + 1.]+RandomReal[{-1,1}],{n,0,31}];

Total[x^2]/Length[x]==Total[p=PeriodogramArray[x]]/Length[p]

Total[x^2]/Length[x]==Total[p=PeriodogramArray[x, 30]]/Length[p]

OpenersExampleSection5(Spacer1)Neat Examples  (1)

3D visualization of a stack of 2D power spectra of a modulated pulse:

data3D=Table[PadRight[ConstantArray[1,{15,10}],{64,64}] Table[Cos[(π/32) u[[1]] n] Cos[(π/32) u[[2]] m] ,{n,0,63},{m,0,63}],{u,Table[Round[{10 Cos[θ],10 Sin[θ]}+16],{θ,0,4 π-((2π)/64),((2π)/32)}]}];
power=PeriodogramArray[#][[1;;32,1;;32]]&/@data3D;
Graphics3D[Raster3D[power,ColorFunction->"AvocadoColorsOpacity"], ImageSize->200]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Periodogram, paclet:ref/Periodogram])  ▪  (RefLink[ImagePeriodogram, paclet:ref/ImagePeriodogram])  ▪  (RefLink[Fourier, paclet:ref/Fourier])  ▪  (RefLink[Partition, paclet:ref/Partition])  ▪  (RefLink[SpectrogramArray, paclet:ref/SpectrogramArray])  ▪  (RefLink[DirichletWindow, paclet:ref/DirichletWindow])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Signal Processing, paclet:guide/SignalProcessing])}, {▪(RefLinkPlain[Fourier Analysis, paclet:guide/FourierAnalysis])}, {▪(RefLinkPlain[Audio Representation, paclet:guide/AudioRepresentation])}})}})