Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spectrum_painter/img2iqstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
1 change: 1 addition & 0 deletions spectrum_painter/spectrum_painter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down