similar to: convolve: request for "usual" behaviour + some improvements + some fixes

Displaying 20 results from an estimated 4000 matches similar to: "convolve: request for "usual" behaviour + some improvements + some fixes"

2010 May 30
1
Calling fft from C
Hi I have made a R function 'convolve2' for convolution of two real valued vectors based on Rs 'convolve' with option type="open" - see below. (exp.length and irf.length are variables set in another part of the program) I wish to implement the function convolve2 in C and use it in a function used from R with .Call - e.g. I need to call fft in C. All I can find in the
2007 Feb 02
1
Inaccuracy in ?convolve
Hi, Man page for 'convolve' says: conj: logical; if 'TRUE', take the complex _conjugate_ before back-transforming (default, and used for usual convolution). The complex conjugate of 'x', of 'y', of both? In fact it seems that it takes the complex conjugate of 'y' only which is OK but might be worth mentioning because (1) conj=TRUE is the
2007 Dec 19
1
strange timings in convolve(x,y,type="open")
Dear R-ophiles, I've found something very odd when I apply convolve to ever larger vectors. Here is an example below with vectors ranging from 2^11 to 2^17. There is a funny bump up at 2^12. Then it gets very slow at 2^16. > for( i in 11:20 )print( system.time(convolve(1:2^i,1:2^i,type="o"))) user system elapsed 0.002 0.000 0.002 user system elapsed 0.373
2000 Jan 28
0
convolution bug (PR#408)
Full_Name: Bill Simpson Version: 65.1 , 0.90.1 OS: Linux Submission from: (NULL) (193.62.250.209) I reported this on r-help, but here is official bug report. The present convolve() does not do convolution by default. Its default behaviour is correlation. This is a bug. The default argument conj should be set to FALSE. The zero-padding should be on the right for linear convolution (don't
2013 Jun 23
1
stats::convolve documentation enhancement
Hi, the function stats::convolve does not mention efficient usage of the underlying FFT algorithm, such as (a) if type="circular", then length(x)=length(y) should have many factors (e.g. length(x) = length(y) = 2^n) (b) if type="open" or "filter", then length(x)+length(y)-1 should have many factors (e.g. length(x)+length(y)-1 = 2^n) In particular the latter may
1999 Nov 18
1
convolve bug?
I have been experimenting with convolve(). What I know about convolution I learned from engineering (they call this stuff linear systems theory), not statistics, so maybe this is all just a matter of different conventions. BUT I notice very weird things with convolve(). 1. First example, from the classic Bracewell The Fourier transform and its applications, chap 3 (p.32 in 2nd edition): {2 2 3 3
2005 Jul 20
2
Issues with convolve
We obtained some disturbing results from convolve() (inaccuracies and negative probabilities). We'll try to make the context clear in as few lines as possible... Our function panjer() (code below) basically computes recursively the probability mass function of a compound Poisson distribution. When the Poisson parameter lambda is very large, the starting value of the recursive scheme ---
2001 Jun 04
1
2D convolution
Dear all, I have an image that I need to filter, and so I'm looking for a method to convolve it with a matrix. If I understood the docs for convolve correctly, it only works in 1D (and I have tried to convolve, it didn't look good). So, I wondered if anybody have implemented 2D convolution in R, or have any good advices to share (beyond having a look at mvfft), before I go hacking?
2013 Jan 07
0
Something wrong with echo_diagnostic.m
Hello everyone, I'm a new comer to this mailing list. I found that the echo_diagnostic.m included in speex-1.2rc1 seems to have grammar mistakes which cause parse error in octave 3.6.2. I wonder if anyone have ever executed this code under octave/matlab. I also made some minor modifications to the file to correct those errors and publish it here. If it can helps the project to be more
2011 May 18
1
Convolution confusion:
Hi, I'm new to R, and I'm a bit confused with the "convolve()" function. If I do: x<-c(1, 2, 3) convolve(x, rev(x), TRUE, "open") = 9 12 10 4 1 But I expected: 3 8 14 8 3 (like in Octave/MATLAB - conv(x, reverse(x)) ) 3 2 1 x 1 2 3 = 3 2 1 0 6 4 2 0 0 9 6 3 = 3 8 14 8 3 The thing is, that "convolve(x, x, TRUE, "open")" works. For me
2008 Jul 25
1
transcript a matlab code in R
Dear R-users, I am trying to translate a matlab code for calculating the Local Whittle estimator in time series with long memory originally written by Shimotsu and available free in his webpage ( http://www.econ.queensu.ca/pub/faculty/shimotsu/ ) The Matlab code is ======================================================================================= function[r] = whittle(d,x,m) % WHITTLE.M
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
2011 Aug 11
1
.C and .Call: convolve example not working
Dear R users, I want to call C code via the .C or .Call interface. This works fine with integer values but using doubles the array received in C will be set to zeros. I have tried the convolve examples (Writing R extensions, chapter 5.2) and still the resulting array consists of zeros. My code (shortened for my purposes. Original did not work either):
2012 Mar 15
4
replicating C example from the Extensions Manual problem
Dear R People: Here is something that I am sure is very simple. I'm just trying to re-create the C convolution example in the Extensions manual. Here is the subroutine: void convolve(double *a, int *na, double *b, int *nb, double *ab) { R_len_t i, j, nab = *na + *nb - 1; for(i = 0; i < nab; i++) ab[i] = 0.0; for(i = 0; i < *na; i++) for(j = 0; j < *nb; j++) ab[i + j] += a[i] *
2007 Apr 17
1
question about spx_fft
Thanks for the explaination. Please see my questions and comment in lines. On 4/16/07, Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> wrote: > (keeping this on the list) > > William Zhang wrote: > > I read the mdf.c an my understanding is that N is actually window size for > > the FFT. The actual length L = N/2 which is the frame length. The > > second part
2010 Jun 04
2
Convolution vector to be derived
I want to generate the following outcome using convolution of two sequences. x <- c(1,2,3,4,5) y <- c(6,7,8,9) The resulting convolution vector is 6 19 40 70 100 94 76 45 When using convolve(), it is hard to produce the result above. Would you help me out to get that? Best regards Moohwan Kim
2011 Feb 26
1
2D Convolution Function
Dear R-Helpers, I want to try the 2D (two-dimensional) convolution in R. For example, let us we have the following kernel and data. kernel <- (1,2,3,2,1) data <- array(1:100, dim=c(10,10)) I know the function 'convolve' only for one-dimensional convolution, but it is just for a 1D sequence. Is there any function for 2D convolution? For theory, please refer to the following link:
2007 Apr 16
0
question about spx_fft
(keeping this on the list) William Zhang wrote: > I read the mdf.c an my understanding is that N is actually window size for > the FFT. The actual length L = N/2 which is the frame length. The > second part of the buffer is padded with the new frame data. So this is > like the overlap-save method for improving the acuracy in calculating > the fft of > long sequence of data?
2009 Sep 16
3
fft help
I wrote a script that I anticipating seeing a spike at 10Hz with the function 10* sin(2*pi*10*t). I can't figure out why my plots do not show spikes at the frequencies I expect. Am I doing something wrong or is my expectations wrong? require(stats) layout(matrix(c(1,2,3), 3, 1, byrow = TRUE)) #SETUP n <- 256 #nextn(1001) gives next power 2 F <- 100 #Hz -50 to 50 Hz dt
2005 Sep 29
2
solution of convolution equation
Hello, May be somebody can help me... I am trying to find a solution of a convolution equation using fft (and unfortunately I do not have a good background for this). So I am just trying to figure out how it can be implemented in R. I have two multidimensional independent variables X and Z and I know their densities fx and fz, which are multidimensional arrays. So I have to find the density of