function [fr,sp,fr_max,navg,da]=read_spe(filenum,sw)

if nargin<2, sw=0; end;

%%

fn=['00',num2str(filenum)];
filename=['spe',fn(end-2:end),'.txt'];

%%
[c1,c2]=textread(filename,'%s%s','delimiter',',');

fr_max=str2double(c1(8));
navg=str2double(c2(11));
da=c2{2};

fr=str2double(c1(23:end-1));
sp=10.^(str2double(c2(23:end-1))/20);

%%

if sw~=0
loglog(fr,sp); grid on
title([da,', Average: ',c2{11}])
xlabel('Frequency  [Hz]')
ylabel('Voltage noise [V/Hz^{1/2}]')

set(gca ,'XLimMode', 'manual')
set(gca ,'YLimMode', 'manual')
set(gca ,'ZLimMode', 'manual')

end