亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fft.c

?? 7653觸摸屏的驅動程序(C語言)
?? C
字號:
/*
 *	fft.c
 *
 *	Unix Version 2.4 by Steve Sampson, Public Domain, September 1988
 *
 *	This program produces a Frequency Domain display from the Time Domain
 *	data input; using the Fast Fourier Transform.
 *
 *	The Real data is generated by the in-phase (I) channel, and the
 *	Imaginary data is produced by the quadrature-phase (Q) channel of
 *	a Doppler Radar receiver.  The middle filter is zero Hz.  Closing
 *	targets are displayed to the right, and Opening targets to the left.
 *
 *	Note: With Imaginary data set to zero the output is a mirror image.
 *
 *	Usage:	fft samples input output
 *		1. samples is a variable power of two.
 *		2. Input is (samples * sizeof(double)) characters.
 *		3. Output is (samples * sizeof(double)) characters.
 *		4. Standard error is help or debugging messages.
 *
 *	See also: readme.doc, pulse.c, and sine.c.
 */

/* Includes */

#include <stdio.h>
#ifdef AZTEC_C
#include <strings.h>
#else
#include <malloc.h>
#endif
#include <math.h>

/* Defines */

#define	TWO_PI	(2.0 * 3.14159265358979324)	/* alias 360 deg */
#define	Chunk	(Samples * sizeof(double))

#define	sine(x)		Sine[(x)]
#define	cosine(x)	Sine[((x) + (Samples >> 2)) % Samples]

/* Globals, Forward declarations */

static int	Samples, Power;
static double	*Real, *Imag, Maxn, magnitude();
static void	scale(), fft(), max_amp(), display(), err_report();

static int	permute();
static double	*Sine;
static void	build_trig();

static FILE	*Fpi, *Fpo;


/* The program */

main(argc, argv)
int	argc;
char	**argv;
{
	if (argc != 4)
		err_report(0);

	Samples = abs(atoi(*++argv));
	Power = log10((double)Samples) / log10(2.0);

	/* Allocate memory for the variable arrays */

	if ((Real = (double *)malloc(Chunk)) == NULL)
		err_report(1);

	if ((Imag = (double *)malloc(Chunk)) == NULL)
		err_report(2);

	if ((Sine = (double *)malloc(Chunk)) == NULL)
		err_report(3);

	/* open the data files */

	if ((Fpi = fopen(*++argv, "r")) == NULL)
		err_report(4);

	if ((Fpo = fopen(*++argv, "w")) == NULL)
		err_report(5);

	/* read in the data from the input file */

	fread(Real, sizeof(double), Samples, Fpi);
	fread(Imag, sizeof(double), Samples, Fpi);
	fclose(Fpi);

	build_trig();
	scale();
	fft();
	display();

	/* write the frequency domain data to the standard output */

	fwrite(Real, sizeof(double), Samples, Fpo);
	fwrite(Imag, sizeof(double), Samples, Fpo);
	fclose(Fpo);

	/* free up memory and let's get back to our favorite shell */

	free((char *)Real);
	free((char *)Imag);
	free((char *)Sine);

	exit(0);
}


static void err_report(n)
int	n;
{
	switch (n)  {
	case 0:
		fprintf(stderr, "Usage: fft samples in_file out_file\n");
		fprintf(stderr, "Where samples is a power of two\n");
		break;
	case 1:
		fprintf(stderr, "fft: Out of memory getting real space\n");
		break;
	case 2:
		fprintf(stderr, "fft: Out of memory getting imag space\n");
		free((char *)Real);
		break;
	case 3:
		fprintf(stderr, "fft: Out of memory getting sine space\n");
		free((char *)Real);
		free((char *)Imag);
		break;
	case 4:
		fprintf(stderr,"fft: Unable to open data input file\n");
		free((char *)Real);
		free((char *)Imag);
		free((char *)Sine);
		break;
	case 5:
		fprintf(stderr,"fft: Unable to open data output file\n");
		fclose(Fpi);
		free((char *)Real);
		free((char *)Imag);
		free((char *)Sine);
		break;
	}

	exit(1);
}


static void scale()
{
	register int	loop;

	for (loop = 0; loop < Samples; loop++)  {
		Real[loop] /= Samples;
		Imag[loop] /= Samples;
	}
}


