高斯函数在数学上是一个很重要的概念,在idl中有多个函数进行和高斯函数运算有关的函数。 1.gaussfit 高斯拟合函数,共有4个函数用来进行模拟 The GAUSSFIT function computes a non-linear least-squares fit to a function f ( x ) with from three to six unknown parameters. f ( x ) is a linear combination of a Gaussian and a quadratic; the number of terms is controlled by the keyword parameter NTERMS. 不仅可以输出高斯函数的参数,而且可以输出模拟值 2.GAUSS_PDF Result = GAUSS_PDF( V ) The GAUSS_PDF function computes the probability P that, in a standard Gaussian (normal) distribution with a mean of 0.0 and a variance of 1.0, a random variable X is less than or equal to a user-specified cutoff value V This function returns a scalar or array with the same dimensions as V . If V is double-precision, the result is double-precision, otherwise the result is single-precision. 计算方差为1,平均值为0的高斯函数的概率,也就是小于设定的变量x的所有部分的概率 例如 Compute the probability that a random variable X, from the standard Gaussian (normal) distribution, is less than or equal to 2.44: PRINT, GAUSS_PDF(2.44) 0.992656 ;see gauss_pdf.pro ;EXAMPLES: ; Compute the probability that a random variable X, from the ; standard Gaussian (Normal) distribution, is less than or equal ; to 2.44. The result should be 0.992656 ; result = gauss_pdf(2.44) ; ; Compute the probability that a random variable X, from the ; standard Gaussian (Normal) distribution, is less than or equal ; to 10.0 and greater than or equal to 2.0. The result should be ; 0.0227501 ; result = gauss_pdf(10.0) - gauss_pdf(2.0) ; ; Compute the probability that a random variable X, from the ; Gaussian (Normal) distribution with a mean of 0.8 and a variance ; of 4.0, is less than or equal to 2.44. The result should be ; 0.793892 ; result = gauss_pdf( (2.44 - 0.80)/sqrt(4.0) ) 3.GAUSS_CVF Result = GAUSS_CVF( P ) The GAUSS_CVF function computes the cutoff value V in a standard Gaussian (normal) distribution with a mean of 0.0 and a variance of 1.0 such that the probability that a random variable X is greater than V is equal to a user-supplied probability P . 这个计算的结果并不是和第2个函数是相反 的,用户设定的概率是大于结果值的部分的概率,假如说结果为0.2,那么设定的概率就是大于0.2的部分的概率。 4.GAUSSINT Result = GAUSSINT( X ) The GAUSSINT function evaluates the integral of the Gaussian probability function. The Gaussian integral is defined as: 5.IMSL_INTFCN 求算各种函数的积分 6.COMFIT 求解各个函数拟合的参数 Result = COMFIT( X , Y , A ) 7.curvefit The CURVEFIT function uses a gradient-expansion algorithm to compute a non-linear least squares fit to a user-supplied function with an arbitrary number of parameters. The user-supplied function may be any non-linear function where the partial derivatives are known or can be approximated. Iterations are performed until the chi square changes by a specified amount, or until a maximum number of iterations have been performed. 由于comfit只能对软件定义的函数进行参数计算,而无法对用户自己定义的函数求解,curvefi函数就是实现对用户定义的函数进行拟合。
柯西、高斯 ; 庞加莱,希尔伯特 : 四位数学大牛 在 1972年 Morris Kline 的《Mathematical Thought From Ancient To Modern Times 古今数学思想》第4卷汉译本第96页,有一个超级数学家的排名: 柯西、高斯:两个了解数学的人。 庞加莱,希尔伯特:几乎是通才。 真傻求教: (1)这是谁排的名次?有足够的权威性吗? (2)人类历史上的数学家排行榜,还有哪些权威的? 第一名:Augustin Louis Cauchy (1789-08-21 ~ 1857-05-23) MacTutor History of Mathematics http://www-history.mcs.st-andrews.ac.uk/Biographies/Cauchy.html 第二名: Johann Carl Friedrich Gauss (1777-04-30 ~ 1855-02-23) MacTutor History of Mathematics http://www-history.mcs.st-andrews.ac.uk/Biographies/Gauss.html 第三名: Jules Henri Poincaré (1854-04-29 ~ 1912-07-17) MacTutor History of Mathematics http://www-history.mcs.st-andrews.ac.uk/Biographies/Poincare.html 第四名: David Hilbert (1862-01-23 ~ 1943-02-14) MacTutor History of Mathematics http://www-history.mcs.st-andrews.ac.uk/Biographies/Hilbert.html My God!什么时候真傻才能排名超过柯西? 当年的读书笔记: 《古今数学思想》该页截图: 感谢您的指教! 感谢您指正以上任何错误!
一年的最后一天与新年的第一天当然都是个好日子。 据说西方新年的习俗起始于公元前三千多年前的古埃及人。他们在长期农耕中观察发现,尼罗河两次泛滥时间之间大约相隔 365天,而且恰好是太阳与天狼星同时从地平线上升起的时候。于是,古埃及人便把泛滥的这一天定为一年的开始。与我们欢庆的场面相反,我猜想当他们离开辛勤耕作一年的土地时,对这新年总不会有太多好感吧。 确实,仔细想想,所谓新年,也不过是咱们这个暗淡的蓝点周而复始在它公转轨道上运行,到达 近日点附近一个平淡无奇的位置。 喂,拜托!理性不等于扫兴,Cheer Up! 其实在科学史上,12月31日与 1月1日还有个有趣的故事 。 那还要从1801年说起。这年新年来临的晚上,闲来无事的意大利神父 朱塞普· 皮亚齐 (Giuseppe Piazzi)还像往常一样聚精会神地从望远镜中观察着星空,幸运的他无意中发现了一颗从未有人描述过的小行星—— 谷神星 (Ceres) 。可是后来再寻找却怎么也找不到了,有人以为这可能是一颗彗星…几个月过去了,争论传到了年轻的 德国数学家 高斯的耳朵里,他来了兴趣,你们观测不到,我可以算啊。 著名数学家 欧拉 有一种计算轨道的方法,但非常麻烦。年轻的 高斯志存高远,对开普勒、牛顿等先贤的数学成就心存敬意,自然见贤思齐,大胆寻找一种简便的方法。略过公式细节,今天就别折磨大家了。总之,他经过艰苦的运算,以其独步天下的数学才能创立了一种新的行星 轨道计算 理论。他再结合皮亚齐的观测线索,据说只用了一个小时就算出了谷神星的轨道数据,并指明了观测的时间与位置。 这还没完,好戏还在后头。1801年12月31日夜,看,居然又是新年这天,德国天文爱好者 奥 博 斯 ,根据高斯预言,用望远镜指向了天空。果然,谷神星再一次神奇地出现… 追忆当年,这三位前辈的新年之夜该是何等之幸福! 高斯的数学工作对当时的天文学起了至关重要的作用,这颗借助笔尖寻找到的天体,在消失了整整一年后,成为科学馈赠给人类最好的新年礼物。 谷神星 以 罗马神祇 刻瑞斯 命名,也可音译为瑟雷斯,是一位像母亲一样负责掌管万物生长、收获与慈爱的神。 谷神星 在 太阳系 内是已知最大的 小行星 ,并且是唯一位于火星和木星间 小行星主带 上的一颗 矮行星 。谷神星直径约950千米,是 小行星带 中已知 最大 和最重的天体,占小行星带总质量的三分之一。其外表呈现球状,据信有 岩石内 核和以 冰 为主的 地幔 ,并可能含有大量的水。不久前天文学家利 用 欧洲航天局 的赫歇尔太空望远镜,已经观测到水蒸气从谷神星两地区以羽流的形式喷射出来。 还有一个好消息, NASA在 29日刚刚宣布,2007年9月27日发射的 黎明号 (dawn)探测器在探测了灶神星后,目前已经快接近谷神星,有望成为第一个造访太阳系两颗天体的无人探测器。预计使用离子推进器的黎明号探测器将于2015年3月6日飞抵谷神星。让我们拭目以待吧! 真是个好的开始!祝各位也有同样的精彩新年! 正如 Chapman在新年快乐 歌中所唱的那样: As another chapter ends and another one begins Slowly now we turn the page Out into the midnight sky, I stare in wonder At the grand design of how our planet dances with the sun … … A story’s being told and the best is yet to come So Happy New Year, Happy New Year!
= wavread('1secLAU.wav'); for i=1:50 D(i,:)=A((i-1)*160+1:i*160); End for i=1:50 plot(D(i,:)/a+i-1,'k'); hold on; end E=zeros(8000,1); AG=awgn(A,20,0); E=zeros(8001,1); for i=1:100 E(floor(8001*rand)+1)=5*randn; end /awgn添加高斯白噪声函数 =wavread('friends0122'); y=awgn(data,20); =wavread('friends0122'); wavwrite(y,fs,nibts,'friends0122(1)'); 下面是一小段代码: x=randn(1,10); y=awgn(x,5); snr=10*log10((x*x')/((x-y)*(x-y)')); snr snr = 5.4170
转自: http://hi.baidu.com/linecong/item/ae892113782a64dcbe904233 http://i.mtime.com/920665/blog/6004593/ 1801年1月,天文学家Giuseppe Piazzi发现了一颗从未见过的小行星。据说刚发现不久,他就病倒了,等病好时,已过了几个月,那颗小行星却怎么也找不到了。当时有名的天文学家都加入了对这颗小行星的寻找,却徒劳无获。 1801年9月,高斯决定用数学方法寻找这颗小行星的踪迹。3个月后,高斯宣称已预测出该小行星的轨道。天文学家在高斯指出的位置,果然再次发现了它。这颗小行星后来被命名为谷神星(Ceres)。高斯因为此事名声大震,但他却拒绝透露计算小行星轨道的办法;8年后,直到高斯系统地完善了相关的数学理论,才将他的方法公布于众,这就是“最小二乘法”(Least squares method)。 最小二乘法普遍用于回归分析,例如根据以往观察到的行星位置,预测它的运行轨道。最小二乘法跟矩阵理论有着某种神秘的联系。 若 A 为m×n的矩阵, b 为m×1的矩阵,则 Ax = b 表达了一个线性方程组,它的normal equation的形式为 A T Ax = A T b 。 当 Ax = b 有解时(即矩阵 的秩与 A 的秩相同), Ax = b 与 A T Ax = A T b 的解集是一样。 而当 Ax = b 无解时, A T Ax = A T b 仍然有解,其解集即最小二乘解(least squares solution),即使得( Ax - b )T( Ax - b )的值最小的解,可以理解为使方程组 Ax = b 近似成立且误差最小的解。normal equation的这个性质令人惊叹。 -------------------------------------- 故事的具体经过: 1801年高斯有机会戏剧性地施展他的优势的计算技巧。那年的元旦,有一个后来被证认为小行星并被命名为谷神星的天体被发现当时它好像在向太阳靠近,天文学家虽然有40天的时间可以观察它,但还不能计算出它的轨道。高斯只作了3次观测就提出了一种计算轨道参数的方法,而且达到的精确度使得天文学家在1801年末和1802年初能够毫无困难地再确定谷神星的位置。高斯在这一计算方法中用到了最小二乘法。
对于图像来说,高斯滤波器是利用高斯核的一个2维的卷积算子,用于图像模糊化(去除细节和噪声)。 1. 高斯分布 一维高斯分布 , 二维高斯分布 2.高斯核 理论上,高斯分布在所有定义域上都有非负值,这就需要一个无限大的卷积核。实际上,仅需要取均值周围3倍标准差内的值,以外部份直接去掉即可。 如下图为一个标准差为1.0的整数值高斯核。 3. 高斯滤波(平滑) 完成了高斯核的构造后,高斯滤波就是用此核来执行标准的卷积。 4.应用 高斯滤波后图像被平滑的程度取决于标准差。它的输出是领域像素的加权平均,同时离中心越近的像素权重越高。因此,相对于均值滤波(mean filter)它的平滑效果更柔和,而且边缘保留的也更好。 高斯滤波被用作为平滑滤波器的本质原因是因为它是一个低通滤波器,见下图。而且,大部份基于卷积平滑滤波器都是低通滤波器。 图.高斯滤波器(标准差=3像素)的频率响应。The spatial frequency axis is marked in cycles per pixel, and hence no value above 0.5 has a real meaning。 Matlab函数:h = fspecial('gaussian', hsize, sigma) returns a rotationally symmetric Gaussian lowpass filter of size hsize with standard deviation sigma (positive). hsize can be a vector specifying the number of rows and columns in h, or it can be a scalar, in which case h is a square matrix. The default value for hsize is ; the default value for sigma is 0.5. 5 资源: 1) http://homepages.inf.ed.ac.uk/rbf/HIPR2/gsmooth.htm
转自: program main implicit none character(len=20) input logical alive integer,parameter::inputfile=11,outputfile=12 integer ::counter=0,lines real x,y,w2 real,allocatable:: x0(,y0( real left,right real ::A=3.0,step=0.05,w !A为半高宽,step为x增加的间距 integer ::status w2=A**2/2/LOG(2.0) write(*,*)"input file name:" read(*,*)input inquire(file=input,exist=alive) if(.not.alive)then write(*,*)input,"does not exist" stop end if open(unit=inputfile,file=input,access="sequential",status="old" do while(.true.) read(unit=inputfile,fmt="(F6.2,1X,F8.6)",iostat=status)x,y if(status/=0)exit counter=counter+1 write(*,*)counter,"line:",x,y end do lines=counter rewind(inputfile) allocate(x0(counter)) allocate(y0(counter)) do counter=1,lines read(unit=inputfile,fmt="(F6.2,1X,F8.6)",iostat=status)x0(counter),y0(counter) if(status/=0)exit end do write(*,*)"left:" read(*,*)left write(*,*)"right:" read(*,*)right open(unit=outputfile,file="data.dat" x=left do while(x=right) y=0.0 do counter=1,lines if(abs(x-x0(counter)=3*A)) then y=y0(counter)/EXP(2*(x-x0(counter))**2/w2)+y end if end do write(unit=outputfile,fmt="(F6.2,1X,F8.6)"x,y x=x+step end do stop end program
betarnd 贝塔分布的随机数生成器 binornd 二项分布的随机数生成器 chi2rnd 卡方分布的随机数生成器 exprnd 指数分布的随机数生成器 frnd f分布的随机数生成器 gamrnd 伽玛分布的随机数生成器 geornd 几何分布的随机数生成器 hygernd 超几何分布的随机数生成器 lognrnd 对数正态分布的随机数生成器 nbinrnd 负二项分布的随机数生成器 ncfrnd 非中心f分布的随机数生成器 nctrnd 非中心t分布的随机数生成器 ncx2rnd 非中心卡方分布的随机数生成器 normrnd 正态(高斯)分布的随机数生成器 poissrnd 泊松分布的随机数生成器 raylrnd 瑞利分布的随机数生成器 trnd 学生氏t分布的随机数生成器 unidrnd 离散均匀分布的随机数生成器 unifrnd 连续均匀分布的随机数生成器 weibrnd 威布尔分布的随机数生成器 RANDN Normally distributed random numbers. RANDOM Generate random arrays from a specified distribution. R = RANDOM(NAME,A) returns an array of random numbers chosen from the one-parameter probability distribution specified by NAME with parameter values A. R = RANDOM(NAME,A,B) or R = RANDOM(NAME,A,B,C) returns an array of random numbers chosen from a two- or three-parameter probability distribution with parameter values A, B (and C). The size of R is the common size of the input arguments. A scalar input functions as a constant matrix of the same size as the other inputs. R = RANDOM(NAME,A,M,N,...) or R = RANDOM(NAME,A, ) returns an M-by-N-by-... array of random numbers for a one-parameter distribution. Similarly, R = RANDOM(NAME,A,B,M,N,...) or R = RANDOM(NAME,A,B, ), and R = RANDOM(NAME,A,B,C,M,N,...) or R = RANDOM(NAME,A,B,C, ), return an M-by-N-by-... array of random numbers for a two- or three-parameter distribution. NAME can be: 'beta' or 'Beta', 'bino' or 'Binomial', 'chi2' or 'Chisquare', 'exp' or 'Exponential', 'ev' or 'Extreme Value', 'f' or 'F', 'gam' or 'Gamma', 'gev' or 'Generalized Extreme Value', 'gp' or 'Generalized Pareto', 'geo' or 'Geometric', 'hyge' or 'Hypergeometric', 'logn' or 'Lognormal', 'nbin' or 'Negative Binomial', 'ncf' or 'Noncentral F', 'nct' or 'Noncentral t', 'ncx2' or 'Noncentral Chi-square', 'norm' or 'Normal', 'poiss' or 'Poisson', 'rayl' or 'Rayleigh', 't' or 'T', 'unif' or 'Uniform', 'unid' or 'Discrete Uniform', 'wbl' or 'Weibull'.