diff --git a/spectrum_painter/img2iqstream.py b/spectrum_painter/img2iqstream.py index 974cb0b..2b7946c 100644 --- a/spectrum_painter/img2iqstream.py +++ b/spectrum_painter/img2iqstream.py @@ -19,7 +19,7 @@ def img2iqstream(samplerate, linetime, output, format, srcs): for src in srcs: iq_samples = painter.convert_image(src) target_format = formatter.convert(iq_samples) - output.write(target_format.tostring()) + output.write(target_format.tobytes()) if __name__ == '__main__': diff --git a/spectrum_painter/spectrum_painter.py b/spectrum_painter/spectrum_painter.py index 16e5704..b884d0d 100644 --- a/spectrum_painter/spectrum_painter.py +++ b/spectrum_painter/spectrum_painter.py @@ -28,6 +28,7 @@ def convert_image(self, filename): # Generate random phase vectors for the FFT bins, this is important to prevent high peaks in the output # The phases won't be visible in the spectrum + np.random.seed(0) phases = 2*np.pi*np.random.rand(*fftall.shape) rffts = fftall * np.exp(1j*phases)