Skip to content

Instantly share code, notes, and snippets.

View kg4sgp's full-sized avatar

Jimmy Carter kg4sgp

  • Ohio among other places
View GitHub Profile
@kg4sgp
kg4sgp / rcbpsk.c
Created June 6, 2014 21:59
A psk31 modulator in the works
/* This produces raised cosine bpsk*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef struct {
long sample_rate;
long samples_per_symbol;
long max_amp;
@kg4sgp
kg4sgp / ask-demod.c
Created November 8, 2013 17:40
An amplitude shift keying (ASK) demodulator.
// An ASK Demodulator
// Simplicity first. Get it working, then improve!
// gcc ask-demod.c -o askdemod -lm -Wall
// Usage: ./ask-demod ask-msg.raw ask-msg.txt
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
// Arduino RTTY Modulator
// Uses Fast PWM to produce ~8kHz 8bit audio
#include "baudot.h"
#include "pwmsine.h"
// Yeah, I really need to get rid of these globals.
// Thats next on the to-do list
unsigned int sampleRate = 31250;
@kg4sgp
kg4sgp / gortzelfsk.c
Created July 3, 2013 05:55
a goertzel demodulator
// Goertzel Demodulator
//
// This program demodulates two tone FSK using the goertzel algorithm.
#include <stdio.h>
#include <math.h>
struct gConstants {
float f1norm;
float f2norm;
// Program to make a table of sine values.
// I release this to public domain.
#include<stdio.h>
#include<math.h>
int main(){
float pi = 3.14159265358979323846264338327;
int max = pow(2,7); // this should be HALF the value for 16bits so (2^16)/2
import java.io._
object Baudot {
val ShiftToFigures = 0x1b
val ShiftToLetters = 0x1f
val figures = Map(
0.toChar -> 0x0,
' ' -> 0x4,
'1' -> 0x1d,
// Jimmy Carter - KG4SGP
// ax.25 UI framer
// compile with gcc aframe.c -o aframe
#include <stdio.h>
#include <string.h>
#define poly (0x1201)
unsigned char flag = 0x7e; //ax.25 start/stop flag
@kg4sgp
kg4sgp / aframe.c
Created April 24, 2013 06:56
ax.25 framer, ugly code and unworking crc
// Jimmy Carter - KG4SGP
// ax.25 UI framer
// compile with gcc aframe.c -o aframe
#include <stdio.h>
#include <string.h>
#define poly (0x1201)
unsigned char flag = 0x7e; //ax.25 start/stop flag
@kg4sgp
kg4sgp / aframe.c
Created April 24, 2013 06:55
ax.25 framer, ugly code and unworking crc
// Jimmy Carter - KG4SGP
// ax.25 UI framer
// compile with gcc aframe.c -o aframe
#include <stdio.h>
#include <string.h>
#define poly (0x1201)
unsigned char flag = 0x7e; //ax.25 start/stop flag
@kg4sgp
kg4sgp / aframe.c
Created April 24, 2013 06:54
ax.25 UI framer, non working crc. Ugly code...
// Jimmy Carter - KG4SGP
// ax.25 UI framer
// compile with gcc aframe.c -o aframe
#include <stdio.h>
#include <string.h>
#define poly (0x1201)
unsigned char flag = 0x7e; //ax.25 start/stop flag