clear;clc; tempresult=[]; figure for i=1:6 filename=['ROISignals_sub_00' num2str(i) '_2000.mat']; data=importdata(filename); x=data(:,1); fs=2; % L=length(x); L=256; y1=fft(x,L); y2=fftshift(y1); mag=abs(y2); f=(0:L-1)*fs/L-fs/2; tempresult=[tempresult mag]; plot(f,tempresult) end title('6个受试频谱图') figure() resultMag=mean(tempresult,2); plot(f,resultMag) title('6个受试平均频谱图')
鉴于频谱分析的重要性,一个FFT变换的小例子储存下来,以备后用
时间: 2024-12-06 00:22:34