mhostetter / sdr

A Python package for software-defined radio
https://mhostetter.github.io/sdr/
MIT License
36 stars 4 forks source link

Bug in spectrogram shift #406

Closed mhostetter closed 1 month ago

mhostetter commented 1 month ago

Should be

        if y_axis == "two-sided":
            # f[f >= 0.5 * sample_rate] -= sample_rate  # Wrap frequencies from [0, 1) to [-0.5, 0.5)
            f = np.fft.fftshift(f)
            # Before
            Sxx = np.fft.fftshift(Sxx)
            # After
            Sxx = np.fft.fftshift(Sxx, axes=0)