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

N
Nathaniel · Dec 31, 2020 · 2.2K views
Question
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 PhD Expert
Answered Aug 26, 2026
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
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!