spec.parzen | R Documentation |
One-side estimated spectrum using a lag window estimador with a parzen window.
spec.parzen(x, a = 100, dt = 1, w0 = 10^(-5), wn = 1/(2 * dt), nn = 512)
x |
Time series. |
a |
Bandwidth value. |
dt |
Sampling interval. Also, dt=1/Fs where Fs is the sampling frequency. Default value is 1. |
w0 , wn |
Range of frequencies of interest. By default (10^-5,Fs/2), where Fs is the sampling frequency. |
nn |
Number of evaluated frequencies in (w0,wn). |
A matrix of 2 columns and nn rows. Where the first column corresponds to the grid of frequencies and the second column corresponds to the spectrum at those frequencies.
Carolina Euan.
#spec.parzen
x<-cos(2*pi*(10/1000)*(1:1000))+rnorm(1000)/2
fest<-spec.parzen(x,a=300,dt=.1)
par(mfrow=c(2,1))
plot(seq(.1,100,.1),x,type="l",main="Time series",xlab="Time (sec)",ylab="")
plot(fest,type="l",lwd=2,main="Smoothed Periodogram \n Bandwidth = 300",xlab="w (Hz)",ylab="")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.