Periodogram with significant peak at 0 Hz
4 views (last 30 days)
Show older comments
Hi,
I'm analysing a time series and trying to make spectra, but either with periodogram or fft functions I still get the most significant peak at 0, which should be incorrect.
The time series comes from the CAmodelForced_edited model, that follows:
function dxy = diffxy(t, xy)
%
%split xy into variables in our equations
%
A = xy(1);
C = xy(2);
%
% define the derivatives of these variables from equations
%
%time t is in kyr
om=0.31416;
k=25;
S=100;
I=0.004;
beta=0.0025;
Adot = I-k*(1+beta*cos(om*t))*A*C;
Cdot = k*(1+beta*cos(om*t))*A*C-S*C;
%i
%return the derivatives in dxy in the right order
%
dxy = [Adot; Cdot];
and the script I am using is this:
options = odeset('RelTol',1e-12);
% integrate the unedited CAmodelForced function
[t,xy] = ode45(@CAmodelForced_edited,[0,2500],[2.0,0.0004],options);
A = xy(:,1); % first column
C = xy(:,2); % second column
A= A - mean(A);
Adt= detrend(A);
L=length(Adt);
Fs=length(Adt)/2500; %sampling rate in kyrs
[PxxA,f] = pwelch(Adt,hann(L),[],[],Fs);
magnitude = abs(PxxA);
figure(1)
plot(f,magnitude)
xlabel('Frequency')
ylabel('Power')
title('Power Spectral Density Estimate')
I am not an expert and I would really appreciate some help!
Thank you,
Arianna
1 Comment
Robert
on 21 Nov 2016
Do you know what frequencies you expect to see? It is easy for frequencies much slower than your sampling rate to appear as a bias when plotting on a linear scale. Try viewing the results with frequency on a log scale.
set(gca, 'XScale', 'log)
Answers (0)
See Also
Categories
Find more on Parametric Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!