wav file to big to input in a Hopfield network

2 views (last 30 days)
My goal is to build an Hopfield network able to recognize the difference between someone saying "turn left" and someone saying "turn right" (using different subjects). I recorded the .wav files and read them into Matlab; I show the code here:
[y, fs]=audioread('turnLeft.wav');
sound(y, fs); % Playback of the sound data
time=(1:length(y))/fs; % Time vector on x-axis
plot(time, y); % Plot the waveform w.r.t. time
[x, fs]=audioread('turnRight.wav');
% find size of vector
[m,n] = size(y) % 34160
[a,b] = size(x) % 36192
% make the two vectors the same size
%33856 - 184
l2 = l(1:33856);
r2 = r(1:33856);
% build the weight matrix
T = [l2; r2]';
net = newhop(T);
As you can imagine I encounter a problem when I build a weight matrix: the vectors are too big!
Error using svd
Requested 33856x33856 (8.5GB) array exceeds maximum array
size preference.
The final goal is having the trained network read incomplete files (like someone saying only "...n left") and then having it "restore" the files and reread them back to the user ("turn left"). So I need a method to compress the .wav files in a way that will allow me to decompress them once I have trained the network. Someone suggested I use a Mel scale spectrogram to reduce the file size (there should be a library called "librosa" in Python that does that); I have looked it up but I am confused and I am not sure it is the right way to go. Thank you in advance for the help.

Answers (0)

Community Treasure Hunt

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

Start Hunting!