spec.parzen: Smoothed periodogram using a Parzen window

View source: R/HMClust.R

spec.parzenR Documentation

Smoothed periodogram using a Parzen window

Description

One-side estimated spectrum using a lag window estimador with a parzen window.

Usage

spec.parzen(x, a = 100, dt = 1, w0 = 10^(-5), wn = 1/(2 * dt), nn = 512)

Arguments

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).

Value

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.

Author(s)

Carolina Euan.

Examples

#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="")

CarolinaEuan/HMClust documentation built on Feb. 18, 2024, 10 p.m.