please give the coading explanation for the topic drowssiness detection of pilot sir/mam,
1 view (last 30 days)
Show older comments
Respected sir/mam
I am in need of the coading explanation for this topic within this 31/3/2015
If you replied me on date means it will be a great help for me.
clc close all clear all %% svm Training & Classification
load Train_data; % load group; svmStruct = svmtrain(Train_data,group,'kernel_function','rbf');
%% signal Loading load data; fs = 300; for j=1:3 d=data(j+1,1:6000); x=data1(j+1,1:6000);
%% Pre-processing using LMS mu = 8e-9; ha = adaptfilt.lms(64,mu); [y,e] = filter(ha,d,x); figure,subplot(4,1,1), plot(x),title('Original Signal'); subplot(4,1,2),plot(d),title('Noise with original Signal'); subplot(4,1,3),plot(y),title('Noise Signal'); subplot(4,1,4),plot(e),title('Retrived Original Signal');
%% for i=1:1:length(e)/(2*fs) E=e(1,(i-1)*2*fs+1:i*2*fs); figure, windowsize = 128; window = hamming(windowsize); nfft = windowsize; noverlap = windowsize-1; wpt = wpdec(E,3,'sym8'); [Spec,Time,Freq] = wpspectrum(wpt,fs,'plot'); figure, Hs = spectrum.welch('hamming',26,4);
psd(Hs,Spec,'Fs',fs,'NFFT',512); [Pxx,f] = pwelch(Spec,window,noverlap,nfft,fs); y = moving(Pxx,3,'median'); figure,plot(y) %% Feature collection fea=mean(y(2:end-1)); % fea(2)=std(y); fea1(j,i)=fea;
% fea(3)=kurtosis(y); a1=0; a2=1.1276e-08; b1=8.4479e-04; b2=0.03; if fea<0 F=0; elseif 0<=fea<1.1276e-08 F=0.5*(fea-a1)/(b1-a1); elseif 1.1276e-08<fea< 8.4479e-04 F=0.5; elseif 8.4479e-04<fea<0.03 F=0.5*(fea-a2)/(b2-a2); else F=1; end Fea(j,i)=F; close all end
end
for k=1:size(fea1,2) test_fea=Fea(:,k); %% Testing species(k) = svmclassify(svmStruct,test_fea');
if (Species(k)>0.5) msgbox('The Pilot going to sleep'); else msgbox('The Pilot is Active'); end pause(3); end
With Regards Revathi
0 Comments
Answers (1)
See Also
Categories
Find more on AI for Signals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!