⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ave_period.m

📁 本文是通过文中方法来求最小嵌入维程序.子程序,相重构程序.
💻 M
字号:
function P=ave_period(data)

year=length(data);
wolfer=data;
% plot(year,wolfer)
% title(' signal')

Y = fft(wolfer);
Y(1)=[];

% plot(Y,'ro')
% title('Fourier Coefficients in the Complex Plane');
% xlabel('Real Axis');
% ylabel('Imaginary Axis');

n=length(Y);
power = abs(Y(1:floor(n/2))).^2;
nyquist = 1/2;
freq = (1:n/2)/(n/2)*nyquist;
% plot(freq,power)
% xlabel('cycles/year')
% title('Periodogram')

period=1./freq;
% plot(period,power);
% ylabel('Power');
% xlabel('Period (Years/Cycle)');

% hold on;
index=find(power==max(power));
mainPeriodStr=num2str(period(index));
% plot(period(index),power(index),'r.', 'MarkerSize',25);
% text(period(index)+2,power(index),['Period = ',mainPeriodStr]);
% hold off;

P=round(period(index))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -