Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CRP Toolbox for MATLAB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Norbert Marwan
CRP Toolbox for MATLAB
Commits
9caa028b
Commit
9caa028b
authored
15 years ago
by
marwan
Browse files
Options
Downloads
Patches
Plain Diff
correction of frequency scale
parent
cf58e27d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
rrspec.m
+15
-6
15 additions, 6 deletions
rrspec.m
rtspec.m
+15
-6
15 additions, 6 deletions
rtspec.m
with
30 additions
and
12 deletions
rrspec.m
+
15
−
6
View file @
9caa028b
...
...
@@ -4,7 +4,7 @@ function varargout = rrspec(varargin)
% spectrum based on a recurrence plot using embedding dimension
% M, embedding delay T, recurrence threshold E, maximal lag
% for tau-recurrence W, and sampling frequency FS. The
% input arguments are similar to those of the command CRP.
% input arguments are similar to those of the command
TAU
CRP.
%
% P = RRSPEC(...) returns the tau-recurrence rate spectrum
% in vector P.
...
...
@@ -14,12 +14,16 @@ function varargout = rrspec(varargin)
%
% Example: fs = 22;
% x = sin(2*pi * [0:1/fs:44]);
% r
t
spec(x,2,1,.1,fs)
;
% r
r
spec(x,2,1,.1,
[],
fs)
%
% See also TAUCRP, RTSPEC.
%
% Copyright (c) 2008 by AMRON
% Copyright (c) 2008-2009
% Norbert Marwan, Potsdam Institute for Climate Impact Research, Germany
% http://www.pik-potsdam.de
%
% Copyright (c) 2008
% Norbert Marwan, Potsdam University, Germany
% http://www.agnld.uni-potsdam.de
%
...
...
@@ -27,6 +31,9 @@ function varargout = rrspec(varargin)
% $Revision$
%
% $Log$
% Revision 5.1 2008/07/02 12:01:13 marwan
% initial import
%
% Revision 5.1 2008/07/01 13:09:27 marwan
% initial import
%
...
...
@@ -42,7 +49,7 @@ w_init = 100;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% check the input
error
(
nargchk
(
1
,
8
,
nargin
));
if
nargout
>
1
,
error
(
'Too many output arguments'
),
end
if
nargout
>
2
,
error
(
'Too many output arguments'
),
end
...
...
@@ -136,7 +143,8 @@ fft_RR = fft(tauRR-mean(tauRR));
%% spectrum
P
=
fft_RR
.*
conj
(
fft_RR
);
%P = fft_RR.^2;
f
=
fs
*
linspace
(
0
,
.
5
,
length
(
x
));
f
=
fs
*
linspace
(
0
,
.
5
,
N
);
P
=
P
(
1
:
N
);
if
nargout
==
1
varargout
{
1
}
=
P
(:);
...
...
@@ -145,7 +153,8 @@ elseif nargout == 2
varargout
{
2
}
=
f
(:);
else
%% Plot the spectrum
semilogy
(
f
,
P
(
1
:
length
(
f
))
+
1
)
semilogy
(
f
,
P
(
1
:
N
)
+
1
)
grid
xlabel
(
'Frequency'
),
ylabel
(
'Power'
)
title
(
'\tau-Recurrence Rate Spectrum'
)
end
This diff is collapsed.
Click to expand it.
rtspec.m
+
15
−
6
View file @
9caa028b
...
...
@@ -14,12 +14,16 @@ function varargout = rtspec(varargin)
%
% Example: fs = 22;
% x = sin(2*pi * [0:1/fs:44]);
% rtspec(x,2,1,.1,fs)
;
% rtspec(x,2,1,.1,fs)
%
% See also CRP, RRSPEC.
%
% Copyright (c) 2008 by AMRON
% Copyright (c) 2008-2009
% Norbert Marwan, Potsdam Institute for Climate Impact Research, Germany
% http://www.pik-potsdam.de
%
% Copyright (c) 2008
% Norbert Marwan, Potsdam University, Germany
% http://www.agnld.uni-potsdam.de
%
...
...
@@ -27,6 +31,9 @@ function varargout = rtspec(varargin)
% $Revision$
%
% $Log$
% Revision 5.1 2008/07/02 12:01:13 marwan
% initial import
%
% Revision 5.1 2008/07/01 13:09:27 marwan
% initial import
%
...
...
@@ -140,20 +147,22 @@ X = crp2(x,m,t,e,method,norm_str,nogui_str);
%% spectrum
f1
=
0
:
1
/(
1000
*
fs
):
1
;
P1
=
histc
(
1.
/
RT
,
f1
);
P1
=
histc
(
1.
/
(
RT
+
1
)
,
f1
);
P
=
histc
(
RT
,
1
:
2
*
max
(
RT
));
f
=
[
1
:
2
*
max
(
RT
)]
+.
5
;
f2
=
fs
.
/(
f
+
1
);
if
nargout
==
1
varargout
{
1
}
=
P
(:);
elseif
nargout
==
2
varargout
{
1
}
=
P
(:);
varargout
{
2
}
=
f
(:);
varargout
{
2
}
=
f
2
(:);
else
% semilogy(f1*fs,P1+1,fs./f,P+1)
semilogy
(
fs
.
/
f
,
P
+
1
)
semilogy
(
f1
*
fs
,
P1
+
1
,
fs
.
/(
f
+
1
),
P
+
1
)
% semilogy(fs./f,P+1)
grid
ylabel
(
'Power'
)
xlabel
(
'Frequency'
)
title
(
'Recurrence Time Spectrum'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment