diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2011-10-13 19:56:29 +0200 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2011-10-13 19:56:29 +0200 |
commit | fad9dd56d73a9b9917177ecf1114dffc3052fa64 (patch) | |
tree | dd61cf5b52e45ad59ff2bcd4ea2cbfb3142f5f29 /liboctopus/python/demos/reader/test.py | |
parent | cbc941282074856fc6179761b70a0c9879b0b64d (diff) | |
download | mini-octopus-fad9dd56d73a9b9917177ecf1114dffc3052fa64.tar.gz mini-octopus-fad9dd56d73a9b9917177ecf1114dffc3052fa64.zip |
python reader stuff
Diffstat (limited to 'liboctopus/python/demos/reader/test.py')
-rw-r--r-- | liboctopus/python/demos/reader/test.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/liboctopus/python/demos/reader/test.py b/liboctopus/python/demos/reader/test.py new file mode 100644 index 0000000..7ecdec0 --- /dev/null +++ b/liboctopus/python/demos/reader/test.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +import time +import numpy as np +from octopus import * + + +op=octopus_context() +octopus_init(op) +octopus_open(op) +octopus_adc_init(op, 33) +octopus_adc_ref(op, 2) + + + +buf = [] +for i in range(200): + buf.append( octopus_adc_get(op, 33) ) + time.sleep(0.01) + print i, buf[-1] + +signal = np.array(buf) +fourier = np.fft.fft(signal) +n = signal.size +freq = np.fft.fftfreq(n, 0.1) +print fourier +print freq + |