Out of memory errors when using WVD function on a WAV file.

Illustration
Nathaniel - 2020-12-31T13:55:11+00:00
Question: Out of memory errors when using WVD function on a WAV file.

I converted a WAV file into a vector in matlab wsing the "audioread" function. Running into an out of memory error when using the "wvd" function on the same vector. How to get rid of the error and get the plot? I'm using i7 processor with 32GB RAM. Execute the following script to reproduce the error:   load handel.mat filename = 'handel.wav'; audiowrite(filename,y,Fs); clear y Fs [y,Fs] = audioread('handel.wav'); wvd(y)

Expert Answer

Profile picture of John Michell John Michell answered . 2025-11-20

WVD is computationally expensive as it computes spectral content for each input sample.
To reduce the degree of oversampling in time we can use the smoothed pseudo Wigner Ville transform with a reduced number of time samples.
The following modifications to the code will resolve the error:
 
load handel.mat
filename = 'handel.wav';
audiowrite(filename,y,Fs);
[y,Fs] = audioread('handel.wav');
wvd(y,'smoothedPseudo',hamming(601),rectwin(305), 'NumTimePoints',310,'MinThreshold',-50) % specify NumTimePoints to reduce the degree of oversampling of WVD


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!