Dear all,
I am a new user of matlab. and as I dont have acces to all the tool
boxes, I would like to write my own autocorrelation function.
I have a discrete time series, and I would like to calculate the
autocorrelation between 2 values of this series with a time lag of 1.
this to enhance seasonal variations.
I have very basic knowledge in programing, so if anyone have already
write this kind of script, and would like to share it, it will be very
appriciated. all kind of help or obviously welcome,
thank you in advance,
best regards
Yoann
|
|
0
|
|
|
|
Reply
|
yoann06
|
6/23/2010 12:30:23 PM |
|
yoann06 <ydrocourt@gmail.com> wrote in message <440eb778-6754-4ea1-8183-144bfeac7ccf@e5g2000yqn.googlegroups.com>...
> Dear all,
> I am a new user of matlab. and as I dont have acces to all the tool
> boxes, I would like to write my own autocorrelation function.
> I have a discrete time series, and I would like to calculate the
> autocorrelation between 2 values of this series with a time lag of 1.
> this to enhance seasonal variations.
> I have very basic knowledge in programing, so if anyone have already
> write this kind of script, and would like to share it, it will be very
> appriciated. all kind of help or obviously welcome,
> thank you in advance,
> best regards
> Yoann
You say you don't have access to all toolboxes. Do you have the Signal Processing Toolbox?
Wayne
|
|
0
|
|
|
|
Reply
|
Wayne
|
6/23/2010 12:40:19 PM
|
|
On 23 June, 13:40, "Wayne King" <wmkin...@gmail.com> wrote:
> yoann06 <ydroco...@gmail.com> wrote in message <440eb778-6754-4ea1-8183-144bfeac7...@e5g2000yqn.googlegroups.com>...
> > Dear all,
> > I am a new user of matlab. and as I dont have acces to all the tool
> > boxes, I would like to write my own autocorrelation function.
> > I have a discrete time series, and I would like to calculate the
> > autocorrelation between 2 values of this series with a time lag of 1.
> > this to enhance seasonal variations.
> > I have very basic knowledge in programing, so if anyone have already
> > write this kind of script, and would like to share it, it will be very
> > appriciated. all kind of help or obviously welcome,
> > thank you in advance,
> > best regards
> > Yoann
>
> You say you don't have access to all toolboxes. Do you have the Signal Processing Toolbox?
>
> Wayne
Hi Wayne,
No unfortunately I don t
|
|
0
|
|
|
|
Reply
|
yoann06
|
6/23/2010 12:57:53 PM
|
|
yoann06 <ydrocourt@gmail.com> wrote in message <dc1a1d27-6898-440c-b58a-44a6a76c3271@d37g2000yqm.googlegroups.com>...
> On 23 June, 13:40, "Wayne King" <wmkin...@gmail.com> wrote:
> > yoann06 <ydroco...@gmail.com> wrote in message <440eb778-6754-4ea1-8183-144bfeac7...@e5g2000yqn.googlegroups.com>...
> > > Dear all,
> > > I am a new user of matlab. and as I dont have acces to all the tool
> > > boxes, I would like to write my own autocorrelation function.
> > > I have a discrete time series, and I would like to calculate the
> > > autocorrelation between 2 values of this series with a time lag of 1.
> > > this to enhance seasonal variations.
> > > I have very basic knowledge in programing, so if anyone have already
> > > write this kind of script, and would like to share it, it will be very
> > > appriciated. all kind of help or obviously welcome,
> > > thank you in advance,
> > > best regards
> > > Yoann
> >
> > You say you don't have access to all toolboxes. Do you have the Signal Processing Toolbox?
> >
> > Wayne
>
> Hi Wayne,
> No unfortunately I don t
Hi Yoann:
% x is your signal
% numLags is the number of lags you want, e.g. 50
x = detrend(x,0);
xmagDFT = abs(fft(x)).^2;
autocorr = ifft(xmagDFT,'symmetric');
autocorr= autocorr(1:numLags);
% normalize the autocorrelation you may or may not want this
autocorr = autocorr./autocorr(1);
% Example with white noise
reset(RandStream.getDefaultStream);
x = randn(512,1);
numLags = 50;
x = detrend(x,0);
xmagDFT = abs(fft(x)).^2;
autocorr = ifft(xmagDFT,'symmetric');
autocorr= autocorr(1:numLags);
% normalize the autocorrelation
autocorr = autocorr./autocorr(1);
stem(autocorr);
Hope that helps,
Wayne
|
|
0
|
|
|
|
Reply
|
Wayne
|
6/23/2010 1:25:20 PM
|
|
On 23 June, 14:25, "Wayne King" <wmkin...@gmail.com> wrote:
> yoann06 <ydroco...@gmail.com> wrote in message <dc1a1d27-6898-440c-b58a-44a6a76c3...@d37g2000yqm.googlegroups.com>...
> > On 23 June, 13:40, "Wayne King" <wmkin...@gmail.com> wrote:
> > > yoann06 <ydroco...@gmail.com> wrote in message <440eb778-6754-4ea1-8183-144bfeac7...@e5g2000yqn.googlegroups.com>...
> > > > Dear all,
> > > > I am a new user of matlab. and as I dont have acces to all the tool
> > > > boxes, I would like to write my own autocorrelation function.
> > > > I have a discrete time series, and I would like to calculate the
> > > > autocorrelation between 2 values of this series with a time lag of 1.
> > > > this to enhance seasonal variations.
> > > > I have very basic knowledge in programing, so if anyone have already
> > > > write this kind of script, and would like to share it, it will be very
> > > > appriciated. all kind of help or obviously welcome,
> > > > thank you in advance,
> > > > best regards
> > > > Yoann
>
> > > You say you don't have access to all toolboxes. Do you have the Signal Processing Toolbox?
>
> > > Wayne
>
> > Hi Wayne,
> > No unfortunately I don t
>
> Hi Yoann:
>
> % x is your signal
> % numLags is the number of lags you want, e.g. 50
> x = detrend(x,0);
> xmagDFT = abs(fft(x)).^2;
> autocorr = ifft(xmagDFT,'symmetric');
> autocorr= autocorr(1:numLags);
> % normalize the autocorrelation you may or may not want this
> autocorr = autocorr./autocorr(1);
>
> % Example with white noise
>
> reset(RandStream.getDefaultStream);
> x = randn(512,1);
> numLags = 50;
> x = detrend(x,0);
> xmagDFT = abs(fft(x)).^2;
> autocorr = ifft(xmagDFT,'symmetric');
> autocorr= autocorr(1:numLags);
> % normalize the autocorrelation
> autocorr = autocorr./autocorr(1);
> stem(autocorr);
>
> Hope that helps,
> Wayne- Hide quoted text -
>
> - Show quoted text -
Yes thank you,
it seems to give the right autoccorrelation pic.
very nice
all the best
Yoann
|
|
0
|
|
|
|
Reply
|
ydrocourt (11)
|
6/24/2010 11:09:52 AM
|
|
|
4 Replies
385 Views
(page loaded in 0.097 seconds)
Similiar Articles: Generate Gaussian Process with a Specified Autocorrelation ...Suppose we want to generate sampled values of a Gaussian process with an autocorrelation function Rx(t) = exp(-a*abs(t)) . Choose an appropriate sampl... Periodic and aperiodic autocorrelation - comp.dspI'm starting experiments with compressed pulse radar and I have to choose the best signal to transmit - low autocorrelation sidelobes, good ambiguity function etc. . Problem with PSD and Autocorrelation - comp.soft-sys.matlab ...I've a problem with autocorrelation:the function autocorr(random numbers) return me only the plot, and then only with this I can't compute FFT. time series correlation / autocorrelation / xcorr - comp.soft-sys ...Generate Gaussian Process with a Specified Autocorrelation ... time series correlation / autocorrelation / xcorr - comp.soft-sys ... Autocorrelation function of random ... FIRST ORDER AUTOCORRELATION - comp.soft-sys.matlabMy idea was: first I calculate the autocorrelation of this random numbers, then I ... comp.soft-sys.matlab... xcorr function but in order to use xcorr as an ... autocorrelation command xcorr - comp.soft-sys.matlabMaybe you want to specifically use the xcorr function but in order to use xcorr as an autocorrelation the option 'coeff' would need to be used. comparing xcov, xcorr and autocorr - comp.soft-sys.matlab ...> > However, now I do not see the difference between xcov and xcorr, since both functions compute cross-correlation (resp. autocorrelation), but thanks again :) Hi Jan, if ... Correlated Gaussian Noise with Exponential Correlation Function ...:) If the noise is 2-D do you want each dimension to have an exponential autocorrelation function or do you want the cross correlation function to be exponential? How to make autocorr of white and colored noise. - comp.soft-sys ...I've a problem with autocorrelation:the function autocorr ... How to generate colored Noise - comp.soft-sys.matlab... not like white noise, in other words, an ... Durbin Watson table or other test for autocorrelation of residuals ...My outcome must be either accept hypotesis of autocorrelation of residuals or reject. ... The function is based on table lookup values for n < 150, and is based on a ... Autocorrelation - Wikipedia, the free encyclopediaAutocorrelation is the cross-correlation of a signal with itself. Informally, it is the similarity between observations as a function of the time separation between them. Partial autocorrelation function - Wikipedia, the free encyclopediaIn time series analysis, the partial autocorrelation function (PACF) plays an important role in data analyses aimed at identifying the extent of the lag in an ... 7/30/2012 12:36:52 AM
|