
% [data fid] = loaddata('C:\TempData\20100409\20100409-1','mat');

% f = 0;
% for i = 1:size(data.arasid.iart,2)
%     y = downsample(data.arasid.iart(:,i),100);
%     Fs = data.sampfreq/100;                    % Sampling frequency
%     T = 1/Fs;                     % Sample time
%     L = length(data.arasid.iart);                     % Length of signal
%     t = (0:L-1)*T;                % Time vector
%     
%     
%     NFFT = 2^nextpow2(L); % Next power of 2 from length of y
%     Y = fft(y,NFFT)/L;
%     f = f+Fs/2*linspace(0,1,NFFT/2+1);
%     
%     
% end
% 
% 
% figure()
% % Plot single-sided amplitude spectrum.
% plot(f,2*abs(Y(1:NFFT/2+1)))
% title(fid)
% xlabel('Frequency (Hz)')
% ylabel('|Y(f)|')
% 
% findfigs

% Filter tryout

% A_stop1 = 60;		% Attenuation in the first stopband = 60 dB
% F_stop1 = 1;		% Edge of the stopband = 8400 Hz
% F_pass1 = 2;	% Edge of the passband = 10800 Hz
% F_pass2 = 3000;	% Closing edge of the passband = 15600 Hz
% F_stop2 = 4000;	% Edge of the second stopband = 18000 Hz
% A_stop2 = 60;		% Attenuation in the second stopband = 60 dB
% A_pass = 1;		% Amount of ripple allowed in the passband = 1 dB
% 
% BandPassSpecObj = ...
%    fdesign.bandpass('Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2', ...
% 		F_stop1, F_pass1, F_pass2, F_stop2, A_stop1, A_pass, ...
% 		A_stop2, data.sampfreq);
%     
% designmethods(BandPassSpecObj)    
%     
% BandPassFilt = design(BandPassSpecObj, 'cheby1');

% HP filter
A_stop1 = 60;		% Attenuation in the first stopband = 60 dB
F_stop1 = 1;		% Edge of the stopband = 8400 Hz
F_pass1 = 2;	% Edge of the passband = 10800 Hz
F_pass2 = 3000;	% Closing edge of the passband = 15600 Hz
F_stop2 = 4000;	% Edge of the second stopband = 18000 Hz
A_stop2 = 60;		% Attenuation in the second stopband = 60 dB
A_pass = 1;		% Amount of ripple allowed in the passband = 1 dB

BandPassSpecObj = ...
   fdesign.highpass('Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2', ...
		F_stop1, F_pass1, F_pass2, F_stop2, A_stop1, A_pass, ...
		A_stop2, data.sampfreq);
    
designmethods(BandPassSpecObj)    
    
BandPassFilt = design(BandPassSpecObj, 'cheby1');