Esempio n. 1
0
--------------------------------------------------------------------------
FILE input: analysis runs on that file (e.g. from real radar data)
./CWsubspace.py ~/redPitayaFs1.25MhzBm500kHzTm20msFb0-115kHz_test1.bin -fs 1.25e6 -t 6.975 6.99 -fx0 115e3 --all

./CWsubspace.py ~/redPitayaFs1.25MhzBm500kHzTm20msFb0-115kHz_test1.bin -fs 1.25e6 -t 6.995 7.01 -fx0 115e3 --all

"""
from time import time
from math import pi, ceil
import numpy as np
import scipy.signal as signal
from matplotlib.pyplot import figure, subplots, show
# https://github.com/scivision/signal_subspace/
try:  # Fortran
    from signal_subspace.importfort import fort
    Sc, Sr = fort()
except ImportError:  # use Python
    Sc = Sr = None
from signal_subspace import esprit, rootmusic
from radioutils import loadbin, freq_translate, downsample

# SIMULATION ONLY
# target
fb0 = 1
# Hz  arbitrary "true" beat frequency sought.
Ab = 0.05  # target amplitude
# transmitter
ft = 1500  # [Hz]
At = 0.5  # transmitter amplitude ~ Power
# Noise
snr = 60  # [dB]  # assumes unit target amplitude, scale accordingly
Esempio n. 2
0
#!/usr/bin/env python3
import numpy as np
from scipy.signal import periodogram, remez, freqz, lfilter
from time import time
from matplotlib.pyplot import subplots, show
#
from signal_subspace.importfort import fort
from signal_subspace.filter import fircirc
S = fort()

fs = 48e3
F = 12345.6  #arbitrary
Ntone = 2
M = 10  #arbitrary, # of lags for autocovariance estimate
L = 64


def main():
    t = np.arange(0, 0.01, 1 / fs)
    #%% noisy sinusoid
    xc = np.exp(
        1j * 2 * np.pi * F *
        t) + 0.01 * (np.random.randn(t.size) + 1j * np.random.randn(t.size))
    xr = np.cos(2 * np.pi * F * t) + 0.01 * np.random.randn(t.size)
    #%% estimate sinusoid frequency

    festc, sigmac = S['c'].subspace.esprit(xc, Ntone // 2, M, fs)

    print('complex')
    print(festc)
    print(sigmac)
Esempio n. 3
0
--------------------------------------------------------------------------
FILE input: analysis runs on that file (e.g. from real radar data)
./CWsubspace.py ~/redPitayaFs1.25MhzBm500kHzTm20msFb0-115kHz_test1.bin -fs 1.25e6 -t 6.975 6.99 -fx0 115e3 --all

./CWsubspace.py ~/redPitayaFs1.25MhzBm500kHzTm20msFb0-115kHz_test1.bin -fs 1.25e6 -t 6.995 7.01 -fx0 115e3 --all

"""
from time import time
from math import pi,ceil
import numpy as np
import scipy.signal as signal
from matplotlib.pyplot import figure,subplots,show
# https://github.com/scivision/signal_subspace/
try:  # Fortran
    from signal_subspace.importfort import fort
    Sc,Sr = fort()
except ImportError:  # use Python
    Sc=Sr=None
from signal_subspace import esprit, rootmusic
from radioutils import loadbin,freq_translate,downsample

# SIMULATION ONLY
# target
fb0 = 1
  # Hz  arbitrary "true" beat frequency sought.
Ab = 0.05    # target amplitude
# transmitter
ft = 1500  # [Hz]
At = 0.5    # transmitter amplitude ~ Power
# Noise
snr = 60 # [dB]  # assumes unit target amplitude, scale accordingly