4040
4141 for iFreq = 1 : length(theseRecs )
4242 try thisRec = theseRecs{iFreq }(theseSizes(iFreq ,1 ): theseSizes(iFreq ,2 ),: );
43- [pxx ,f ] = periodogram(thisRec ,[],[],sf );
43+ % use pwelch instead of periodogram to allow for use of Hamming
44+ % window (reduces variance but decreases peak resolution/increases peak width)
45+ % alternatively, periodogram with shorter window (or full-length
46+ % hamming window to reduce edge effects?)
47+ [pxx ,f ] = pwelch(thisRec ,5000 ,[],[],sf );
4448 allF = [allF mean(f ,2 )];
4549 allPSD = [allPSD mean(pxx ,2 )];
4650 allSize = [allSize theseSizes(iFreq ,3 )];
6468 meansByFreq (: ,iProfile ) = mean(thesePSD ,2 );
6569end
6670
67- plot(meanF ,10 * log10(meansByFreq ));
71+ plot(meanF ,meansByFreq );
72+ set(gca , ' YScale' , ' log' , ' XScale' , ' log' );
73+
6874xlabel(' frequency (Hz)' );
69- ylabel(' dB ' );
75+ ylabel(' A^2 ' );
7076legend(num2str(eachFreq ' ));
7177box off ;
72- % plotfixer;
73-
7478chH = get(gca ,' children' );
75- set(gca ,' children' ,flipud(chH ));
79+ set(gca ,' children' ,flipud(chH ));
80+ plotfixer ;
0 commit comments