Requested 48000x48000 (17.2GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. Error in dtw (line 16) d=(repmat(t(:),1,M)-repmat(r(:)',N,1)).^2; %t
Ältere Kommentare anzeigen
clc,clear, close all
warning off;
[audio,fs]=audioread('11.wav');
[speech,fs]=audioread('13.wav');
[dist,ix,iy] = dtw(audio,speech)
3 Kommentare
Jan
am 31 Mai 2021
warning off; is a really bad idea. Don't do this in productive work.
The error message is clear: The size of the problem is bigger than the available RAM. Which kind of help do you expect?
manoj sain
am 1 Jun. 2021
Correct. For the dtw() command, a matrix is created, which has the sizes of the inputs as side lengths. This means, that 2 huge signals create a huge^2 matrix. If this exhausts your memory, you need more memory or smaller inputs.There is no magic third way.
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 3 Jun. 2021
1 Stimme
This is the kind of reason why spectrograms and similar processes take windows into the data.
To prevent artifacts where the windows join, typically overlapping windows are used.
For some kinds of processes, 50% overlap is used -- so for example for [1 2 3 4 5 6], one window would be [1 2 3 4], then the second window would be [3 4 5 6].
For other kinds of processes, a 10% overlap is common.
For audio, instead of a fixed size of overlap, it sometimes make sense to calculate the overlap based upon a particular time. To make up a number, there might be certain cases where some kinds of distortions tend to become perceptible around 5 milliseconds, so the overlap might be chosen in terms of the number of samples that fit 5 milliseconds.
The size of the window, together with the sampling frequency, will determine the frequency resolution.
If you have 48000 samples, then you just might be working with one second of sound at 48000 samples per second. 48000 is one of the "magic numbers" in audio: 48000 samples per second gets used for some kinds of professional audio, such as DVDs, but 24000 samples per second is not nearly as likely to be used. Instead, near that range, 22050 samples per second is more likely, as that is CD quality.
At 48000 Hz, that is about 21 microseconds per sample. https://www.sfu.ca/sonic-studio-webdav/handbook/Binaural_Hearing.html says that humans can detect timing differences of 30 microseconds. You just might be studying timing perception, so potentially you might not be able to window much at all.
Kategorien
Mehr zu Descriptive Statistics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
