
%% Controlling the frequency range of interest

display('To compute spectrum only for 0-100 Hz press enter');
pause
%
% Compute the spectrum for a restricted range of frequencies, in this case
% 0-100 Hz
%
ch=6;% trial number
delay_samples=1001:2000; % delay period sample numbers
data=dlfp1t(delay_samples,ch); % data in delay period
params.Fs=1000; % sampling frequency
params.fpass=[0 100]; % frequency range of interest
[S,f]=mtspectrumc(data,params);
%
% Plot the spectrum
%
figure; 
plot_vector(S,f,[],[],'y');
set(gca,'FontName','Times New Roman','Fontsize', 16);
xlabel('frequency Hz'); ylabel('Spectrum dB');
title('LFP spectrum for 1 trial over a restricted frequency range');
position_figure