How to extract audio features from a dataset for machine learning
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
George Cunningham
el 22 de Mzo. de 2018
Comentada: Brahim Boulebtateche
el 31 de Jul. de 2023
Hi everyone!
I've got a bit of an issue with my project code and I was wondering if someone would be able to help?
Essentially, I'm attempting to extract audio features from lung sounds using the Matlab Audio Analysis Toolbox (I.e. the STfeatures and MTfeatures in the code).
From here, I need to arrange and label the data in a matrix to then insert into the Classification Learner to see whether it can distinguish between healthy and unhealthy sounding lungs (E.g. crackles, wheezing etc.)
I have the following code but it doesn't seem to want to play ball, would someone be able to have a look and help me correct the issue?
Many thanks in advance!
clear all
close all
clc
%%Selecting the necessary folder for processing and running a batch operation
% Specify the folder where the files live.
myFolder = ('C:\Program Files\MATLAB\R2016a\bin\Wav');
% Check to make sure that folder actually exists. Warn user if it doesn't.
if ~isdir(myFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder);
uiwait(warndlg(errorMessage));
return;
end
% Get a list of all files in the folder with the desired file name pattern.
filePattern = fullfile(myFolder, '*.wav'); % Change to whatever pattern you need.
LS = dir(filePattern);
STM=zeros(length(LS),35);
MTM=zeros(length(LS),35);
for k = 1 : length(LS);
baseFileName = LS(k).name;
LungSounds = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', LungSounds)
%This can be utsed to list directed files being processed
% The files are read in via 'audioread', listing the Sampled Data and Sampling Rate
[X, Fs] = audioread(LungSounds); % 'y'= Sampled Data; 'Fs' = Sampling Rate
stf=stFeatureExtraction(X,12000,9,9);
STM(k,:)=stf';
listOfStatistics={'mean','max','min','median','std','stdbymean'}; %Arithmetic mean
% 'kurtosis','geomean','harmean','skewness'};
mtf=mtFeatureExtraction(stf,9,9,listOfStatistics(6));
MTM(k,:)=mtf';
% M=[];
% % ALL={STM;MTM};
% ALL = {stm;mtm};
% for k=1:length(LS);
% M=[M; ALL];
% end
% M %Clusters all extracted data into a cell
end
0 comentarios
Respuestas (1)
Re van Zyl
el 24 de Sept. de 2018
Good day
I have a similar project and used these links to help me. They wrote a function to extract heart sound features and stored it in a table. Hope it will be helpful.
https://www.mathworks.com/matlabcentral/fileexchange/65286-heart-sound-classifier
https://www.mathworks.com/videos/machine-learning-using-heart-sound-classification-example-1515709249154.html
Can I ask you where you got your data to train the algorithm. I am in urgent need of lung sound data for a final year project. I am currently an undergraduate student at the University of Stellenbosch, South Africa.
The project is to design a machine learning algorithm that will be trained to assist in identifying specific sounds. I got lung sounds and can not seem to find an internet database with enough data to train my algorithm. If you could please assist me in this regard it would be much appreciated.
The project is to write the machine learning code to differentiate between, in my case, normal lung sounds and adventitious lung sounds. The report will not be published and I would get no recognition for it, it is only for grading. I only need the data for academic purposes. I am willing to pay for such a database. If you need further information regarding the legitimacy of my request feel free to contact me at: 18388728@sun.ac.za
If you want to contact the project leader let me know and I will send you his contact information.
Regards Re van Zyl
3 comentarios
lazli chahinez
el 18 de Jun. de 2020
me too am doing the classifiction of lung sounds and i didn't find the data base and the fonction of classifaction of lung sounds
Brahim Boulebtateche
el 31 de Jul. de 2023
Here is a link to download a free dataset of lung sounds :
Ver también
Categorías
Más información sobre AI for Signals en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!