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

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

?? remez.c

?? 著名的TCPMP
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * remez.c - Parks-McClellan algorithm for FIR filter design (C version) * * Copyright (C) 1995,1998 Jake Janovetz * Copyright (C) 1998-2005 Atari800 development team (see DOC/CREDITS) * * This file is part of the Atari800 emulator project which emulates * the Atari 400, 800, 800XL, 130XE, and 5200 8-bit computers. * * Atari800 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 2 of the License, or * (at your option) any later version. * * Atari800 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 Atari800; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#include <stdio.h>#include <stdlib.h>#include <math.h>#include "remez.h"#ifdef ASAP /* external project, see http://asap.sf.net */#include "asap_internal.h"#else#include "log.h"#include "util.h"#endif/******************* * CreateDenseGrid *================= * Creates the dense grid of frequencies from the specified bands. * Also creates the Desired Frequency Response function (D[]) and * the Weight function (W[]) on that dense grid * * * INPUT: * ------ * int      r        - 1/2 the number of filter coefficients * int      numtaps  - Number of taps in the resulting filter * int      numband  - Number of bands in user specification * double   bands[]  - User-specified band edges [2*numband] * double   des[]    - Desired response per band [numband] * double   weight[] - Weight per band [numband] * int      symmetry - Symmetry of filter - used for grid check * * OUTPUT: * ------- * int    gridsize   - Number of elements in the dense frequency grid * double Grid[]     - Frequencies (0 to 0.5) on the dense grid [gridsize] * double D[]        - Desired response on the dense grid [gridsize] * double W[]        - Weight function on the dense grid [gridsize] *******************/static void CreateDenseGrid(int r, int numtaps, int numband, double bands[],                            const double des[], const double weight[],                            int *gridsize, double Grid[],                            double D[], double W[], int symmetry){	int i, j, k, band;	double delf, lowf, highf;	delf = 0.5 / (GRIDDENSITY * r);	/* For differentiator, hilbert,	 *   symmetry is odd and Grid[0] = max(delf, band[0]) */	if (symmetry == NEGATIVE && delf > bands[0])		bands[0] = delf;	j = 0;	for (band = 0; band < numband; band++) {		Grid[j] = bands[2 * band];		lowf = bands[2 * band];		highf = bands[2 * band + 1];		k = (int) ((highf - lowf) / delf + 0.5); /* .5 for rounding */		for (i = 0; i < k; i++) {			D[j] = des[band];			W[j] = weight[band];			Grid[j] = lowf;			lowf += delf;			j++;		}		Grid[j - 1] = highf;	}	/* Similar to above, if odd symmetry, last grid point can't be .5	 *  - but, if there are even taps, leave the last grid point at .5 */	if ((symmetry == NEGATIVE) &&	   (Grid[*gridsize - 1] > (0.5 - delf)) &&	   (numtaps % 2))	{		Grid[*gridsize - 1] = 0.5 - delf;	}}/******************** * InitialGuess *============== * Places Extremal Frequencies evenly throughout the dense grid. * * * INPUT: * ------ * int r        - 1/2 the number of filter coefficients * int gridsize - Number of elements in the dense frequency grid * * OUTPUT: * ------- * int Ext[]    - Extremal indexes to dense frequency grid [r+1] ********************/static void InitialGuess(int r, int Ext[], int gridsize){	int i;	for (i = 0; i <= r; i++)		Ext[i] = i * (gridsize - 1) / r;}/*********************** * CalcParms *=========== * * * INPUT: * ------ * int    r      - 1/2 the number of filter coefficients * int    Ext[]  - Extremal indexes to dense frequency grid [r+1] * double Grid[] - Frequencies (0 to 0.5) on the dense grid [gridsize] * double D[]    - Desired response on the dense grid [gridsize] * double W[]    - Weight function on the dense grid [gridsize] * * OUTPUT: * ------- * double ad[]   - 'b' in Oppenheim & Schafer [r+1] * double x[]    - [r+1] * double y[]    - 'C' in Oppenheim & Schafer [r+1] ***********************/static void CalcParms(int r, const int Ext[], const double Grid[],                      const double D[], const double W[],                      double ad[], double x[], double y[]){	int i, j, k, ld;	double sign, xi, delta, denom, numer;	/* Find x[] */	for (i = 0; i <= r; i++)		x[i] = cos(Pi2 * Grid[Ext[i]]);	/* Calculate ad[]  - Oppenheim & Schafer eq 7.132 */	ld = (r - 1) / 15 + 1; /* Skips around to avoid round errors */	for (i = 0; i <= r; i++) {		denom = 1.0;		xi = x[i];		for (j = 0; j < ld; j++) {			for (k = j; k <= r; k += ld)				if (k != i)					denom *= 2.0 * (xi - x[k]);		}		if (fabs(denom) < 0.00001)			denom = 0.00001;		ad[i] = 1.0 / denom;	}	/* Calculate delta  - Oppenheim & Schafer eq 7.131 */	numer = denom = 0;	sign = 1;	for (i = 0; i <= r; i++) {		numer += ad[i] * D[Ext[i]];		denom += sign * ad[i] / W[Ext[i]];		sign = -sign;	}	delta = numer / denom;	sign = 1;	/* Calculate y[]  - Oppenheim & Schafer eq 7.133b */	for (i = 0; i <= r; i++) {		y[i] = D[Ext[i]] - sign * delta / W[Ext[i]];		sign = -sign;	}}/********************* * ComputeA *========== * Using values calculated in CalcParms, ComputeA calculates the * actual filter response at a given frequency (freq).  Uses * eq 7.133a from Oppenheim & Schafer. * * * INPUT: * ------ * double freq - Frequency (0 to 0.5) at which to calculate A * int    r    - 1/2 the number of filter coefficients * double ad[] - 'b' in Oppenheim & Schafer [r+1] * double x[]  - [r+1] * double y[]  - 'C' in Oppenheim & Schafer [r+1] * * OUTPUT: * ------- * Returns double value of A[freq] *********************/static double ComputeA(double freq, int r, const double ad[],                       const double x[], const double y[]){	int i;	double xc, c, denom, numer;	denom = numer = 0;	xc = cos(Pi2 * freq);	for (i = 0; i <= r; i++) {		c = xc - x[i];		if (fabs(c) < 1.0e-7) {			numer = y[i];			denom = 1;			break;		}		c = ad[i] / c;		denom += c;		numer += c * y[i];	}	return numer / denom;}/************************ * CalcError *=========== * Calculates the Error function from the desired frequency response * on the dense grid (D[]), the weight function on the dense grid (W[]), * and the present response calculation (A[]) * * * INPUT: * ------ * int    r      - 1/2 the number of filter coefficients * double ad[]   - [r+1] * double x[]    - [r+1] * double y[]    - [r+1] * int gridsize  - Number of elements in the dense frequency grid * double Grid[] - Frequencies on the dense grid [gridsize] * double D[]    - Desired response on the dense grid [gridsize] * double W[]    - Weight function on the desnse grid [gridsize] * * OUTPUT: * ------- * double E[]    - Error function on dense grid [gridsize] ************************/static void CalcError(int r, const double ad[],                      const double x[], const double y[],                      int gridsize, const double Grid[],                      const double D[], const double W[], double E[]){	int i;	double A;	for (i = 0; i < gridsize; i++) {		A = ComputeA(Grid[i], r, ad, x, y);		E[i] = W[i] * (D[i] - A);	}}/************************ * Search *======== * Searches for the maxima/minima of the error curve.  If more than * r+1 extrema are found, it uses the following heuristic (thanks * Chris Hanson): * 1) Adjacent non-alternating extrema deleted first. * 2) If there are more than one excess extrema, delete the *    one with the smallest error.  This will create a non-alternation *    condition that is fixed by 1). * 3) If there is exactly one excess extremum, delete the smaller *    of the first/last extremum * * * INPUT: * ------ * int    r        - 1/2 the number of filter coefficients * int    Ext[]    - Indexes to Grid[] of extremal frequencies [r+1] * int    gridsize - Number of elements in the dense frequency grid * double E[]      - Array of error values.  [gridsize] * OUTPUT: * ------- * int    Ext[]    - New indexes to extremal frequencies [r+1] ************************/static void Search(int r, int Ext[], int gridsize, const double E[]){	int i, j, k, l, extra;     /* Counters */	int up, alt;	int *foundExt;             /* Array of found extremals */	/* Allocate enough space for found extremals. */	foundExt = (int *) Util_malloc((2 * r) * sizeof(int));	k = 0;	/* Check for extremum at 0. */	if (((E[0] > 0.0) && (E[0] > E[1])) ||	   ((E[0] < 0.0) && (E[0] < E[1])))		foundExt[k++] = 0;	/* Check for extrema inside dense grid */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区四区的| 色婷婷综合久色| 一本一道久久a久久精品综合蜜臀| 欧美亚洲国产一区二区三区va | 一区二区三区久久| 免费观看成人鲁鲁鲁鲁鲁视频| 成人免费视频视频在线观看免费| 欧美肥妇free| 亚洲精品中文在线影院| 国产真实精品久久二三区| 欧美三级视频在线观看| 国产精品萝li| 风间由美性色一区二区三区| 欧美一级电影网站| 午夜电影久久久| 日本高清不卡视频| 日韩美女视频19| a在线播放不卡| 国产精品色一区二区三区| 国产专区欧美精品| 精品成人在线观看| 青青草原综合久久大伊人精品优势 | 亚洲精品欧美综合四区| 成人午夜免费av| 国产视频一区二区在线观看| 美女被吸乳得到大胸91| 欧美一区二区大片| 免费观看30秒视频久久| 欧美一区二区三区精品| 日本亚洲天堂网| 91精品国产高清一区二区三区 | 91日韩精品一区| 国产精品久久久久久久岛一牛影视| 国产在线乱码一区二区三区| 欧美第一区第二区| 国产又黄又大久久| 久久久www成人免费毛片麻豆| 国产在线精品一区在线观看麻豆| 精品捆绑美女sm三区| 久久精品国产99国产| 精品久久久久久久人人人人传媒| 老司机午夜精品99久久| 亚洲一区二区三区四区不卡| 91在线你懂得| 亚洲国产精品久久久久秋霞影院| 欧美午夜精品久久久久久超碰| 一区二区三区四区在线免费观看| 色婷婷亚洲一区二区三区| 亚洲综合久久av| 91精品久久久久久久久99蜜臂| 欧美a级一区二区| 久久精品视频在线看| av成人免费在线观看| 午夜视频一区二区三区| 精品欧美一区二区三区精品久久| 国产成人a级片| 亚洲免费大片在线观看| 欧美美女一区二区| 国产精品一卡二卡在线观看| 国产精品第五页| 6080国产精品一区二区| 国产精品1区二区.| 亚洲综合一区在线| 精品国产乱码久久久久久闺蜜| 国产91在线|亚洲| 亚洲午夜一区二区三区| 欧美精品一区男女天堂| 久久色在线观看| 色综合色综合色综合色综合色综合| 五月综合激情日本mⅴ| 久久日一线二线三线suv| 日本精品一区二区三区高清| 麻豆国产欧美日韩综合精品二区| 国产精品国产成人国产三级| 欧美日韩在线电影| 成人性生交大合| 琪琪久久久久日韩精品| 日韩美女精品在线| www国产成人免费观看视频 深夜成人网| aaa国产一区| 韩国v欧美v日本v亚洲v| 亚洲国产成人porn| 国产精品福利影院| 欧美va亚洲va| 欧美日韩黄色影视| 91丨porny丨蝌蚪视频| 精品无人区卡一卡二卡三乱码免费卡| 亚洲另类春色国产| 国产日产欧产精品推荐色 | 欧美一二三在线| 一本久久a久久免费精品不卡| 另类小说欧美激情| 亚洲五月六月丁香激情| 中文字幕一区二区三区av| 精品国产一区二区三区久久久蜜月 | 国产精品嫩草99a| 欧美α欧美αv大片| 6080日韩午夜伦伦午夜伦| 91蜜桃视频在线| 成人性视频免费网站| 久久99日本精品| 青青草国产成人99久久| 亚洲成人av免费| 有码一区二区三区| 亚洲欧洲无码一区二区三区| 久久精品亚洲乱码伦伦中文| 欧美电视剧在线看免费| 日韩美一区二区三区| 日韩一级黄色大片| 91精品国产色综合久久ai换脸 | 亚洲国产综合91精品麻豆| 亚洲女子a中天字幕| 国产精品国产三级国产aⅴ入口| 欧美一级片在线| 欧美一区二区视频在线观看2020 | 成人av综合一区| 国产成人aaaa| 成人av先锋影音| 波多野结衣视频一区| 99久久精品一区| 色欧美88888久久久久久影院| 9久草视频在线视频精品| 99精品久久只有精品| 94色蜜桃网一区二区三区| 91蜜桃免费观看视频| 91福利资源站| 欧美久久婷婷综合色| 欧美一区二区精美| 久久噜噜亚洲综合| 亚洲国产高清在线| 亚洲色欲色欲www| 亚洲一卡二卡三卡四卡| 日本伊人午夜精品| 国产一区二区视频在线| 成人在线一区二区三区| 日本韩国欧美三级| 欧美精品视频www在线观看| 日韩久久精品一区| 国产精品视频你懂的| 亚洲黄网站在线观看| 日韩av不卡在线观看| 国产精品一色哟哟哟| 色哟哟国产精品| 日韩三区在线观看| 国产精品久久久久永久免费观看 | 日本道色综合久久| 欧美伦理视频网站| 国产清纯白嫩初高生在线观看91| 亚洲女人****多毛耸耸8| 日韩av在线发布| 丁香激情综合五月| 欧美日韩成人激情| 欧美高清一级片在线观看| 亚洲综合精品久久| 精品一区二区久久| 99久久er热在这里只有精品66| 欧美疯狂性受xxxxx喷水图片| 国产亚洲综合在线| 天天综合色天天| k8久久久一区二区三区| 日韩欧美亚洲国产另类| 亚洲日本在线看| 国产精品888| 欧美一级精品在线| 日韩美女啊v在线免费观看| 捆绑调教一区二区三区| 日本高清不卡一区| 中文字幕久久午夜不卡| 美女国产一区二区三区| 欧美亚洲高清一区| 国产精品网站导航| 国产在线不卡一卡二卡三卡四卡| 欧美在线不卡一区| 国产精品久线在线观看| 美国精品在线观看| 欧美浪妇xxxx高跟鞋交| 亚洲精品久久7777| 99麻豆久久久国产精品免费优播| 日韩精品一区二区三区老鸭窝| 艳妇臀荡乳欲伦亚洲一区| 国产精品1区2区| 日韩精品资源二区在线| 一个色在线综合| 国产成人aaa| 国产视频一区不卡| 美女mm1313爽爽久久久蜜臀| 欧美日韩国产区一| 亚洲高清免费在线| 91国偷自产一区二区开放时间 | 国产老肥熟一区二区三区| 日韩一区二区免费在线观看| 亚洲丰满少妇videoshd| 在线观看欧美日本| 洋洋av久久久久久久一区| 日本韩国欧美三级| 亚洲最新在线观看| 欧美三级乱人伦电影| 亚洲综合色自拍一区| 欧美三级中文字幕| 午夜一区二区三区视频|