[mus422] CalcSMRs without for loop

Colin Raffel craffel at ccrma.Stanford.EDU
Fri Feb 12 15:17:51 PST 2010


Hi guys, did anyone get a CalcSMRs function that doesn't use a for  
loop?  My problem is that I can't mass instantiate the masker class,  
so I have to do it one by one for each FFT bin:

   # Create maskers
   for i in xrange(np.size(dataFFT)):
     masker = psychoac.Masker(binFreqs[i], psychoac.SPL(dataFFT[i]))
     # Find max
     maskerSum =  
np.maximum(psychoac.SPL(masker.IntensityAtFreq(binFreqs)),maskerSum)

It runs very slow with this loop.  Any ideas?

-Colin



More information about the 422 mailing list