jledet / waterfall

HTML Canvas Waterfall Plot
MIT License
81 stars 27 forks source link

Using hackrf rather than usrp #7

Closed gallitim closed 2 years ago

gallitim commented 2 years ago

Hello, This implementation is very helpful, however, I am struggling to configure it such that it works with hackf rather than a usrp. I changed a bit of the init method to work with osmosdr rather than uhd, but I am getting no output on the werbserver. Does anyone have any tips?

gallitim commented 2 years ago

Hello, This implementation is very helpful, however, I am struggling to configure it such that it works with hackf rather than a usrp. I changed a bit of the init method to work with osmosdr rather than uhd, but I am getting no output on the werbserver. Does anyone have any tips?

This is what the init looks like:

def __init__(self, samp_rate, freq, gain, fft_size, framerate):       
    gr.top_block.__init__(self, "Top Block")
    self.osmosdrpy = osmosdr.source()
    self.osmosdrpy.set_sample_rate(samp_rate)
    self.osmosdrpy.set_center_freq(freq, 0)
    self.osmosdrpy.set_gain(gain, 0)

    self.fft = logpwrfft.logpwrfft_c(
        sample_rate=samp_rate,
        fft_size=fft_size,
        ref_scale=1,
        frame_rate=framerate,
        avg_alpha=1,
        average=False,
    )
    self.fft_broadcast = fft_broadcast_sink(fft_size)
    self.connect((self.fft, 0), (self.fft_broadcast, 0))
    self.connect((self.osmosdrpy, 0), (self.fft, 0))