/*******************************************************************************
 *	TapeSigGen.cc	TapeDigitiser signal generator utility
 *			T.Barnaby,	BEAM Ltd,	2006-09-12
 *******************************************************************************
 */

#include <stdio.h>
#include <syslog.h>
#include <unistd.h>

#include <SigGen.h>

int main(int argc, char** argv){
	int		fref = 437000;
	int		sampleRate = fref * 512;
	int		numSamples = 2048;
	SigGenBeam	sig0;
	Sample		data[numSamples];
	FILE*		f;
	int		i;
	
//	sig0.config(sampleRate, fref, 16, 0x3C, 0.1, 0, 1.0);
//	sig0.config(sampleRate, fref, 16, 0x8001, 1.0, 0, 1.0);
//	sig0.config(sampleRate, fref, 16, 0xFFFF, 0.5, 0, 1.0);
	sig0.config(sampleRate, fref, 8, 0xFFFF, 0.0, 1, 1.0);
	sig0.generate(data, numSamples);

#ifndef ZAP	
	f = fopen("d.txt", "w");
	for(i = 0; i < numSamples; i++){
		fprintf(f, "%f\n", data[i]);
	}
	fclose(f);
#endif
	
	return 0;
}
