How can i store multiple audio files in a variable ?

clc;
clearvars;
close all;
% loading data
load data;
% Normal, Asthma , .., --> that is variable which i used to store audio files in them
overall_dataset =[Normal; Asthma; Pneumonia; BRON; COPD; HeartFailure];

 Respuesta aceptada

Unless the files are all the same sampling frequency and the same number of samples and the same number of channels, then I recommend
overall_dataset = {Normal; Asthma; Pneumonia; BRON; COPD; HeartFailure};
along with storing the sampling frequency for each in a numeric vector unless you know that they are all the same.

2 comentarios

but theey have different number of samples :(
Then use {} like I show. Afterwards you would be able to do things such as
size(overall_dataset{2}, 1)
to find the number of samples for the Asthma dataset.
Depending what you are doing, you might want to instead create a table,
dataset_name = {'Normal'; 'Asthma'; 'Pneumonia'; 'BRON'; 'COPD', 'HeartFailure'};
Data = {Normal; Asthma; Pneumonia; BRON; COPD; HeartFailure};
Frequency = [18000; 12000; 18000; 18000; 36000; 12000];
T = table(Data, Frequency, 'RowNames', dataset_name);
Afterwards you would be able to do things like
T.Frequency('Asthma')

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Signal Processing Toolbox en Centro de ayuda y File Exchange.

Productos

Versión

R2020a

Preguntada:

el 15 de Ag. de 2022

Comentada:

el 15 de Ag. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by