Efficiently computing a LARGE spectrogram
8 views (last 30 days)
Show older comments
Hello,
I need to creat a spectrogram of a 6 minutes WAV file of 44100 Hz sampling rate. This is my code at the moment:
[s,fs] = audioread(...); % read the mono file
window = blackmanharris(2048);
noverlap = 1024*3/2;
nfft = fs/5; % for about 5Hz resolution, also tried 2^13 or 2^14
[~,f,t,p] = spectrogram(s,window,noverlap,nfft,fs);
but the computation never finishes and I need to kill Matlab. I think the system is running out of memory (8GB on OS X ).
Is there a way to make it finish?
2 Comments
Adam
on 10 Mar 2015
Do you need 5Hz resolution? That sounds pretty small for frequencies up to 44100. Maybe it is needed though. I work with seismic signals personally where sample frequencies there are more like 250-1000 Hz so I'm not familiar with signals of your length and sample rate.
You could also try reducing the overlap, but if you want that level of quality you may have to do it in chunks instead of all in one go.
It is a windowed transform so can clearly be broken down into sections that can be run independently of each other.
Answers (0)
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!