[mus422] CalcSMRs without for loop

Jon Peterson Stanford at jonrpeterson.com
Fri Feb 12 15:59:40 PST 2010


I ran a loop, but I only created maskers for each peak detected in the
frequency domain.

1.  Take the FFT with some amount of zero padding (5x, for example)
2.  Find all of the peaks in the spectrum (simplest way of doing this is
looking for a low-high-low transition)
3.  Create your maskers based on the peaks you detected in step 2.

I hope this helps!

-Jon-


On Fri, Feb 12, 2010 at 3:17 PM, Colin Raffel <craffel at ccrma.stanford.edu>wrote:

> 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
>
> _______________________________________________
> 422 mailing list
> 422 at ccrma.stanford.edu
> http://cm-mail.stanford.edu/mailman/listinfo/422
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cm-mail.stanford.edu/pipermail/422/attachments/20100212/4842b36a/attachment.html 


More information about the 422 mailing list