static void fft()
{
	register int	loop, loop1, loop2;
	unsigned	i1;			/* going to right shift this */
	int		i2, i3, i4, y;
	double		a1, a2, b1, b2, z1, z2;

	i1 = Samples >> 1;
	i2 = 1;

	/* perform the butterfly's */

	for (loop = 0; loop < Power; loop++)  {
		i3 = 0;
		i4 = i1;

		for (loop1 = 0; loop1 < i2; loop1++)  {
			y = permute(i3 / (int)i1);
			z1 =  cosine(y);
			z2 = -sine(y);

			for (loop2 = i3; loop2 < i4; loop2++)  {

				a1 = Real[loop2];
				a2 = Imag[loop2];

				b1  = z1*Real[loop2+i1] - z2*Imag[loop2+i1];
				b2  = z2*Real[loop2+i1] + z1*Imag[loop2+i1];

				Real[loop2] = a1 + b1;
				Imag[loop2] = a2 + b2;

				Real[loop2+i1] = a1 - b1;
				Imag[loop2+i1] = a2 - b2;
			}

			i3 += (i1 << 1);
			i4 += (i1 << 1);
		}

		i1 >>= 1;
		i2 <<= 1;
	}
}

/*
 *	Display the frequency domain.
 *
 *	The filters are aranged so that DC is in the middle filter.
 *	Thus -Doppler is on the left, +Doppler on the right.
 */

static void display()
{
	register int	loop, offset;
	int		n, x;

	max_amp();
	n = Samples >> 1;

	for (loop = n; loop < Samples; loop++)  {
		x = (int)(magnitude(loop) * 59.0 / Maxn);
		printf("%d\t|", loop - n);
		offset = 0;
		while (++offset <= x)
			putchar('=');

		putchar('\n');
	}

	for (loop = 0; loop < n; loop++)  {
		x = (int)(magnitude(loop) * 59.0 / Maxn);
		printf("%d\t|", loop + n);
		offset = 0;
		while (++offset <= x)
			putchar('=');

		putchar('\n');
	}
}

/*
 *	Find maximum amplitude
 */

static void max_amp()
{
	register int	loop;
	double		mag;

	Maxn = 0.0;
	for (loop = 0; loop < Samples; loop++)  {
		if ((mag = magnitude(loop)) > Maxn)
			Maxn = mag;
	}
}

/*
 *	Calculate Power Magnitude
 */

static double magnitude(n)
int	n;
{
	n = permute(n);
	return hypot(Real[n], Imag[n]);
}

/*
 *	Bit reverse the number
 *
 *	Change 11100000b to 00000111b or vice-versa
 */

static int permute(index)
int	index;
{
	register int	loop;
	unsigned	n1;
	int		result;

	n1 = Samples;
	result = 0;

	for (loop = 0; loop < Power; loop++)  {
		n1 >>= 1;
		if (index < n1)
			continue;

		/* Unix has a truncation problem with pow() */

		result += (int)(pow(2.0, (double)loop) + .05);
		index -= n1;
	}

	return result;
}

/*
 *	Pre-compute the sine and cosine tables
 */

