bug_fixes_integration_tx
David Michaeli 2022-01-03 16:39:27 +02:00
commit 172e067762
8 zmienionych plików z 43 dodań i 37 usunięć

Wyświetl plik

@ -0,0 +1,7 @@
# CaribouLite Examples
This folder contains examples categorized by programming languages:
- `cpp` - C/C++ examples
- `python` - python applets and example
# License
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.

Wyświetl plik

@ -1,12 +1,19 @@
# PySimpleGUI
from PySimpleGUI.PySimpleGUI import Canvas, Column
import time
import numpy as np
from PySimpleGUI import Window, WIN_CLOSED, Slider, Button, theme, Text, Radio, Image, InputText, Canvas
# Numpy
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
import numpy as np
from numpy.lib.arraypad import pad
# System
import time
# Soapy
import SoapySDR
from SoapySDR import SOAPY_SDR_RX, SOAPY_SDR_TX, SOAPY_SDR_CS16
from PySimpleGUI import Window, WIN_CLOSED, Slider, Button, theme, Text, Radio, Image, InputText, Canvas
from numpy.lib.arraypad import pad
##
## WINDOW FUNCTIONS
@ -115,7 +122,8 @@ def update_est_graphs(window, freq_diff, g_vec, phi_vec, rssi_vec):
draw_figure_with_toolbar(window['params_cv'].TKCanvas, fig, window['controls_params_cv'].TKCanvas)
##
## I/Q Correction Functions
## I/Q Correction Function - Blind correction
def fix_iq_blind(x):
z = x - np.mean(x)
p_in = np.var(z)
@ -134,6 +142,8 @@ def fix_iq_blind(x):
return (z_out, g, phi, p_in, c1, c2)
##
## I/Q Correction Function - single tone correction
def fix_iq_imbalance(x):
# remove DC and save input power

Wyświetl plik

@ -1,12 +1,19 @@
# PySimpleGUI
from PySimpleGUI.PySimpleGUI import Canvas, Column
import time
import numpy as np
from PySimpleGUI import Window, WIN_CLOSED, Slider, Button, theme, Text, Radio, Image, InputText, Canvas
# Numpy
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
import numpy as np
from numpy.lib.arraypad import pad
# System
import time
# Soapy
import SoapySDR
from SoapySDR import SOAPY_SDR_RX, SOAPY_SDR_TX, SOAPY_SDR_CS16
from PySimpleGUI import Window, WIN_CLOSED, Slider, Button, theme, Text, Radio, Image, InputText, Canvas
from numpy.lib.arraypad import pad
def setup_receiver(sdr, channel, freq_hz):
@ -23,19 +30,19 @@ def update_receiver_freq(sdr, stream, channel, freq_hz):
sdr.setFrequency(SOAPY_SDR_RX, channel, freq_hz)
# Initialize CaribouLite Soapy
sdr = SoapySDR.Device(dict(driver="Cariboulite")) # Create Cariboulite
##
## GLOBAL AREA
##
# Data and Source Configuration
rx_chan = 0 # 6G = 1
freq = 915.1e6
rx_stream = setup_receiver(sdr, rx_chan, freq)
N = sdr.getStreamMTU(rx_stream) >> 3 # Number of complex samples per transfer
N = 16384 # Number of complex samples per transfer
rx_buff = np.empty(2 * N, np.int16) # Create memory buffer for data stream
freq = 915e6
# Initialize CaribouLite Soapy
sdr = SoapySDR.Device(dict(driver="Cariboulite")) # Create Cariboulite
rx_stream = setup_receiver(sdr, rx_chan, freq)
sdr.activateStream(rx_stream)
sr = sdr.readStream(rx_stream, [rx_buff], N, timeoutUs=int(5e6))
@ -54,7 +61,6 @@ Fs = 4e6
#N = 2048
#x = x[0:N] # we will only take the FFT of the first 1024 samples, see text below
x = x * np.hamming(len(x)) # apply a Hamming window
x = x / 4096
PSD = (np.abs(np.fft.fft(x))/N)**2
PSD_log = 10.0*np.log10(PSD)
@ -71,4 +77,4 @@ plt.show()
fig = plt.figure()
plt.plot(s_real)
plt.plot(s_imag)
plt.show()
plt.show()

Wyświetl plik

@ -1,2 +0,0 @@
a = 5
print("Hello, World ", a)

Wyświetl plik

@ -1,8 +0,0 @@
import numpy as np
import matplotlib.pyplot as plt
#a = np.arange(15).reshape(3,5)
a = np.arange(15)
plt.plot(a, np.sin(a))
plt.ylabel('some numbers')
plt.show()

Wyświetl plik

@ -27,7 +27,7 @@ module top(
input i_iq_rx_clk_p, // Paired with i_iq_rx_clk_n - only the 'B' pins need to be specified
// Note: The icestorm (specifically nextpnr) fails to build if both diff pins are constrained
// in the constrain file and the interface herein. Thus we need to take the out so that
// in the constrain file and the interface herein. Thus we need to take them out so that
// it will "understand" we actually want an LVDS pair inputs. In addition, the pair is
// defined only by the "B" pins in BANK3 and not the "A" pins (which is counter-logical)

Wyświetl plik

@ -1,7 +0,0 @@
# Overview
Coming soon!
# License
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.