clear all
clc
file='huo1.xlsx';
[~,sheets,~]=xlsfinfo(file);%读取表格数据
t=xlsread(file,sheets{1});
y=xlsread(file,sheets{2});
plot(t,y)
figure()
% Fs = 1000; % Sampling frequency
% T = 1/Fs; % Sampling period
% L = 50; % Length of signal
% t = (0:L-1)*T;
%
% Y = fft(y);
% P2 = abs(Y/L);
% P1 = P2(1:L/2+1);
% P1(2:end-1) = 2*P1(2:end-1);
% f = Fs*(0:(L/2))/L;
% plot(f,P1)
% title('Single-Sided Amplitude Spectrum of X(t)')
% xlabel('f (Hz)')
% ylabel('|P1(f)|')
pspectrum(y,100,'FrequencyLimits',[0 100])