Displaying 20 results from an estimated 3000 matches similar to: "spectrum"
2019 Feb 14
0
Proposed speedup of spec.pgram from spectrum.R
Hello,
I propose two small changes to spec.pgram to get modest speedup when
dealing with input (x) having multiple columns. With plot = FALSE, I
commonly see ~10-20% speedup, for a two column input matrix and the speedup
increases for more columns with a maximum close to 45%. In the function as
it currently exists, only the upper right triangle of pgram is necessary
and pgram is not returned by
2008 Apr 30
3
Cross Spectrum Analysis
I am reading some documentation about Cross Spectrum Analysis as a technique
to compare spectra.
My understanding is that it estimates the correlation strength between
quasi-periodic structures embedded in two signals. I believe it may be
useful for my signals analysis.
I was referred to the R functions that implement this type of analysis. I
tried all the examples which generated a series of
2008 Jun 04
2
estimate phase shift between two signals
Hi,
Are there any functions in R that could be used to estimate the phase-shift
between two semi-sinusoidal vectors? Here is what I have tried so far, using
the spectrum() function -- possibly incorrectly:
# generate some fake data, normalized to unit circle
x <- jitter(seq(-2*pi, 2*pi, by=0.1), amount=pi/8)
# functions defining two out-of-phase phenomena
f1 <- function(x)
2004 Oct 15
1
power in a specific frequency band
Dear R users
I have a really simple question (hoping for a really simple answer :-):
Having estimated the spectral density of a time series "x" (heart rate
data) with:
x.pgram <- spectrum(x,method="pgram")
I would like to compute the power in a specific energy band.
Assuming that frequency(x)=4 (Hz), and that I am interested in the band
between f1 and f2, is the
2007 Jan 08
2
Simple spectral analysis
Hello world,
I am actually trying to transfer a lecture from Statistica to
R and I ran into problems with spectral analysis, I think I
just don't get it 8-(
(The posting from "FFT, frequs, magnitudes, phases" from 2005
did not enlighten me)
As a starter for the students I have a 10year data set of air
temperature with daily values and I try to
get a periodogram where the annual
2007 Dec 12
2
discrepancy between periodogram implementations ? per and spec.pgram
hello,
I have been using the per function in package longmemo to obtain a
simple raw periodogram.
I am considering to switch to the function spec.pgram since I want to be
able to do tapering.
To compare both I used spec.pgram with the options as suggested in the
documentation of per {longmemo} to make them correspond.
Now I have found on a variety of examples that there is a shift between
2007 Dec 14
1
Help! - boxcox transformations
Hi,
Hope this does not sound too ignorant .
I am trying to detrend and transform variables to achieve normality and
stationarity (for time series use, namely spectral analysis). I am using the
boxcox transformations.
As my dataset contains zeros, I found I need to add a constant to it in
order to run "boxcox". I have ran tests adding several types of constants,
from .0001
2012 Aug 05
1
trouble with looping for effect of sampling interval increase
I've looked everywhere and tinkered for three days now, so I figure asking
might be good.
So here's a general rundown of what I am trying to get my code to do I am
giving you the whole rundown because I need a solution that retain certain
ways of doing things because they give me the information i need.
I want to examine the effect of increasing my sampling interval on my data.
Example:
2010 Jan 21
0
Using spec.ls to interpolate very long time series
I have an very long, irregularly spaced time series (and I'm also new to
spectral analysis, so please be patient.) I want to use spec.ls as an
interpolator and then use the output to reconstruct the time series via
inverse fft. But so far I've been having difficulty doing this.
ts<-read.csv("timeseries.csv",header=TRUE) #file contains over 30000
irregularly spaced
2002 Jan 15
1
acf conf intervals +speed
Hi,
I'm trying to obtain confidence intervals for auto and
cross correlation estimates. I've adapted code made
available by Stock and Watson that uses the Bartlett
Kernel and the delta method. In R it runs really,
really slow because of the loops it uses and I have 9
series that I'd like to examine (81 total
combinations). It was easy enough to replace one of
the while loops with a
2008 Sep 09
4
Help with 'spectrum'
For the command 'spectrum' I read:
The spectrum here is defined with scaling 1/frequency(x), following S-PLUS. This makes the spectral density a density over the range (-frequency(x)/2, +frequency(x)/2], whereas a more common scaling is 2? and range (-0.5, 0.5] (e.g., Bloomfield) or 1 and range (-?, ?].
Forgive my ignorance but I am having a hard time interpreting this. Does this mean
2008 Aug 06
2
Attempting to make a custom color spectrum to use in heatmap.2
Hello there! I'd just like to say in advance, "Thank you," for any help
and/or advice.
My problem is as follows:
I have a dataset that is made up of percentages. I've assigned my
"error" percentages a value of '-100', my "non-existent" percentages a
value of '0', and all my other percentages are normal values that range
from the high
2004 Aug 06
1
Frozen upper spectrum in WB VBR CNG
Hi,
I've been using Speex in my voice-over-IP program on Win32, in
wideband (16kHz) mode. I just starting using VBR recently and
have run into something that might be a problem within Speex:
If someone hasn't spoken for a little while, and the bitrate drops
to very low, sometimes the high half of the spectrum becomes frozen
with a looping sound. The bottom half of the spectrum is
2007 Nov 25
1
spec.pgram() - circularity of kernel
Hi,
I am far from experienced in both R and time series hence the question.
The code for spec.pgram() seems to involve a circularity of the kernel (see
below) yielding new power estimates to all frequencies computed by FFT.
"
if (!is.null(kernel)) {
for (i in 1:ncol(x)) for (j in 1:ncol(x)) pgram[, i,
j] <- kernapply(pgram[, i, j], kernel, circular = TRUE)
2020 Oct 19
1
spec.pgram returns different spectra when fast=TRUE and the number of samples is odd
Dear all,
This is potentially a bug in spec.pgram, when the number of samples is odd,spec.pgramreturns a different result withfast = TRUE, the example below contains the two varieties with a reference spectrum calculated manually. the number of returned spectra is also larger (50 compared to 49) whenfast = TRUE
x <- rnorm(
99
)
plot(spec.pgram(x, taper =
0
, detrend =
FALSE
, plot =
2006 Jan 31
1
How do I "normalise" a power spectral density
I have done a fair bit of spectral analysis, and hadn't finished collecting my thoughts for a reply, so hadn't replied yet.
What exactly do you mean by normalize?
I have not used the functons periodogram or spectrum, however from the description for periodogram it appears that it returns the spectral density, which is already normalized by frequency, so you don't have to worry about
2008 Dec 03
2
Spectral Analysis of Time Series in R
Dear R Community,
I am currently student at the Vienna University of Technology writing my
Diploma thesis on causality in time series and doing some analyses of
time series in R. I have the following questions:
(1) Is there a function in R to estimate the PARTIAL spectral coherence
of a multivariate time series? If yes, how does this work? Is there an
test in R if the partial spectral
2008 Jun 09
2
using spec.pgram
Hi everyone,
first of all, I would like to say that I am a newbie in R, so I apologize in
advance if my questions seem to be too easy for you.
Well, I'm looking for periodicity in histograms. I have histograms of
certain phenomenons and I'm asking whether a periodicity exists in these
data. So, I make a periodogram with the function spec.pgram. For instance,
if I have a histogram h, I
2006 Jan 24
0
Relating Spectral Density to Chi-Square distribution
Dear list,
I had some confusion regarding what function too use in order too relate
results from spec.pgram() too a chi-square distribution. The documentation
indicates that the PSD estimate can be approximated by a chi-square
distribution with 2 degrees of freedom, but I am having trouble figuring out
how to do it in R, and figuring out what specifically that statement in the
documentation
2011 Jul 11
1
Spectral Coherence
Greetings,
I would like to estimate a spectral coherence between
two timeseries. The stats : spectrum() returns a coh matrix
which estimates coherence (squared).
A basic test which from which i expect near-zero coherence:
x = rnorm(500)
y = rnorm(500)
xts = ts(x, frequency = 10)
yts = ts(y, frequency = 10)
gxy = spectrum( cbind( xts, yts ) )
plot( gxy $ freq, gxy $