Remove dependency on scipy, use numpy hanning window.

pull/13/head
Mark Jessop 2020-06-27 17:20:05 +09:30
rodzic 72e35a9df3
commit 485a875d8d
4 zmienionych plików z 19 dodań i 17 usunięć

Wyświetl plik

@ -1,5 +1,4 @@
numpy numpy
scipy
pyaudio pyaudio
requests requests
crcmod crcmod

Wyświetl plik

@ -40,11 +40,10 @@ if __name__ == "__main__":
"Intended Audience :: Developers", "Intended Audience :: Developers",
"Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.7",
] ],
# TODO: Deal with entry points. entry_points={
# entry_points={ "console_scripts": [
# "console_scripts": [ "horus-gui=horusgui.gui",
# "hfssdv=hfssdv.gui.main", ]
# ] }
# },
) )

Wyświetl plik

@ -2,7 +2,6 @@
import logging import logging
import time import time
import numpy as np import numpy as np
import scipy.signal
from queue import Queue from queue import Queue
from threading import Thread from threading import Thread
@ -40,7 +39,7 @@ class FFTProcess(object):
def init_window(self): def init_window(self):
""" Initialise Window functions and FFT scales. """ """ Initialise Window functions and FFT scales. """
self.window = scipy.signal.blackmanharris(self.nfft) self.window = np.hanning(self.nfft)
self.fft_scale = np.fft.fftshift(np.fft.fftfreq(self.nfft)) * self.fs self.fft_scale = np.fft.fftshift(np.fft.fftfreq(self.nfft)) * self.fs
self.mask = (self.fft_scale > self.range[0]) & (self.fft_scale < self.range[1]) self.mask = (self.fft_scale > self.range[0]) & (self.fft_scale < self.range[1])

Wyświetl plik

@ -160,6 +160,7 @@ w1_habitat.addWidget(widgets["userAntennaLabel"], 3, 0, 1, 1)
w1_habitat.addWidget(widgets["userAntennaEntry"], 3, 1, 1, 2) w1_habitat.addWidget(widgets["userAntennaEntry"], 3, 1, 1, 2)
w1_habitat.addWidget(widgets["userRadioLabel"], 4, 0, 1, 1) w1_habitat.addWidget(widgets["userRadioLabel"], 4, 0, 1, 1)
w1_habitat.addWidget(widgets["userRadioEntry"], 4, 1, 1, 2) w1_habitat.addWidget(widgets["userRadioEntry"], 4, 1, 1, 2)
w1_habitat.layout.setRowStretch(5,1)
d0_habitat.addWidget(w1_habitat) d0_habitat.addWidget(w1_habitat)
@ -175,6 +176,8 @@ w1_other.addWidget(widgets["horusUploadLabel"], 0, 0, 1, 1)
w1_other.addWidget(widgets["horusUploadSelector"], 0, 1, 1, 1) w1_other.addWidget(widgets["horusUploadSelector"], 0, 1, 1, 1)
w1_other.addWidget(widgets["horusUDPLabel"], 1, 0, 1, 1) w1_other.addWidget(widgets["horusUDPLabel"], 1, 0, 1, 1)
w1_other.addWidget(widgets["horusUDPEntry"], 1, 1, 1, 1) w1_other.addWidget(widgets["horusUDPEntry"], 1, 1, 1, 1)
w1_other.layout.setRowStretch(5,1)
d0_other.addWidget(w1_other) d0_other.addWidget(w1_other)
# Spectrum Display # Spectrum Display
@ -183,12 +186,6 @@ widgets["spectrumPlot"].setLabel("left", "Power (dB)")
widgets["spectrumPlot"].setLabel("bottom", "Frequency (Hz)") widgets["spectrumPlot"].setLabel("bottom", "Frequency (Hz)")
widgets["spectrumPlotData"] = widgets["spectrumPlot"].plot([0]) widgets["spectrumPlotData"] = widgets["spectrumPlot"].plot([0])
widgets["spectrumPlot"].setLabel("left", "Power (dBFs)")
widgets["spectrumPlot"].setLabel("bottom", "Frequency", units="Hz")
widgets["spectrumPlot"].setXRange(100, 4000)
widgets["spectrumPlot"].setYRange(-100, -20)
widgets["spectrumPlot"].setLimits(xMin=0, xMax=4000, yMin=-120, yMax=0)
# Frequency Estiator Outputs # Frequency Estiator Outputs
widgets["estimatorLines"] = [ widgets["estimatorLines"] = [
pg.InfiniteLine( pg.InfiniteLine(
@ -215,6 +212,12 @@ widgets["estimatorLines"] = [
for _line in widgets["estimatorLines"]: for _line in widgets["estimatorLines"]:
widgets["spectrumPlot"].addItem(_line) widgets["spectrumPlot"].addItem(_line)
widgets["spectrumPlot"].setLabel("left", "Power (dBFs)")
widgets["spectrumPlot"].setLabel("bottom", "Frequency", units="Hz")
widgets["spectrumPlot"].setXRange(100, 4000)
widgets["spectrumPlot"].setYRange(-100, -20)
widgets["spectrumPlot"].setLimits(xMin=100, xMax=4000, yMin=-120, yMax=0)
d1.addWidget(widgets["spectrumPlot"]) d1.addWidget(widgets["spectrumPlot"])
widgets["spectrumPlotRange"] = [-100, -20] widgets["spectrumPlotRange"] = [-100, -20]
@ -330,8 +333,10 @@ def start_decoding():
# TODO: Grab horus data here. # TODO: Grab horus data here.
# Init FFT Processor # Init FFT Processor
NFFT = 2**14
STRIDE = 2**13
fft_process = FFTProcess( fft_process = FFTProcess(
nfft=8192, stride=4096, fs=_sample_rate, callback=add_fft_update nfft=NFFT, stride=STRIDE, fs=_sample_rate, callback=add_fft_update
) )
# TODO: Setup modem here # TODO: Setup modem here