<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
#Function to determine the periodogram of a set of data.
#Written by Bob Sherman, Walter Willinger

 per &lt;- function (z)
          {n&lt;-length(z)
          (Mod(fft(z))^2/(2*pi*n)) [1:(n %/% 2 + 1)]}

#Function to determine the periodogram of a set of data for stable process.

#Writen by Vadim Teverovsky
 perstable &lt;- function (z)
          {n&lt;-length(z)
	   norm_sum((z^2)[1:n])
          (Mod(fft(z))^2/(2*pi*n*norm)) [1:(n %/% 2 + 1)]}





</pre></body></html>