Displaying 20 results from an estimated 4000 matches similar to: "Cross Spectrum Analysis"
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
2001 Nov 20
2
quiver plot help
Hello everybody
I'm trying to write a simple version of matlab's "quiver".
The idea is that I have fluid with velocity defined on a grid. I have
a matrix of x-components of velocity and a matrix of y-components and
I want to see the overall flow pattern. (I work with 2D fluid
mechanics problems).
My first-stab function is below:
quiver <- function(u,v,scale=1)
# first
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 =
2004 Jan 22
1
spectrum
Dear R users
I have two questions about estimating the spectral power of a
time series:
1) I came across a funny thing with the following code:
data(co2)
par(mfrow=c(2,1))
co2.sp1<-spectrum(co2,detrend=T,demean=T,span=3)
co2.sp2<-spectrum(co2[1:468],detrend=T,demean=T,span=3)
The first plot displays the frequencies ranging from 0 to 6
whearas the second plot displays the same curve but
2002 Apr 10
1
Layout of Fourier frequencies
I'm doing convolutions in the frequency domain and need to know the
layout of the Fourier modes returned by fft. (This is leading up to a
more involved question about moment generating functions, but I need to
know if I've got this part correct first.)
I think in 1D the pattern is:
0 1 2 3 -2 1 (even)
0 1 2 3 -3 2 1 (odd)
In 2D is it simply (for a square matrix):
0 1 2 -1 (horizontal)
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 $
2008 Nov 06
1
nls: Fitting two models at once?
Hello,
I'm still a newbie user and struggling to automate some analyses from
SigmaPlot using R. R is a great help for me so far!
But the following problem makes me go nuts.
I have two spectra, both have to be fitted to reference data. Problem: the
both spectra are connected in some way: the stoichiometry of coefficients
"cytf.v"/"cytb.v" is 1/2.
{{In the SigmaPlot
2009 Feb 17
2
Chromatogram deconvolution and peak matching
Hi,
I'm trying to match peaks between chromatographic runs.
I'm able to match peaks when they are chromatographed with the same method,
but not when there are different methods are used and spectra comes in to
play.
While searching I found the ALS package which should be usefull for my
application, but I couldn't figure it out.
I made some dummy chroms with R, which mimic my actual
2001 May 09
2
[Newbie] Row-Iterator for data.frame??
hello all,
for my diploma-thesis i want to statitically analyze near-infrared-spectra.
a spectrum is given by the y-values of 1038 equi-distant x-points.
in nature, a spectrum is a continuous curve. for analysis, every x-point
is seen as a statistical variable.
now my problem:
first, i read a csv-table in a data.frame called sTable via read.table.
besides some meta-data there are 1038 variables
2006 Jul 11
3
least square fit with non-negativity constraints for absorption spectra fitting
I would really appreciate it if someone can give suggestions on how to
do spectra fitting in R using ordinary least square fitting and
non-negativity constraints. The lm() function works well for ordinary
least square fitting, but how to specify non-negativity constraints? It
wouldn't make sense if the fitting coefficients coming out as negative
in absorption spectra deconvolution.
Thanks.
2008 Nov 03
1
Fourier Transform with irregularly spaced x
Dear all,
I work with (vibrational) spectra: some kind of intensity (I) over frequency
(nu), wavelength or the like.
I want to do fourier transform for interpolation, smoothing, etc.
My problem is that the spectra are often irregularly spaced in nu: the
difference between 2 neighbouring nu varies across the spectrum, and data
points may be missing.
Searching for discrete fourier transform
1999 Jul 19
9
time series in R
Time Series functions in R
==========================
I think a good basic S-like functionality for library(ts) in base R
would include
ts class, tsp, is.ts, as.ts
plot methods
start end window frequency cycle deltat
lag diff aggregate
filter
spectrum, spec.pgram, spec.taper, cumulative periodogram, spec.ar?
ar -- at least univariate by Yule-Walker
arima -- sim, filter, mle, diag, forecast
2008 Apr 17
2
Suggestions: Terminology & Pkgs for following spectra over time
Hi Folks... No code to troubleshoot here. I need some suggestions about the
right terminology to use in further searching, and any suggestions about R
pkgs that might be appropriate.
I am in the planning stages of a project in which IR, NMR and other spectra
(I'm a chemist) would be collected on various samples, and individual
samples would be followed over time. The spectra will be feature
2007 Nov 21
1
Different freq returned by spec.ar() and spec.pgram()
Dear list,
I've recently become interested in comparing the spectral estimates
using the different methods ("pgram" and "ar") in the spectrum()
function in the stats package.
With many thanks to the authors of these complicated functions, I
would like to point out what looks to me like a bit of an
inconsistency -- but I would not be surprised if there is good
reasoning
2011 May 04
1
Outlier removal by Principal Component Analysis : error message
Hi,
I am currently analysis Raman spectroscopic data with the hyperSpec package.
I consulted the documentation on this package and I found an example
work-flow dedicated to Raman spectroscopy (see the address :
http://hyperspec.r-forge.r-project.org/chondro.pdf)
I am currently trying to remove outliers thanks to PCA just as they did in
the documentation, but I get a message error I can't
2007 Mar 09
2
Deconvolution of a spectrum
Dear useRs,
I have a curve which is a mixture of Gaussian curves (for example UV
emission or absorption spectrum). Do you have any suggestions how to
implement searching for optimal set of Gaussian peaks to fit the curve?
I know that it is very complex problem, but maybe it is a possibility
to do it? First supposement is to use a nls() with very large functions,
and compare AIC value, but it is
2008 Jan 29
1
coherency and phase plots
I am having a hard time interpreting the phase and coherency plots.
x is two timeseries that occur at the same time i.e.
a b
1 11.2 12.3
16 11.3 12.4
31 11.4 12.5
46 11.5 12.6
...etc
even though my example is does not show this they are oscillating at
more or less the same frequency just shifted by t=x (imagine two sine
waves offset with the 2nd sine
2005 Dec 01
1
squared coherency and cross-spectrum
Hi All,
I have two time series, each has length 354. I tried to calculate the
coherency^2 between them, but the value I got is always 1. On a website,
it says: " Note that if the ensemble averaging were to be omitted, the
coherency (squared) would be 1, independent of the data". Does any of
you know how to specify properly in R in order to get more useful
coherency? The examples in
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)
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