discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Strange problem when reading from gr.GR_SIN_WAVE.....


From: Kshitij Singh
Subject: [Discuss-gnuradio] Strange problem when reading from gr.GR_SIN_WAVE.....
Date: Thu, 29 Nov 2007 17:59:44 -0500

Hi all,

    I am a newbie to GNU Radio. I just started off with my first program and decided to read some floating point samples from the gr.GR_SIN_WAVE into a file. My problem is that every time I run the program, I get a different file size. I even tried to change the file name after the first run, but again ended up with the same problem. Here's the script:
------------------------------------------------------------

from gnuradio import gr
import time

def my_graph():
        sampling_frequency = 10000
        amplitude =0.1
        graph1 = gr.flow_graph()
        source = gr.sig_source_f(sampling_frequency,gr.GR_SIN_WAVE,100,amplitude)
        destination = gr.file_sink(gr.sizeof_float, '/home/anshul/Desktop/samples1.dat')
        graph1.connect(source,destination)
        return graph1

if __name__ == '__main__':
        graph1 = my_graph()
        graph1.start()
        time.sleep(2e-6)
        graph1.stop()
------------------------------------------------------------------

kindly help out with this. Thanks in advance.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]