soapypower/psd.py
def result(self, psd_state):
        """Return freqs and averaged PSD for given center frequency"""
        freq_array = numpy.fft.fftshift(psd_state['freq_array'])
        pwr_array = numpy.fft.fftshift(psd_state['pwr_array'])

        if self._crop_factor:
            crop_bins_half = round((self._crop_factor * self._bins) / 2)
            freq_array = freq_array[crop_bins_half:-crop_bins_half]
            pwr_array = pwr_array[crop_bins_half:-crop_bins_half]

        if psd_state['repeats'] > 1:
            pwr_array = pwr_array / psd_state['repeats']

        if self._log_scale:
            pwr_array = 10 * numpy.log10(pwr_array)

        return (freq_array, pwr_array)
def result(self, psd_state):
        """Return freqs and averaged PSD for given center frequency"""
        freq_array = numpy.fft.fftshift(psd_state['freq_array'])
        pwr_array = numpy.fft.fftshift(psd_state['pwr_array'])

        if self._crop_factor:
            crop_bins_half = round((self._crop_factor * self._bins) / 2)
            freq_array = freq_array[crop_bins_half:-crop_bins_half]
            pwr_array = pwr_array[crop_bins_half:-crop_bins_half]

        if psd_state['repeats'] > 1:
            pwr_array = pwr_array / psd_state['repeats']

        if self._log_scale:
            pwr_array = 10 * numpy.log10(pwr_array)

        return (freq_array, pwr_array)
def result ( self , psd_state ) : freq_array = numpy . fft . fftshift ( psd_state [ 'freq_array' ] ) pwr_array = numpy . fft . fftshift ( psd_state [ 'pwr_array' ] ) if self . _crop_factor : crop_bins_half = round ( ( self . _crop_factor * self . _bins ) / 2 ) freq_array = freq_array [ crop_bins_half : - crop_bins_half ] pwr_array = pwr_array [ crop_bins_half : - crop_bins_half ] if psd_state [ 'repeats' ] > 1 : pwr_array = pwr_array / psd_state [ 'repeats' ] if self . _log_scale : pwr_array = 10 * numpy . log10 ( pwr_array ) return ( freq_array , pwr_array )
Return freqs and averaged PSD for given center frequency
Return freqs and averaged PSD for given center frequency