-
Notifications
You must be signed in to change notification settings - Fork 0
/
cleanVRP.m
30 lines (27 loc) · 1.19 KB
/
cleanVRP.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
% process vrp file, (3.14.2023, remove invalid _S_VRP.csv)
% remove items that are below 60 dB
% remove outrageous outliers
clear all; close all;
% kmeans++ clustering for kinderEGG
%audio_dir = '/Volumes/voicelab/Huanchen/Thyrovoice Dataset/audio/';
audio_dir = 'L:\Huanchen\Thyrovoice Dataset\audio';
output_dir = 'L:\Huanchen\Thyrovoice Dataset\cleanedVRP';
patient_dir = dir(audio_dir);
for i=1:length(patient_dir)
patient_name = patient_dir(i).name;
if ~isequal(patient_name, '.') && ~isequal(patient_name, '..') && ~isequal(patient_name, '.DS_Store')
patient_folder = fullfile(audio_dir, patient_name);
patient_file = dir(patient_folder);
for j = 1:length(patient_file)
csv_name = patient_file(j).name;
if endsWith(csv_name, 'VRP.csv')
filename = fullfile(patient_folder, csv_name);
[names, vrpArray] = FonaDynLoadVRP(filename);
vrpArray = vrpArray(vrpArray(:, 2)>= 60, :);
vrpArray(isoutlier(vrpArray(:, 1)), :) = [];
output_name = fullfile(patient_folder, csv_name);
FonaDynSaveVRP(output_name, names, vrpArray);
end
end
end
end