How to extract features to train and test dataset for emotion recognition signal using GSR?

조회 수: 6 (최근 30일)
Hello, I have ASCERTAIN dataset which is consists of GSR signal. But, there is a problem with my coding when I want to proceed train and test daatset from extract features using classifier. Here is my coding.
Data_GSR
% Filter the signals with a highpass filter
Data_GSRFiltered = highpass(Data_GSR,0.7,64);
meanFE = signalTimeFeatureExtractor("Mean",true,"SampleRate",64);
timeFE = signalTimeFeatureExtractor("RMS",true,...
"ShapeFactor",true,...
"PeakValue",true,...
"CrestFactor",true,...
"ClearanceFactor",true,...
"ImpulseFactor",true,...
"SampleRate",64);
freqFE = signalFrequencyFeatureExtractor("PeakAmplitude",true,...
"PeakLocation",true,...
"MeanFrequency",true,...
"BandPower",true,...
"PowerBandwidth",true,...
"SampleRate",64);
fftLength = 256;
window = rectwin(size(Data_GSR,1));
setExtractorParameters(freqFE,"WelchPSD","FFTLength",fftLength,"Window",window);
mindist_xunits = 0.25;
minpkdist = floor(mindist_xunits/(64/fftLength));
setExtractorParameters(freqFE,"PeakAmplitude","MaxNumExtrema",6,"MinSeparation",minpkdist);
setExtractorParameters(freqFE,"PeakLocation","MaxNumExtrema",6,"MinSeparation",minpkdist);
meanFeatureDs = arrayDatastore(Data_GSR,"IterationDimension",2);
meanFeatureDs = transform(meanFeatureDs,@(x)meanFE.extract(x{:}));
timeFeatureDs = arrayDatastore(Data_GSRFiltered,"IterationDimension",2);
timeFeatureDs = transform(timeFeatureDs,@(x)timeFE.extract(x{:}));
freqFeatureDs = arrayDatastore(Data_GSRFiltered,"IterationDimension",2);
freqFeatureDs = transform(freqFeatureDs,@(x)freqFE.extract(x{:}));
meanFeatures = readall(meanFeatureDs,"UseParallel",true);
timeFeatures = readall(timeFeatureDs,"UseParallel",true);
freqFeatures = readall(freqFeatureDs,"UseParallel",true);
features = [meanFeatures timeFeatures freqFeatures];
featureTable = array2table(features);
head(featureTable)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by