rxdecdsp = dsp.resample.Resample(outputRate=44000) rxlimitdsp = dsp.limiter.Limiter(mi=-1, ma=1) rxsndsink = dsp.sink.Sink(sndDev) rxplotdsp = dsp.plot.Plot("RX Demodulated fm") rxplotfm = dsp.plot.Plot("RX decimated td") rxplotfft = dsp.fftPlot.FftPlot("RX Decimated spectrum", nmax=512) rxplotfftfull = dsp.fftPlot.FftPlot("RX full spectrum", nmax=512) rxplotfftfir = dsp.fftPlot.FftPlot("RX firfiltered full spectrum", nmax=512) rxsquelch = dsp.squelch.Squelch(threshold=0.01, hold=0.00000) rxac = dsp.acCouple.AcCouple() rxac2 = dsp.acCouple.AcCouple() rxstatdsp = dsp.status.Status() rxdsp = dspPipeLine.DspPipeLine([[rxsdrsrc], [rxac], [rxplotfftfull], [rxfirdsp], [rxplotfftfir], [rxdecdsp], [rxplotfft], [rxplotfm], [rxsquelch], [rxfmdsp], [rxac2], [rxplotdsp], [rxagcdsp], [rxsndsink], [rxstatdsp]]) #rxdsp = dspPipeLine.DspPipeLine([ [rxsdrsrc], [rxac], [rxplotfftfull], [rxfirdsp],[rxplotfftfir], [rxdecdsp], [rxplotfft], [rxsquelch], [rxfmdsp],[rxac2], [rxagcdsp],[rxsndsink], [rxstatdsp]]) print("starting tx pipeline") print("starting rx pipeline") rxdsp.start() try: while True: time.sleep(10) rxdsp.status() except KeyboardInterrupt: print("stopping dsp pipeline") rxdsp.stop() txdsp.stop()
limitdsp = dsp.limiter.Limiter(mi=-1, ma=1) sndsink = dsp.sink.Sink(sndDev) plotdsp = dsp.plot.Plot("Demodulated fm") plotfm = dsp.plot.Plot("decimated td") plotfft = dsp.fftPlot.FftPlot("Decimated spectrum", nmax=512) plotfftfull = dsp.fftPlot.FftPlot("full spectrum", nmax=512) plotfftfir = dsp.fftPlot.FftPlot("firfiltered full spectrum", nmax=512) squelch = dsp.squelch.Squelch(threshold=0.01, hold=0.00000) ac = dsp.acCouple.AcCouple() ac2 = dsp.acCouple.AcCouple() statdsp = dsp.status.Status() tunedsp = dsp.tuner.Tuner(nco=-150000) dsp = dspPipeLine.DspPipeLine([ [sdrsrc], [tunedsp], [ac], [plotfftfull], [firdsp], [plotfftfir], [decdsp], [plotfft], [plotfm], [squelch], [fmdsp], [ac2], [plotdsp], [agcdsp], [sndsink], [statdsp] ]) # [agcdsp], [sndsink], [fftdsp], [dbdsp, limitdsp], [plotdsp]]) print "starting pipeline" dsp.start() try: while True: time.sleep(10) dsp.status() except KeyboardInterrupt: print "stopping dsp pipeline" dsp.stop() sndDev.stop() exit(0)
txagcproc = dsp.agc.Agc(rate=0.01 * 5) txfir = dsp.fir.Fir(taps=128, passBand=0.1, transition=0.01) txfmmod = dsp.fmMod.FmMod(6000) txplotdsp = dsp.plot.Plot("TX AF time") txplotfilt = dsp.plot.Plot("TX Filtered") txplotfft = dsp.fftPlot.FftPlot("TX AF freq", nmax=2048) txplotfm = dsp.plot.Plot("TX FM time") txplotfftfm = dsp.fftPlot.FftPlot("TX FM freq", nmax=2048) txrfplotdsp = dsp.plot.Plot("TX RF time") txrfplotfft = dsp.fftPlot.FftPlot("TX RF freq", nmax=2048) txresamp = dsp.resample.Resample(outputRate=4e6) txsink = dsp.sink.Sink(sdr) txstatdsp = dsp.status.Status() txdsp = dspPipeLine.DspPipeLine([[txsndsrc], [txplotdsp], [txplotfft], [txfir], [txplotfilt], [txsquelch], [txfmmod], [txplotfm], [txplotfftfm], [txresamp], [txrfplotdsp], [txrfplotfft], [txsink], [txstatdsp]]) rxsdrsrc = dsp.source.Source(sdr, samples=32768, fc=sdr.getFrequency()['rx'], rate=sdr.getSampleRate()['rx']) rxfirdsp = dsp.fir.Fir(taps=256, passBand=0.00001) rxfmdsp = dsp.fmDemod.FmDemod() rxagcdsp = dsp.agc.Agc(target=1, maxAmp=10, rate=0.01) rxfftdsp = dsp.fft.Fft(samples=4096) rxdbdsp = dsp.db.Db() rxdecdsp = dsp.resample.Resample(outputRate=44000) rxlimitdsp = dsp.limiter.Limiter(mi=-1, ma=1) rxsndsink = dsp.sink.Sink(sndDev)
import dsp.resample import dsp.printer import dsp.fir import dsp.fmMod import dsp.agc import dsp.squelch import time print("Creating sound device") sndDev = soundDevice.SoundDevice() print("Setting up processors") sndsrc = dsp.source.Source(sndDev, samples=512, fc=0, rate=44000) sndsnk = dsp.sink.Sink(sndDev) plot = dsp.plot.Plot("AF time") plotFrequency = dsp.fftPlot.FftPlot("AF frequency") statdsp = dsp.status.Status() dsp = dspPipeLine.DspPipeLine([[sndsrc], [plot], [plotFrequency], [sndsnk], [statdsp]]) print("starting pipeline") dsp.start() try: while True: time.sleep(10) dsp.status() except KeyboardInterrupt: print("stopping dsp pipeline") dsp.stop() sndDev.stop() exit(0)
sdr = openSdr() print "Creating sound device" sndDev = soundDevice.SoundDevice() print "Setting up processors for tx pipe" txsndsrc = dsp.source.Source(sndDev, samples=512, fc = 0, rate = 44000); txsquelch = dsp.squelch.Squelch(threshold=0.2, hold = 0.2) txagcproc = dsp.agc.Agc(rate = 0.01*5) txfir = dsp.fir.Fir(taps = 128, passBand = 0.1, transition = 0.01) txfmmod = dsp.fmMod.FmMod(6000) txresamp = dsp.resample.Resample(outputRate = 4e6) txsink = dsp.sink.Sink(sdr) txstatdsp = dsp.status.Status() txdsp = dspPipeLine.DspPipeLine([ [txsndsrc], [txfir],[txsquelch], [txfmmod] , [txresamp], [txsink], [txstatdsp]]) rxsdrsrc = dsp.source.Source(sdr, samples = 32768, fc = sdr.getFrequency()['rx'], rate = sdr.getSampleRate()['rx']) rxfirdsp = dsp.fir.Fir(taps = 256, passBand=0.00001); rxfmdsp = dsp.fmDemod.FmDemod() rxagcdsp = dsp.agc.Agc(target=1, maxAmp = 10, rate =0.01) rxfftdsp = dsp.fft.Fft(samples=4096) rxdbdsp = dsp.db.Db() rxdecdsp = dsp.resample.Resample(outputRate=44000) rxlimitdsp = dsp.limiter.Limiter(mi=-1, ma = 1) rxsndsink = dsp.sink.Sink(sndDev); rxsquelch = dsp.squelch.Squelch(threshold = 0.01, hold = 0.00000) rxac = dsp.acCouple.AcCouple() rxac2 = dsp.acCouple.AcCouple()
squelch = dsp.squelch.Squelch(threshold=0.2, hold=0.2) agcproc = dsp.agc.Agc(rate=0.01 * 5) fir = dsp.fir.Fir(taps=128, passBand=0.1, transition=0.01) fmmod = dsp.fmMod.FmMod(6000) plotdsp = dsp.plot.Plot("AF time") plotfilt = dsp.plot.Plot("Filtered") plotfft = dsp.fftPlot.FftPlot("AF freq", nmax=2048) plotfm = dsp.plot.Plot("FM time") plotfftfm = dsp.fftPlot.FftPlot("FM freq", nmax=2048) rfplotdsp = dsp.plot.Plot("RF time") rfplotfft = dsp.fftPlot.FftPlot("RF freq", nmax=2048) resamp = dsp.resample.Resample(outputRate=4e6) sink = dsp.sink.Sink(sdr) statdsp = dsp.status.Status() dsp = dspPipeLine.DspPipeLine([[sndsrc], [plotdsp], [plotfft], [fir], [plotfilt], [squelch], [fmmod], [plotfm], [plotfftfm], [resamp], [rfplotdsp], [rfplotfft], [sink], [statdsp]]) #dsp = dspPipeLine.DspPipeLine([ [sndsrc],[resamp],[sink]]) print "starting pipeline" dsp.start() try: while True: time.sleep(10) dsp.status() except KeyboardInterrupt: print "stopping dsp pipeline" dsp.stop() sndDev.stop() exit(0)
np.linspace(o, ((40 * np.pi) * (nsample - 1) / nsample) + o, nsample)) time.sleep(0.001) return samples sigsrc = SineSource() print("Setting up processors") sndsrc = dsp.source.Source(sigsrc, fc=0, rate=44000, samples=16) plotdsp = dsp.plot.Plot("AF time ") plotfft = dsp.fftPlot.FftPlot("AF freq", nmax=512) decdsp = dsp.resample.Resample(44000 * 10) plotdspd = dsp.plot.Plot("AF time resample") plotfftd = dsp.fftPlot.FftPlot("AF freq resample", nmax=512) statdsp = dsp.status.Status() dsp = dspPipeLine.DspPipeLine([[sndsrc], [plotdsp], [plotfft], [decdsp], [plotdspd], [plotfftd], [statdsp]]) print("starting pipeline") dsp.start() try: while True: time.sleep(10) dsp.status() except KeyboardInterrupt: print("stopping dsp pipeline") dsp.stop() sndDev.stop() exit(0)