How can i store multiple audio files in a variable ?

8 ビュー (過去 30 日間)
esraa gamal
esraa gamal 2022 年 8 月 15 日
コメント済み: Walter Roberson 2022 年 8 月 15 日
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];

採用された回答

Walter Roberson
Walter Roberson 2022 年 8 月 15 日
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 件のコメント
esraa gamal
esraa gamal 2022 年 8 月 15 日
but theey have different number of samples :(
Walter Roberson
Walter Roberson 2022 年 8 月 15 日
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')

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by