static void build_trig()
{
	register int	loop;
	double		angle, increment;

	angle = 0.0;
	increment = TWO_PI / (double)Samples;

	for (loop = 0; loop < Samples; loop++)  {
		Sine[loop] = sin(angle);
		angle += increment;
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91蝌蚪porny成人天涯| 五月天激情综合网| 久久久久国产精品麻豆ai换脸| 欧美精品免费视频| 欧美一区二区三区爱爱| 欧美老女人在线| 日韩欧美在线123| 日韩三级视频在线看| 欧美mv日韩mv| 久久久久久久久伊人| 国产欧美精品一区| 亚洲视频综合在线| 亚洲成a人在线观看| 秋霞午夜av一区二区三区| 国产自产高清不卡| 成人黄色av网站在线| 欧美中文字幕一区二区三区亚洲| 欧美精品在欧美一区二区少妇| 欧美成人a视频| 国产精品久久久久久久蜜臀| 亚洲免费视频成人| 日本中文字幕一区| 成人中文字幕在线| 欧美日韩亚洲高清一区二区| 欧美一级久久久| 中文字幕欧美国产| 亚洲午夜精品网| 激情国产一区二区 | 国产精品乱人伦中文| 亚洲伦理在线精品| 精品一区二区三区免费观看| 99视频精品在线| 欧美一区二区三区色| 国产精品理伦片| 日韩av网站免费在线| 波多野结衣亚洲一区| 欧美另类videos死尸| 中文成人综合网| 日本人妖一区二区| 欧美伊人精品成人久久综合97| 精品国产伦一区二区三区观看体验| 中文字幕一区二区三区在线播放 | 91福利小视频| 久久综合久久综合九色| 亚洲精品ww久久久久久p站 | 亚洲精品在线网站| 亚洲国产wwwccc36天堂| 丁香桃色午夜亚洲一区二区三区| 欧美日韩在线一区二区| 国产精品黄色在线观看| 久久超碰97中文字幕| 欧美探花视频资源| 最新日韩在线视频| 国产很黄免费观看久久| 91麻豆精品久久久久蜜臀| 亚洲女人小视频在线观看| 国产呦精品一区二区三区网站| 欧美日韩国产一区二区三区地区| 国产精品女同互慰在线看| 激情欧美一区二区三区在线观看| 欧美日韩精品欧美日韩精品| 亚洲欧洲www| 成人a免费在线看| 国产欧美一区视频| 国产成人精品亚洲777人妖| 欧美成人bangbros| 久久er99精品| 精品国产乱码久久久久久浪潮| 午夜a成v人精品| 欧美日韩一区三区四区| 亚洲一区自拍偷拍| 欧美日韩在线观看一区二区| 一区二区三区四区乱视频| 99久久精品国产观看| 国产精品久久久久影院亚瑟| 成人一区在线看| 一区在线中文字幕| 色婷婷香蕉在线一区二区| 一区二区三区精密机械公司| 日本大香伊一区二区三区| 亚洲免费在线电影| 欧美精品一卡两卡| 精品亚洲欧美一区| 精品成人佐山爱一区二区| 国产精品1区2区| 国产精品蜜臀在线观看| 色综合久久综合网| 日韩二区三区四区| 久久亚洲一级片| 成人免费看片app下载| 国产精品护士白丝一区av| 在线欧美日韩国产| 捆绑紧缚一区二区三区视频 | 成人a免费在线看| 亚洲另类春色校园小说| 欧美剧在线免费观看网站| 精品在线视频一区| 中文字幕一区二区5566日韩| 色婷婷久久久久swag精品| 男女性色大片免费观看一区二区 | 成人av在线网站| 亚洲一区二区欧美激情| 日韩三级电影网址| av一区二区三区| 婷婷综合另类小说色区| 国产日韩一级二级三级| 在线精品视频一区二区三四| 免费人成网站在线观看欧美高清| 欧美国产丝袜视频| 欧美日韩国产美女| 成人听书哪个软件好| 午夜精品一区二区三区电影天堂| 国产清纯美女被跳蛋高潮一区二区久久w| 一本色道久久综合亚洲91| 毛片av一区二区| 一区二区三区精品视频| 欧美经典一区二区三区| 欧美色中文字幕| 丰满岳乱妇一区二区三区| 午夜精品久久久久久久99樱桃| 欧美高清在线精品一区| 日韩视频永久免费| 在线精品亚洲一区二区不卡| 粉嫩av一区二区三区粉嫩| 日韩国产欧美在线观看| 最新国产精品久久精品| 久久综合九色综合久久久精品综合 | 日韩欧美在线影院| 欧美日韩一级大片网址| av毛片久久久久**hd| 国产精品综合视频| 美国十次综合导航| 日韩影院精彩在线| 亚洲sss视频在线视频| 夜夜嗨av一区二区三区| 日韩一区日韩二区| 国产精品电影一区二区| 国产亚洲一区二区三区四区| 日韩视频免费直播| 欧美一级精品在线| 91 com成人网| 欧美酷刑日本凌虐凌虐| 欧美人狂配大交3d怪物一区| 91视频免费播放| 99re这里只有精品视频首页| 国产成人精品免费一区二区| 国产在线一区观看| 精彩视频一区二区| 精品伊人久久久久7777人| 美女视频黄频大全不卡视频在线播放| 亚洲国产精品精华液网站| 亚洲一二三四区| 亚洲超碰97人人做人人爱| 香蕉影视欧美成人| 日韩成人一级大片| 麻豆91免费看| 狠狠色狠狠色综合系列| 国产精品一区二区不卡| 成人美女视频在线观看| 不卡视频在线观看| 91麻豆精东视频| 欧美日韩美少妇| 欧美一级黄色录像| 久久精品人人做人人综合| 中文子幕无线码一区tr| 亚洲人妖av一区二区| 亚洲午夜在线电影| 奇米色一区二区| 成人一区二区三区视频在线观看 | 欧美日韩激情在线| 日韩欧美电影一二三| 国产午夜亚洲精品羞羞网站| 国产精品家庭影院| 亚洲成精国产精品女| 国产中文字幕精品| 成人高清在线视频| 欧美视频在线播放| 久久综合色鬼综合色| 欧美国产激情二区三区| 亚洲最大成人网4388xx| 另类小说一区二区三区| 成人av电影在线| 欧美二区乱c少妇| 国产精品无遮挡| 日韩中文欧美在线| 成人激情小说乱人伦| 在线电影欧美成精品| 国产精品色婷婷久久58| 午夜精品视频一区| 成人午夜激情视频| 日韩欧美电影一区| 一区二区三区四区不卡在线 | 亚洲美女少妇撒尿| 精品一区二区三区不卡| 一本久久精品一区二区| 国产婷婷色一区二区三区四区 | 成人手机电影网| 91精品国产综合久久精品图片| 国产精品免费网站在线观看| 奇米影视一区二区三区小说|