diff --git a/Teensy_SDR.ino b/Teensy_SDR.ino new file mode 100644 index 0000000..8fbb657 --- /dev/null +++ b/Teensy_SDR.ino @@ -0,0 +1,420 @@ +/* simple software define radio using the Softrock transceiver + * the Teensy audio shield is used to capture and generate 16 bit audio + * audio processing is done by the Teensy 3.1 + * simple UI runs on a 160x120 color TFT display - AdaFruit or Banggood knockoff which has a different LCD controller + * Copyright (C) 2014 Rich Heslip rheslip@hotmail.com + * History: + * 4/14 initial version by R Heslip VE3MKC + * 6/14 Loftur E. Jónasson TF3LJ/VE2LJX - filter improvements, inclusion of Metro, software AGC module, optimized audio processing, UI changes + * 1/15 RH - added encoder and SI5351 tuning library by Jason Milldrum + * - added HW AGC option which uses codec AGC module + * - added experimental waterfall display for CW + * ToDo: + * implement transmit mode: should be able to do this by switching hilbert filters down to 300-2.7khz and adding a mixer route to line out. + * clean up some of the hard coded HW and UI stuff + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include +#include "si5351.h" +#include +#include // LCD Core graphics library +//#include // 1.8" TFT Module using Samsung S6D02A1 chip +#include // Hardware-specific library +#include +#include "filters.h" + +// SW configuration defines +// don't use more than one AGC! +//#define SW_AGC // define for Loftur's SW AGC - this has to be tuned carefully for your particular implementation +#define HW_AGC // define for codec AGC - doesn't seem to work consistently. audio library bug ? + +// #define CW_WATERFALL // define for experimental CW waterfall - needs faster update rate +//#define AUDIO_STATS // shows audio library CPU utilization etc on serial console + +extern void agc(void); // Moved the AGC function to a separate location + +//SPI connections for Banggood 1.8" display +const int8_t sclk = 5; +const int8_t mosi = 4; +const int8_t cs = 2; +const int8_t dc = 3; +const int8_t rst = 1; + +// Switches between pin and ground for USB/LSB mode, wide and narrow filters +const int8_t ModeSW =21; // USB = low, LSB = high +const int8_t FiltSW =20; // 200 Hz CW filter = high +const int8_t TuneSW =6; // low for fast tune - encoder pushbutton + +// unused pins 4,5, 10 (SDCS) + +int ncofreq = 11000; // IF Oscillator + +// clock generator +Si5351 si5351; + +// encoder switch +Encoder tune(16, 17); + +//Adafruit_QDTech tft = Adafruit_QDTech(cs, dc, mosi, sclk, rst); +// Adafruit_S6D02A1 tft = Adafruit_S6D02A1(cs, dc, mosi, sclk, rst); // soft SPI +Adafruit_S6D02A1 tft = Adafruit_S6D02A1(cs, dc,rst); // hardware SPI + +Metro five_sec=Metro(5000); // Set up a 5 second Metro +Metro loo_ms = Metro(100); // Set up a 100ms Metro +Metro lcd_upd =Metro(100); // Set up a Metro for LCD updates + +const int myInput = AUDIO_INPUT_LINEIN; +//const int myInput = AUDIO_INPUT_MIC; + +// Create the Audio components. These should be created in the +// order data flows, inputs/sources -> processing -> outputs +// + +// FIR filters +AudioFilterFIR Hilbert45_I(USE_FAST_FIR); +AudioFilterFIR Hilbert45_Q(USE_FAST_FIR); +AudioFilterFIR FIR_BPF(USE_FAST_FIR); +AudioFilterFIR postFIR(USE_FAST_FIR); + +AudioInputI2S audioInput; // Audio Shield: mic or line-in +AudioMixer4 Summer; // Summer (add inputs) +AudioAnalyzeFFT256 myFFT(1); // Spectrum Display +AudioSynthWaveform NCO; // Local Oscillator +AudioMultiplier2 Mixer; // Mixer (multiply inputs) +AudioPeak Smeter; // Measure Audio Peak for S meter +AudioMixer4 AGC; // Summer (add inputs) +AudioPeak AGCpeak; // Measure Audio Peak for AGC use +AudioOutputI2S audioOutput; // Audio Shield: headphones & line-out + +AudioControlSGTL5000 audioShield; // Create an object to control the audio shield. + +//--------------------------------------------------------------------------------------------------------- +// Create Audio connections to build a software defined Radio Receiver +// +AudioConnection c1(audioInput, 0, Hilbert45_Q, 0);// Audio inputs to +/- 45 degree filters +AudioConnection c2(audioInput, 1, Hilbert45_I, 0); +AudioConnection c3(Hilbert45_I, 0, Summer, 0); // Sum the shifted filter outputs to supress the image +AudioConnection c4(Hilbert45_Q, 0, Summer, 1); +// +AudioConnection c10(Summer, 0, myFFT, 0); // FFT for spectrum display +AudioConnection c11(Summer,0, FIR_BPF, 0); // 2.4 kHz USB or LSB filter centred at either 12.5 or 9.5 kHz +// // ( local oscillator zero beat is at 11 kHz, see NCO ) +AudioConnection c12(FIR_BPF, 0, Mixer, 0); // IF from BPF to Mixer +AudioConnection c13(NCO, 0, Mixer, 1); // Local Oscillator to Mixer (11 kHz) +// +AudioConnection c20(Mixer, 0, postFIR, 0); // 2700Hz Low Pass filter or 200 Hz wide CW filter at 700Hz on audio output +// +AudioConnection c30(postFIR,0, Smeter, 0); // S-Meter measure +AudioConnection c31(postFIR,0, AGC, 0); // AGC Gain loop adjust +// +AudioConnection c40(AGC, 0, AGCpeak, 0); // AGC Gain loop measure +AudioConnection c41(AGC, 0, audioOutput, 0); // Output the sum on both channels +AudioConnection c42(AGC, 0, audioOutput, 1); +//--------------------------------------------------------------------------------------------------------- + +//long vfofreq=3560000; +long vfofreq=7056000; +//long vfofreq=7850000; // CHU +//long vfofreq=14060000; // frequency of the SI5351 VFO +long cursorfreq; // frequency of the on screen cursor which what we are listening to +int cursor_pos=0; +long encoder_pos=0, last_encoder_pos=999; +elapsedMillis volmsec=0; + +void setup() +{ + pinMode(0, INPUT_PULLUP); // yanks up display BL signal + pinMode(ModeSW, INPUT_PULLUP); // USB = low, LSB = high + pinMode(FiltSW, INPUT_PULLUP); // 500Hz filter = high + pinMode(TuneSW, INPUT_PULLUP); // tuning rate = high + + // Audio connections require memory to work. For more + // detailed information, see the MemoryAndCpuUsage example + AudioMemory(12); + + // Enable the audio shield and set the output volume. + audioShield.enable(); + audioShield.inputSelect(myInput); + audioShield.volume(127); + audioShield.unmuteLineout(); + +#ifdef HW_AGC + /* COMMENTS FROM Teensy Audio library: + Valid values for dap_avc parameters + maxGain; Maximum gain that can be applied + 0 - 0 dB + 1 - 6.0 dB + 2 - 12 dB + lbiResponse; Integrator Response + 0 - 0 mS + 1 - 25 mS + 2 - 50 mS + 3 - 100 mS + hardLimit + 0 - Hard limit disabled. AVC Compressor/Expander enabled. + 1 - Hard limit enabled. The signal is limited to the programmed threshold (signal saturates at the threshold) + threshold + floating point in range 0 to -96 dB + attack + floating point figure is dB/s rate at which gain is increased + decay + floating point figure is dB/s rate at which gain is reduced +*/ + audioShield.autoVolumeControl(2,1,0,-5,3,10); // see comments + audioShield.autoVolumeEnable(1); + +#endif + + // Stop the Audio stuff while manipulating parameters + AudioNoInterrupts(); + + // Local Oscillator at 11 kHz + NCO.begin(1.0,ncofreq,TONE_TYPE_SINE); + + // Initialize the +/-45 degree Hilbert filters + Hilbert45_I.begin(hilbert45,HILBERT_COEFFS); + Hilbert45_Q.begin(hilbertm45,HILBERT_COEFFS); + + // Initialize the USB/LSB filter + FIR_BPF.begin(firbpf_usb,BPF_COEFFS); + + // Initialize the Low Pass filter + postFIR.begin(postfir_lpf,COEFF_LPF); + + // Start the Audio stuff + AudioInterrupts(); + + SPI.setMOSI(7); // set up SPI for use with the audio card - alternate pins + SPI.setSCK(14); + + // initialize the LCD display +// tft.init(); + tft.initR(INITR_BLACKTAB); // initialize a S6D02A1S chip, black tab + tft.setRotation(1); + tft.fillScreen(S6D02A1_BLACK); + tft.setCursor(0, 115); + tft.setTextColor(S6D02A1_WHITE); + tft.setTextWrap(true); + tft.print("Teensy 3.1 SDR"); + + // Show mid screen tune position + tft.drawFastVLine(80, 0,60, S6D02A1_BLUE); + + // Set LCD defaults + tft.setTextColor(S6D02A1_YELLOW); + //tft.setTextSize(2); + // set up clk gen + + si5351.init(SI5351_CRYSTAL_LOAD_8PF); + si5351.set_correction(-40); // I did a by ear correction to CHU + // Set CLK0 to output 14 MHz with a fixed PLL frequency + si5351.set_pll(SI5351_PLL_FIXED, SI5351_PLLA); + si5351.set_freq((unsigned long)vfofreq*4, SI5351_PLL_FIXED, SI5351_CLK0); + delay(3); +} + + +void loop() +{ + static uint8_t mode, filter,modesw_state,filtersw_state; + // Force a first time USB/LSB Mode and filter update + static uint8_t oldmode=0xff, oldfilter=0xff; + long encoder_change; + char string[80]; // print format stuff + static uint8_t waterfall[80]; // array for simple waterfall display + static uint8_t w_index=0,w_avg; + +// tune radio using encoder switch + encoder_pos=tune.read(); + if (encoder_pos != last_encoder_pos) { + encoder_change=encoder_pos-last_encoder_pos; + last_encoder_pos=encoder_pos; + // press encoder button for fast tuning + if (digitalRead(TuneSW)) vfofreq+=encoder_change*5; // tune the master vfo - 5hz steps + else vfofreq+=encoder_change*500; // fast tuning 500hz steps + si5351.set_freq((unsigned long)vfofreq*4, SI5351_PLL_FIXED, SI5351_CLK0); + tft.fillRect(100,115,100,120,S6D02A1_BLACK); + tft.setCursor(100, 115); + tft.setTextColor(S6D02A1_WHITE); + cursorfreq=vfofreq+ncofreq; // frequency we are listening to + sprintf(string,"%d.%03d.%03d",cursorfreq/1000000,(cursorfreq-cursorfreq/1000000*1000000)/1000, + cursorfreq%1000 ); + tft.print(string); + } + + // every 50 ms, adjust the volume and check the switches + if (volmsec > 50) { + float vol = analogRead(15); + vol = vol / 1023.0; + audioShield.volume(vol); + volmsec = 0; + + if (!digitalRead(ModeSW)) { + if (modesw_state==0) { // switch was pressed - falling edge + mode=!mode; + modesw_state=1; // flag switch is pressed + } + } + else modesw_state=0; // flag switch not pressed + + if (!digitalRead(FiltSW)) { + if (filtersw_state==0) { // switch was pressed - falling edge + filter=!filter; + filtersw_state=1; // flag switch is pressed + } + } + else filtersw_state=0; // flag switch not pressed + } + +#ifdef SW_AGC + agc(); // Automatic Gain Control function +#endif + + // + // Select USB/LSB mode and a corresponding 2.4kHz or 500Hz filter + // + if (loo_ms.check() == 1) + { +// mode = !digitalRead(ModeSW); +// filter = !digitalRead(FiltSW); + if ((mode != oldmode)||(filter != oldfilter)) + { + AudioNoInterrupts(); // Disable Audio while reconfiguring filters + tft.drawFastHLine(0,61, 160, S6D02A1_BLACK); // Clear LCD BW indication + tft.drawFastHLine(0,62, 160, S6D02A1_BLACK); // Clear LCD BW indication + + if (mode) // LSB + { + FIR_BPF.begin(firbpf_lsb,BPF_COEFFS); // 2.4kHz LSB filter + + if (filter) + { + postFIR.begin(postfir_700,COEFF_700); // 500 Hz LSB filter + tft.drawFastHLine(72,61,6, S6D02A1_RED); + tft.drawFastHLine(72,62,6, S6D02A1_RED); + tft.fillRect(100, 85, 60, 7,S6D02A1_BLACK);// Print Mode + tft.setCursor(100, 85); + tft.print("LSB narrow"); + } + else + { + postFIR.begin(postfir_lpf,COEFF_LPF); // 2.4kHz LSB filter + tft.drawFastHLine(61,61,20, S6D02A1_RED); + tft.drawFastHLine(61,62,20, S6D02A1_RED); + tft.fillRect(100, 85, 60, 7,S6D02A1_BLACK);// Print Mode + tft.setCursor(100, 85); + tft.print("LSB"); + } + } + else // USB + { + FIR_BPF.begin(firbpf_usb,BPF_COEFFS); // 2.4kHz USB filter + if (filter) + { + postFIR.begin(postfir_700,COEFF_700); // 500 Hz LSB filter + tft.drawFastHLine(83,61,6, S6D02A1_RED); + tft.drawFastHLine(83,62,6, S6D02A1_RED); + tft.fillRect(100, 85, 60, 7,S6D02A1_BLACK);// Print Mode + tft.setCursor(100, 85); + tft.print("USB narrow"); + } + else + { + postFIR.begin(postfir_lpf,COEFF_LPF); // 2.4kHz LSB filter + tft.drawFastHLine(80,61,20, S6D02A1_RED); + tft.drawFastHLine(80,62,20, S6D02A1_RED); + tft.fillRect(100, 85, 60, 7,S6D02A1_BLACK);// Print Mode + tft.setCursor(100, 85); + tft.print("USB"); + } + } + AudioInterrupts(); + oldmode = mode; + oldfilter = filter; + } + } + + // + // Draw Spectrum Display + // + if (lcd_upd.check() == 1) + { + if (myFFT.available()) + { + int scale=1; + //for (int16_t x=0; x < 160; x++) + for (int16_t x=0; x < 160; x+=2) + { + int bar=abs(myFFT.output[x*8/10])/scale; + if (bar >60) bar=60; + + if(x!=80) + { + tft.drawFastVLine(x, 60-bar,bar, S6D02A1_GREEN); + tft.drawFastVLine(x, 0, 60-bar, S6D02A1_BLACK); + } + } + } + +#ifdef CW_WATERFALL + // experimental waterfall display for CW - + // this should probably be on a faster timer since it needs to run as fast as possible to catch CW edges + // FFT bins are 22khz/128=171hz wide + // cw peak should be around 11.6khz - + waterfall[w_index]=0; + for (uint8_t y=66;y<=68;++y) // sum of bin powers near cursor - usb only + waterfall[w_index]+=(uint8_t)(abs(myFFT.output[y])/2); // store bin power readings in circular buffer + w_avg=w_avg-w_avg/20; // running average power + int8_t p=w_index; + for (uint8_t x=158;x>0;x-=2) { + if (waterfall[p] > w_avg/20+4) tft.fillRect(x,70,2,2,S6D02A1_WHITE); + else tft.fillRect(x,70,2,2,S6D02A1_BLACK); + if (--p<0 ) p=79; + } + if (++w_index >=80) w_index=0; +#endif + } + +#ifdef AUDIO_STATS + // + // DEBUG - Microcontroller Load Check + // + // Change this to if(1) to monitor load + + /* + For PlaySynthMusic this produces: + Proc = 20 (21), Mem = 2 (8) + */ + if (five_sec.check() == 1) + { + Serial.print("Proc = "); + Serial.print(AudioProcessorUsage()); + Serial.print(" ("); + Serial.print(AudioProcessorUsageMax()); + Serial.print("), Mem = "); + Serial.print(AudioMemoryUsage()); + Serial.print(" ("); + Serial.print(AudioMemoryUsageMax()); + Serial.println(")"); + } +#endif +} + + diff --git a/agc.cpp b/agc.cpp new file mode 100644 index 0000000..71ff29e --- /dev/null +++ b/agc.cpp @@ -0,0 +1,123 @@ +// soft AGC and S meter display by Loftur E. Jónasson TF3LJ/VE2LJX 6/14 +// + +#include +#include + +#include // LCD Core graphics library +//#include // 1.8" TFT Module using Samsung S6D02A1 chip +#include // Hardware-specific library + +//extern Adafruit_QDTech tft; +extern Adafruit_S6D02A1 tft; + +extern AudioMixer4 AGC; // Summer (add inputs) +extern AudioPeak AGCpeak; // Measure Audio Peak for AGC use +extern AudioPeak Smeter; // Measure Audio Peak for S meter + +Metro l_ms = Metro(1); // Set up a 1ms Metro +Metro lcd_upd2=Metro(100); // Set up a Metro for LCD updates + +int32_t sample[10]; // A ringbuffer of samples (has to be larger than AGCattack) + +double AGCgain=1; // Initial AGC gain. 1 = unity gain, 32768.0 max, 0.00004 min +#define AGCMAX 10 +const int32_t AGCnomVal = 10000; // Nominal Output (32768 max) +const int32_t AGCattack = 2; // AGC Hang time (milliseconds) before reducing gain +const int32_t AGChang = 30; // AGC Hang time before increasing gain +const double AGCslope = 1.05; // Relative gain change + + +// +// Automatic Gain Control function +// +void agc(void) +{ + static uint8_t i; + static uint16_t hangtimer; + uint8_t j,k; + int32_t s_sample; // Raw signal strength (max per 1ms) + int32_t samp; // AGC feedback loop sample strength (max per 1ms) + int32_t temp; // yeah, just a temp value + double uv, dbuv, s;// microvolts, db-microvolts, s-units + char string[80]; // print format stuff + + if (l_ms.check() == 1) + { + // Collect S-meter data + s_sample = Smeter.Dpp(); // Highest sample within 1 millisecond + Smeter.begin(); // Reset for next measurement + + // AGC: Collect current 1ms peak at output and feed to a ringbuffer + sample[i++] = samp = AGCpeak.Dpp(); + AGCpeak.begin(); + if (i >= AGCattack) i=0; + + // Check if we need to reduce gain + for(j=0,k=0;j AGCnomVal) k++; + } + + // We need to reduce gain + if ((k == AGCattack) || ((k>0) && (hangtimer>=AGChang))) // Activate AGCattack + { + // find largest value + temp = 0; + for(j=0;j temp) temp = sample[j]; + } + + // Instant reduction to appropriate value + AGCgain = AGCgain * AGCnomVal/temp; + // Reset hang timer + hangtimer = 0; + } + + // Increment hangtimer while level is lower than nominal + else if(samp < AGCnomVal) hangtimer++; + + if (hangtimer >= AGChang) // We need to ramp up the gain + { + AGCgain = AGCgain * AGCslope; + } + + if (AGCgain > AGCMAX) AGCgain=AGCMAX; // limit the gain + + AGC.gain(0,AGCgain); // Adjust AGC gain + + // + // Print stuff to LCD only once every 100ms + // + if (lcd_upd2.check() == 1) + { + // Calculate S units. 50uV = S9 + uv = s_sample/30.0; // microvolts, roughly calibrated + dbuv = 20.0*log10(uv); + s = 1.0 + (14.0 + dbuv)/6.0; + if (s>9.0) + { + dbuv = dbuv - 34.0; + s = 9.0; + } + else dbuv = 0; + // Print S units + tft.fillRect(10, 85, 30, 7,S6D02A1_BLACK); + tft.setCursor(0, 85); + if (dbuv == 0) sprintf(string,"S:%3.1f",s); + else sprintf(string,"S:9+%02.0f",dbuv); + tft.print(string); + + if(0) // Debug stuff + { + // Print AGC loop parameters + tft.fillRect(10, 105, 100, 7,S6D02A1_BLACK); + tft.setCursor(0, 105); + sprintf(string,"pk:%5lu g:%5.1f",samp, AGCgain); + tft.print(string); + } + } + } +} + diff --git a/filters.cpp b/filters.cpp new file mode 100644 index 0000000..08e4e03 --- /dev/null +++ b/filters.cpp @@ -0,0 +1,28 @@ +#include "filters.h" + +short hilbert45[HILBERT_COEFFS] = { +#include "hilbert_45.h" +}; + +short hilbertm45[HILBERT_COEFFS] = { +#include "hilbert_m45.h" +}; + +short firbpf_usb[BPF_COEFFS] = { +#include "fir_usb.h" +}; + +short firbpf_lsb[BPF_COEFFS] = { +#include "fir_lsb.h" +}; + +short postfir_700[COEFF_700] = { +#include "postfir_700hz.h" +}; + +short postfir_lpf[COEFF_LPF] = { +#include "postfir_lpf.h" +}; + + + diff --git a/filters.h b/filters.h new file mode 100644 index 0000000..0625e2c --- /dev/null +++ b/filters.h @@ -0,0 +1,13 @@ +// Number of coefficients +#define HILBERT_COEFFS 100 +extern short hilbert45[]; +extern short hilbertm45[]; + +#define BPF_COEFFS 100 +extern short firbpf_usb[]; +extern short firbpf_lsb[]; + +#define COEFF_LPF 54 +extern short postfir_700[]; +#define COEFF_700 120 +extern short postfir_lpf[]; diff --git a/fir_lsb.h b/fir_lsb.h new file mode 100644 index 0000000..9783f73 --- /dev/null +++ b/fir_lsb.h @@ -0,0 +1,110 @@ +// LSB filter by Loftur E. Jónasson TF3LJ/VE2LJX 6/14- 2.4 kHz centred at 9.5 kHz +// (sampling rate 44.1 kHz) +// +// Parameters generated using Iowa Hills FIR Filter Designer +// OmegaC 0.433 +// Bandwidth 0.110 +// 100 taps +// Transition width 0.085 +// Window off +// Parks McClellan +32768 * -0.000010523800014581, +32768 * -0.000122681642892022, +32768 * -0.000036415773389628, +32768 * 0.000305793174245558, +32768 * 0.000283565937180380, +32768 * -0.000472031799665594, +32768 * -0.000804098046625973, +32768 * 0.000378709203535162, +32768 * 0.001479276230080921, +32768 * 0.000183083088650831, +32768 * -0.001941975044915265, +32768 * -0.001135526486858456, +32768 * 0.001772511141387945, +32768 * 0.001963039344977544, +32768 * -0.000908490376865581, +32768 * -0.001916521667456298, +32768 * -0.000020006590571434, +32768 * 0.000602618449322109, +32768 * -0.000173651213944996, +32768 * 0.001394251556711564, +32768 * 0.002470013673232240, +32768 * -0.002448216941233300, +32768 * -0.006628534787491658, +32768 * 0.000759869709492400, +32768 * 0.010735891124917961, +32768 * 0.004155599503225747, +32768 * -0.012018010710235907, +32768 * -0.010389082153523428, +32768 * 0.008810696972067640, +32768 * 0.014105829623790958, +32768 * -0.002524099694416429, +32768 * -0.011858498891210132, +32768 * -0.002042840172782165, +32768 * 0.003626318880290195, +32768 * -0.001030976719610831, +32768 * 0.005542290777138538, +32768 * 0.014722151249366884, +32768 * -0.007046559790046048, +32768 * -0.035610017720202412, +32768 * -0.006654434845418102, +32768 * 0.053711019474210531, +32768 * 0.036665440452510710, +32768 * -0.056625604477486352, +32768 * -0.074954104576882299, +32768 * 0.036276347208572125, +32768 * 0.106669361716220323, +32768 * 0.005549784942170579, +32768 * -0.116927488293852577, +32768 * -0.056465510909489432, +32768 * 0.098576362058282713, +32768 * 0.098576362058282713, +32768 * -0.056465510909489432, +32768 * -0.116927488293852577, +32768 * 0.005549784942170579, +32768 * 0.106669361716220323, +32768 * 0.036276347208572125, +32768 * -0.074954104576882299, +32768 * -0.056625604477486352, +32768 * 0.036665440452510710, +32768 * 0.053711019474210531, +32768 * -0.006654434845418102, +32768 * -0.035610017720202412, +32768 * -0.007046559790046048, +32768 * 0.014722151249366884, +32768 * 0.005542290777138538, +32768 * -0.001030976719610831, +32768 * 0.003626318880290195, +32768 * -0.002042840172782165, +32768 * -0.011858498891210132, +32768 * -0.002524099694416429, +32768 * 0.014105829623790958, +32768 * 0.008810696972067640, +32768 * -0.010389082153523428, +32768 * -0.012018010710235907, +32768 * 0.004155599503225747, +32768 * 0.010735891124917961, +32768 * 0.000759869709492400, +32768 * -0.006628534787491658, +32768 * -0.002448216941233300, +32768 * 0.002470013673232240, +32768 * 0.001394251556711564, +32768 * -0.000173651213944996, +32768 * 0.000602618449322109, +32768 * -0.000020006590571434, +32768 * -0.001916521667456298, +32768 * -0.000908490376865581, +32768 * 0.001963039344977544, +32768 * 0.001772511141387945, +32768 * -0.001135526486858456, +32768 * -0.001941975044915265, +32768 * 0.000183083088650831, +32768 * 0.001479276230080921, +32768 * 0.000378709203535162, +32768 * -0.000804098046625973, +32768 * -0.000472031799665594, +32768 * 0.000283565937180380, +32768 * 0.000305793174245558, +32768 * -0.000036415773389628, +32768 * -0.000122681642892022, +32768 * -0.000010523800014581 diff --git a/fir_usb.h b/fir_usb.h new file mode 100644 index 0000000..e28750c --- /dev/null +++ b/fir_usb.h @@ -0,0 +1,111 @@ +// USB filter by Loftur E. Jónasson TF3LJ/VE2LJX 6/14 2.4 kHz centred at 12.5 kHz +// (sampling rate 44.1 kHz) +// +// Parameters generated using Iowa Hills FIR Filter Designer +// OmegaC 0.567 +// Bandwidth 0.109 +// 100 taps +// Transition width 0.085 +// Window off +// Parks McClellan +32768 * 0.000077220197574123, +32768 * -1.694364742523110E-6, +32768 * -0.000247376363569229, +32768 * 0.000172349071145931, +32768 * 0.000442532978562303, +32768 * -0.000587921806885401, +32768 * -0.000490796464995067, +32768 * 0.001245366873040035, +32768 * 0.000130200340800485, +32768 * -0.001862166817785674, +32768 * 0.000703051894342210, +32768 * 0.002007465586182165, +32768 * -0.001685724919682768, +32768 * -0.001407920138837247, +32768 * 0.002116180748678689, +32768 * 0.000372547212250720, +32768 * -0.001360627435518710, +32768 * 0.000104411160061938, +32768 * -0.000488583862643263, +32768 * 0.001171803660774852, +32768 * 0.002230271567546280, +32768 * -0.004622738899125535, +32768 * -0.001988597303309669, +32768 * 0.009091087568736349, +32768 * -0.001507388998028951, +32768 * -0.012022955491491360, +32768 * 0.007518507241432481, +32768 * 0.010969367705405847, +32768 * -0.012943254772900497, +32768 * -0.005724754564656228, +32768 * 0.013800759554407906, +32768 * -0.000413209911619933, +32768 * -0.008117888769062576, +32768 * 0.001659860856017020, +32768 * -0.001521029232922352, +32768 * 0.006868472137034775, +32768 * 0.007858709633466776, +32768 * -0.025100680515366711, +32768 * -0.002212548908150258, +32768 * 0.046023064611360000, +32768 * -0.020182170398250168, +32768 * -0.057755470091797719, +32768 * 0.055819871330333046, +32768 * 0.049337804826868066, +32768 * -0.092667374657917745, +32768 * -0.017292461343810531, +32768 * 0.114978094867627500, +32768 * -0.030993743432389236, +32768 * -0.111032169995744168, +32768 * 0.079554595102602668, +32768 * 0.079554595102602668, +32768 * -0.111032169995744168, +32768 * -0.030993743432389236, +32768 * 0.114978094867627500, +32768 * -0.017292461343810531, +32768 * -0.092667374657917745, +32768 * 0.049337804826868066, +32768 * 0.055819871330333046, +32768 * -0.057755470091797719, +32768 * -0.020182170398250168, +32768 * 0.046023064611360000, +32768 * -0.002212548908150258, +32768 * -0.025100680515366711, +32768 * 0.007858709633466776, +32768 * 0.006868472137034775, +32768 * -0.001521029232922352, +32768 * 0.001659860856017020, +32768 * -0.008117888769062576, +32768 * -0.000413209911619933, +32768 * 0.013800759554407906, +32768 * -0.005724754564656228, +32768 * -0.012943254772900497, +32768 * 0.010969367705405847, +32768 * 0.007518507241432481, +32768 * -0.012022955491491360, +32768 * -0.001507388998028951, +32768 * 0.009091087568736349, +32768 * -0.001988597303309669, +32768 * -0.004622738899125535, +32768 * 0.002230271567546280, +32768 * 0.001171803660774852, +32768 * -0.000488583862643263, +32768 * 0.000104411160061938, +32768 * -0.001360627435518710, +32768 * 0.000372547212250720, +32768 * 0.002116180748678689, +32768 * -0.001407920138837247, +32768 * -0.001685724919682768, +32768 * 0.002007465586182165, +32768 * 0.000703051894342210, +32768 * -0.001862166817785674, +32768 * 0.000130200340800485, +32768 * 0.001245366873040035, +32768 * -0.000490796464995067, +32768 * -0.000587921806885401, +32768 * 0.000442532978562303, +32768 * 0.000172349071145931, +32768 * -0.000247376363569229, +32768 * -1.694364742523110E-6, +32768 * 0.000077220197574123 + diff --git a/hilbert_45.h b/hilbert_45.h new file mode 100644 index 0000000..708816e --- /dev/null +++ b/hilbert_45.h @@ -0,0 +1,106 @@ +// hilbert filter pair generated by Iowa Hills Software Hilbert tool +// 45 degree shift +// Bandwidth 0.95 +// OmegaC 0.500 +// Num Taps 100 + +32768 * 428.8698225779810E-18, +32768 * 0.000866962256721964, +32768 * 669.4578973884190E-18, +32768 * 0.000723768779644489, +32768 * 625.1950335026000E-18, +32768 * 0.000491948708636800, +32768 * 932.9793308652210E-18, +32768 * 0.000162753915054888, +32768 * 120.6877891916540E-18, +32768 *-0.000267138492850143, +32768 * 368.6242120344090E-18, +32768 *-0.000794106419837781, +32768 *-335.0841016622350E-18, +32768 *-0.001406158205346857, +32768 * 508.6725057380440E-18, +32768 *-0.002081653046072215, +32768 * 525.4639122859110E-18, +32768 *-0.002788189076768316, +32768 * 1.997158538844780E-15, +32768 *-0.003481638971364546, +32768 * 1.521786931189910E-15, +32768 *-0.004105248229979659, +32768 * 1.999269938576540E-15, +32768 *-0.004588612972905914, +32768 * 1.642012534044480E-15, +32768 *-0.004846199063150177, +32768 * 2.321256832370990E-15, +32768 *-0.004774806025839937, +32768 * 1.472463356633780E-15, +32768 *-0.004248919032053459, +32768 * 3.256022898511980E-15, +32768 *-0.003112012423934955, +32768 * 2.885150851939090E-15, +32768 *-0.001160058329106086, +32768 * 4.963134919021790E-15, +32768 * 0.001890534040148042, +32768 * 7.256657980479030E-15, +32768 * 0.006468126105579311, +32768 * 9.877273082232760E-15, +32768 * 0.013288374303952424, +32768 * 9.998257606955500E-15, +32768 * 0.023701141617936898, +32768 * 13.04841388605350E-15, +32768 * 0.040681358385972734, +32768 * 13.16584420291990E-15, +32768 * 0.072465913204806887, +32768 * 18.32157501742890E-15, +32768 * 0.153651468095950122, +32768 * 45.04853770616490E-15, +32768 * 0.872643185009882805, +32768 *-124.9775599534200E-15, +32768 *-0.320482045163527962, +32768 *-21.83135851203050E-15, +32768 *-0.147353662629853055, +32768 *-13.25350771085950E-15, +32768 *-0.098220446790738603, +32768 *-9.869993202619540E-15, +32768 *-0.073799181987711918, +32768 *-4.594216166446000E-15, +32768 *-0.058469211844324492, +32768 *-3.304347777777260E-15, +32768 *-0.047522100992294508, +32768 * 104.5764716612020E-18, +32768 *-0.039075967510059088, +32768 * 1.357742476364510E-15, +32768 *-0.032247860767888339, +32768 * 1.609834995034210E-15, +32768 *-0.026578009579594275, +32768 * 302.9110018978720E-18, +32768 *-0.021807474489618426, +32768 * 1.269751717122650E-15, +32768 *-0.017779413498920069, +32768 *-245.5156751402480E-18, +32768 *-0.014390646510711955, +32768 * 431.8593097590070E-18, +32768 *-0.011566204186358037, +32768 *-20.73528334337070E-18, +32768 *-0.009245418095997261, +32768 * 493.9755466124440E-18, +32768 *-0.007374279468676965, +32768 * 251.3569241845640E-18, +32768 *-0.005901425606391064, +32768 * 1.464223979968000E-15, +32768 *-0.004776322329186264, +32768 * 697.1003972531060E-18, +32768 *-0.003948802940774603, +32768 * 814.1476939065410E-18, +32768 *-0.003369432187206015, +32768 *-316.1136311572910E-18, +32768 *-0.002990334964793745, +32768 *-90.52589606482270E-18, +32768 *-0.002766233025766330, +32768 *-696.4043762789310E-18, +32768 *-0.002655502116741105, +32768 *-32.56402058849020E-18, +32768 *-0.002621113453607914, +32768 *-86.94556986426840E-18, +32768 *-0.002631365320034318, +32768 * 85.18103595547740E-18, +32768 *-0.002660346625915069 diff --git a/hilbert_m45.h b/hilbert_m45.h new file mode 100644 index 0000000..388d9a1 --- /dev/null +++ b/hilbert_m45.h @@ -0,0 +1,106 @@ +// hilbert filter pair generated by Iowa Hills Software Hilbert tool +// -45 degree shift +// Bandwidth 0.95 +// OmegaC 0.500 +// Num Taps 100 + +32768 * -0.002660346625914681, +32768 * -142.5615451960800E-18, +32768 * -0.002631365320034742, +32768 * 72.39460181599930E-18, +32768 * -0.002621113453608740, +32768 * 365.6625573314080E-18, +32768 * -0.002655502116741606, +32768 * -268.1406471145040E-18, +32768 * -0.002766233025766440, +32768 * 522.9276890266240E-18, +32768 * -0.002990334964794087, +32768 * -607.0059499422990E-18, +32768 * -0.003369432187205082, +32768 * -73.23460201465080E-18, +32768 * -0.003948802940773903, +32768 * -476.4056590717670E-18, +32768 * -0.004776322329185343, +32768 * -312.9479342217880E-18, +32768 * -0.005901425606389074, +32768 * -599.2210655172320E-18, +32768 * -0.007374279468676095, +32768 * -257.5055438396270E-18, +32768 * -0.009245418095996334, +32768 * -1.432636145077280E-15, +32768 * -0.011566204186357842, +32768 * 185.5776728505920E-18, +32768 * -0.014390646510711451, +32768 * -1.223169894210750E-15, +32768 * -0.017779413498919743, +32768 * -507.7725019792790E-18, +32768 * -0.021807474489616407, +32768 * -149.4865846637370E-18, +32768 * -0.026578009579593605, +32768 * -561.9513689420920E-18, +32768 * -0.032247860767886542, +32768 * -684.5163433330340E-18, +32768 * -0.039075967510061899, +32768 * 2.312619114749650E-15, +32768 * -0.047522100992295140, +32768 * 550.8313753159310E-18, +32768 * -0.058469211844333152, +32768 * 3.653449213341470E-15, +32768 * -0.073799181987724130, +32768 * 5.543566341328550E-15, +32768 * -0.098220446790761515, +32768 * 7.591005706981040E-15, +32768 * -0.147353662629886223, +32768 * 21.75090500727820E-15, +32768 * -0.320482045163644980, +32768 * 129.4663938604830E-15, +32768 * 0.872643185009816635, +32768 * -48.86088790795220E-15, +32768 * 0.153651468095996002, +32768 * -23.34181949236510E-15, +32768 * 0.072465913204831797, +32768 * -12.73860359379920E-15, +32768 * 0.040681358385996375, +32768 * -9.967403549770980E-15, +32768 * 0.023701141617955505, +32768 * -8.913611311437650E-15, +32768 * 0.013288374303971109, +32768 * -5.120441418271150E-15, +32768 * 0.006468126105590283, +32768 * -6.713751021471820E-15, +32768 * 0.001890534040160306, +32768 * -4.214988052861760E-15, +32768 * -0.001160058329098612, +32768 * -3.133467475213760E-15, +32768 * -0.003112012423928077, +32768 * -3.051927453298240E-15, +32768 * -0.004248919032049460, +32768 * -2.728321242007810E-15, +32768 * -0.004774806025835775, +32768 * -1.212682271632930E-15, +32768 * -0.004846199063146594, +32768 * -2.473499615604520E-15, +32768 * -0.004588612972902101, +32768 * -705.6223879923200E-18, +32768 * -0.004105248229976594, +32768 * -1.187392338537970E-15, +32768 * -0.003481638971361474, +32768 * -741.7226001046070E-18, +32768 * -0.002788189076767050, +32768 * -803.9975667293950E-18, +32768 * -0.002081653046071019, +32768 * -405.8558361122810E-18, +32768 * -0.001406158205345744, +32768 * -732.4771536664670E-18, +32768 * -0.000794106419837717, +32768 * 203.7380889287510E-18, +32768 * -0.000267138492849360, +32768 * -791.8767863321210E-18, +32768 * 0.000162753915055431, +32768 * -99.16131906296190E-18, +32768 * 0.000491948708637530, +32768 * -608.0720937020530E-18, +32768 * 0.000723768779645844, +32768 * -586.4325834209240E-18, +32768 * 0.000866962256723557, +32768 * -333.7536727527920E-18 diff --git a/licence.txt b/licence.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/licence.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/postfir_700hz.h b/postfir_700hz.h new file mode 100644 index 0000000..181ee5f --- /dev/null +++ b/postfir_700hz.h @@ -0,0 +1,129 @@ +// Parameters generated using http://t-filter.appspot.com/fir/index.html +// CW filter centred at 700 Hz +// sampling rate 44.1 kHz +// Stopband 0 - 220 Hz, desired ripple > 40 dB +// Passband 600 - 800 Hz, desired ripple < 5 dB +// Stopband 1200 - 22000 Hz, desired ripple > 40 dB +// taps 120 +// Actual stopband ripple > 35 dB +670, +185, +206, +225, +242, +256, +265, +270, +270, +265, +253, +235, +211, +179, +141, +96, +45, +-12, +-75, +-142, +-212, +-286, +-361, +-436, +-510, +-582, +-651, +-714, +-771, +-820, +-859, +-890, +-908, +-915, +-909, +-890, +-858, +-812, +-753, +-681, +-598, +-503, +-398, +-284, +-163, +-36, +94, +226, +359, +489, +615, +735, +847, +949, +1040, +1118, +1183, +1232, +1265, +1282, +1282, +1265, +1232, +1183, +1118, +1040, +949, +847, +735, +615, +489, +359, +226, +94, +-36, +-163, +-284, +-398, +-503, +-598, +-681, +-753, +-812, +-858, +-890, +-909, +-915, +-908, +-890, +-859, +-820, +-771, +-714, +-651, +-582, +-510, +-436, +-361, +-286, +-212, +-142, +-75, +-12, +45, +96, +141, +179, +211, +235, +253, +265, +270, +270, +265, +256, +242, +225, +206, +185, +670 + diff --git a/postfir_lpf.h b/postfir_lpf.h new file mode 100644 index 0000000..343942e --- /dev/null +++ b/postfir_lpf.h @@ -0,0 +1,62 @@ +// postfilter by Loftur E. Jónasson TF3LJ/VE2LJX 6/14 +// Parameters generated using http://t-filter.appspot.com/fir/index.html +// LPF +// sampling rate 44.1 kHz +// Passband 0 - 2700 Hz, desired ripple < 1 dB +// Stopband 4000 - 22000 Hz, desired ripple > 40 dB +// taps 54 +-236, +-589, +-390, +-574, +-457, +-334, +-69, +236, +554, +797, +901, +806, +494, +-12, +-634, +-1254, +-1723, +-1893, +-1637, +-885, +362, +2019, +3926, +5868, +7606, +8913, +9615, +9615, +8913, +7606, +5868, +3926, +2019, +362, +-885, +-1637, +-1893, +-1723, +-1254, +-634, +-12, +494, +806, +901, +797, +554, +236, +-69, +-334, +-457, +-574, +-390, +-589, +-236 +