Fs = 800; % sampling rate of 1000 Hz
t = 0:1/Fs:1-1/Fs;
x = ad2;
xdft = fft(x);
xdft = xdft(1:length(x)/2+1);
DF = Fs/length(x); % frequency increment
freqvec = 0:DF:Fs/2;
plot(freqvec,abs(xdft))
I hope this can work