I'm trying to obtain the overall LTAS of a large batch of audio (wav) files. To do this, I should obtain the LTAS of each file individually, then take the average value across all LTASs for each frequency. I also need the standard deviation for each frequency. I'm doing this in Matlab, but am rather a noob. Can anyone offer any pointers to help me write a Matlab script to do this? Thanks!
- use "wavread()" to read the audio files
- use "pwelch()" to calculated the power spectrum of the songs
- you do energy averagin over multiple songs.
Something like this (just a code sketch)
nx = 8192; % that's about 5 Hz @44.1 kHz dd = dir('*.wav'); % all files in the current directory nFiles = length(dd); LTAS = zeros(nx/2+1,nFiles) for i = 1:nFiles x = wavread(dd(i).name); LTAS(:,i) = pwelch(x,hanning(nx),nx/2); end LTASOverAllSongs = mean(LTAS,2);