How to use the spectral.FFT function in spectral

To help you get started, we’ve selected a few spectral examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JohnVinyard / zounds / zounds / analyze / feature / test_spectral.py View on Github external
def test_no_args_correct_inshape(self):
        ws = 2048
        Environment.instance = MockEnvironment(ws)
        re = RootExtractor(shape = 100)
        fft = FFT(needs = re)
        self.assertEqual((2048,),fft._inshape)
github JohnVinyard / zounds / zounds / analyze / feature / test_spectral.py View on Github external
def test_no_args_correct_dim(self):
        ws = 2048
        Environment.instance = MockEnvironment(ws)
        re = RootExtractor(shape = 100)
        fft = FFT(needs = re)
        self.assertEqual(1024,fft._dim)
github JohnVinyard / zounds / zounds / analyze / feature / test_spectral.py View on Github external
def test_no_args_oned_audio(self):
        ws = 2048
        Environment.instance = MockEnvironment(ws)
        re = RootExtractor(shape = ws)
        fft = FFT(needs = re)
        ec = ExtractorChain([re,fft])
        data = ec.collect()
        fftdata = np.concatenate(data[fft])
        self.assertEqual(1024,fftdata.shape[1])
github JohnVinyard / zounds / zounds / analyze / feature / test_spectral.py View on Github external
def test_reshape(self):
        re = RootExtractor(shape = 100)
        fft = FFT(needs = re, inshape = (10,10), axis = 1)
        ec = ExtractorChain([re,fft])
        data = ec.collect()
        # multiple power spectrums are always unravelled, so we should see
        # 10 frames with 50 coefficients each, i.e., each input is of shape
        # (10,10), which is reduced to shape (10,5) by performing an fft over 
        # the first dimension.  Finally, each frame of (10,5) is flattened to 
        # shape (50,)
        fftdata = np.concatenate(data[fft])
        self.assertEqual(50,fftdata.shape[1])
github JohnVinyard / zounds / zounds / analyze / feature / test_spectral.py View on Github external
def test_multiframe(self):
        # This test is nearly identical to test_reshape, except that it gathers
        # inputs of size (10,) for 10 frames before processing, instead of 
        # processing inputs of size 100 each frame.
        re = RootExtractor(shape = 10)
        fft = FFT(needs = re, inshape = (10,10), nframes = 10)
        ec = ExtractorChain([re,fft])
        data = ec.collect()
        fftdata = np.concatenate(data[fft])
        self.assertEqual((1,50),fftdata.shape)
        #self.assertTrue(np.all([50 == len(f) for f in data[fft]]))