如题,用下面的代码找(f,A)曲线最高点的横坐标,得出结果是1
但是很显然f=1的时候A不是最大值
ppgwatch=evalin('base','ppgwatch');
y=ppgwatch(:,2);
N=height(y);
y = table2array(ppgwatch(:, 2));
%save('y.mat','y');
y_filtered=filter(daitong,y);
save('y_filtered.mat','y_filtered');
Fs=10;
T=1/Fs;
t=(0:1:N-1)*T;
t=t';
Y = fft(y_filtered);
Y=Y(1:N/2+1);
A=abs(Y);
f=(0:1:N/2)*Fs/N;
f=f';
plot(f,A);
xlabel=('hz');
ylabel=('幅值');
[MAX,MAXdix]=max(A);