From 0677699197d89cb9e10ec6da3d1dc4de77fbb759 Mon Sep 17 00:00:00 2001 From: Marina Kreme <amamarinak@gmail.com> Date: Thu, 28 May 2020 00:03:02 +0200 Subject: [PATCH] unnecessary file deletion --- matlab/tfgm/datasets/load_localized_signal.m | 23 --------- matlab/tfgm/datasets/load_wideband_signal.m | 24 --------- matlab/tfgm/datasets/make_wav_pairs.m | 19 ------- matlab/tfgm/datasets/wav_write.m | 14 ----- matlab/tfgm/datasets/wave_read.m | 54 -------------------- 5 files changed, 134 deletions(-) delete mode 100644 matlab/tfgm/datasets/load_localized_signal.m delete mode 100644 matlab/tfgm/datasets/load_wideband_signal.m delete mode 100644 matlab/tfgm/datasets/make_wav_pairs.m delete mode 100644 matlab/tfgm/datasets/wav_write.m delete mode 100644 matlab/tfgm/datasets/wave_read.m diff --git a/matlab/tfgm/datasets/load_localized_signal.m b/matlab/tfgm/datasets/load_localized_signal.m deleted file mode 100644 index 473385e..0000000 --- a/matlab/tfgm/datasets/load_localized_signal.m +++ /dev/null @@ -1,23 +0,0 @@ -function x_loc = load_localized_signal(ind_localized, resampling_fs, sig_len, deb) - - - -if nargin ==0 - deb=0; -end - -data = load('signal_lists.mat'); - -n = size(data.localized_sources_files, 1); - -if ind_localized > n - error('%s: The ind_localized value you entered is outside the value range. Please try another value.', upper(mfilename)); -end - - -localized_file = [data.localized_sources_files(ind_localized).folder, ... - filesep, ... - data.localized_sources_files(ind_localized).name]; -x_loc= wave_read(localized_file, resampling_fs, sig_len, deb); - -end diff --git a/matlab/tfgm/datasets/load_wideband_signal.m b/matlab/tfgm/datasets/load_wideband_signal.m deleted file mode 100644 index 242a95e..0000000 --- a/matlab/tfgm/datasets/load_wideband_signal.m +++ /dev/null @@ -1,24 +0,0 @@ -function x_wd = load_wideband_signal(ind_wideband,resampling_fs, sig_len, deb) - - - - -if nargin == 3 - deb=0; -end - -data = load('signal_lists.mat'); -n = size(data.wide_band_sources_files, 1); - - -if ind_wideband > n - error('%s: The ind_wideband value you entered is outside the value range. Please try another value.', upper(mfilename)); -end - -wideband_file = [data.wide_band_sources_files(ind_wideband).folder, ... - filesep, ... - data.wide_band_sources_files(ind_wideband).name]; - -x_wd= wave_read(wideband_file, resampling_fs, sig_len, deb); - -end \ No newline at end of file diff --git a/matlab/tfgm/datasets/make_wav_pairs.m b/matlab/tfgm/datasets/make_wav_pairs.m deleted file mode 100644 index e3cd96f..0000000 --- a/matlab/tfgm/datasets/make_wav_pairs.m +++ /dev/null @@ -1,19 +0,0 @@ -function make_wav_pairs() -%% MAKE_WAV_PAIRS: make_wav_pairs() -% function that generates two structures. -% One containing the wideband sounds and the other one with the well localized sounds -% -% Author : A. Marina KREME -% e-mail : ama-marina.kreme@lis-lab.fr/ama-marina.kreme@univ-amu.fr -% Created: 2020-28-01 -%% -wide_dir = './data/data_8000Hz_16384samples/wide_band_sources/'; -loc_dir = './data/data_8000Hz_16384samples/localized_sources/'; - -wide_band_sources_files= dir([wide_dir, '*.wav']); % set the path to the .wav file -localized_sources_files = dir([loc_dir, '*.wav']); - -save('signal_lists.mat','wide_band_sources_files', 'localized_sources_files'); -end - - diff --git a/matlab/tfgm/datasets/wav_write.m b/matlab/tfgm/datasets/wav_write.m deleted file mode 100644 index da354e9..0000000 --- a/matlab/tfgm/datasets/wav_write.m +++ /dev/null @@ -1,14 +0,0 @@ -function wav_write(filename, y, fs) -%% WAV_WRITE -% Function that writes an audio data file $y$ from a sampling frequency $fs$to a -% file called a $filename$.The filename entry also specifies the format -% of the output file. -% -% Author : A. Marina KREME -% e-mail : ama-marina.kreme@lis-lab.fr/ama-marina.kreme@univ-amu.fr -% Created: 2020-28-01 -%% - -x= y/max(abs(y)); -audiowrite(filename,x,fs); -end \ No newline at end of file diff --git a/matlab/tfgm/datasets/wave_read.m b/matlab/tfgm/datasets/wave_read.m deleted file mode 100644 index b413b70..0000000 --- a/matlab/tfgm/datasets/wave_read.m +++ /dev/null @@ -1,54 +0,0 @@ -function x= wave_read(filename, resampling_fs, sig_len, deb) -%% WAVE_READ -- x= wave_read(filename, resampling_fs, sig_len, deb) -% This function takes an input audio signal and resamples it at the desired frequency -% -% Inputs: -% filename : filename in .wav format -% resampling_fs : resampling frequency -% sig_len: (int). signal length -% deb : Start of the selection in seconds or minutes (int) - -% -% Output: -% x : resampled signal -% -% Author : A. Marina KREME -% e-mail : ama-marina.kreme@lis-lab.fr/ama-marina.kreme@univ-amu.fr -% Created: 2020-28-01 -%% -if nargin==3 - deb =0; -end - -if exist(filename, 'file') ~= 2 - error('The file was not found. Please Check the path or the file name : %s.', filename); -end - -[x,fs] = audioread(filename); -x = x(:,1); - - - - -if fs~=resampling_fs - x = resample(x,resampling_fs,fs); -end - -s_end = deb*resampling_fs+sig_len; - -% if s_end > sig_len -% error('Take a start value lower than the value you entered: index exceeds matrix dimension : %.f', s_end); -% end - -if length(x)<sig_len -% msg = ['the length of input signal is smaller than the requested signal length',... -% '. It would be better to take a signal that has a length greater than or equal to sig_len']; -% warning(msg) - y =x; - x=zeros(sig_len,1); - x(1:length(y))=y; -end -x = x(deb*resampling_fs+1:s_end); - - -end \ No newline at end of file -- GitLab