function H=HistConnect(X,B,R)
% This Function HistConnect will make a smooth histogram for a signal % or image consisting of a few samples. The function assumes correlat ion
% between the samples, and implicitly generates new linear-interpolat ed
% samples between the orignal samples. Thus makes the assumption of % continuity between samples and low-frequency signal.
%
% (If your samples are spatial uncorrelated, use X=sort(X) before usi ng
% this function)
%
% H=HistConnect(X,B,R)
%
% X : A 1D vector or 2D matrix (image) with sample values
% B : The number of histogram bins (default 256)
% R : A vector [1 x 2], with the min and max histogram boundary,
% (default R=getrangefromclass(X))
%
% Example how it works,
% – You want 3 bins
% – Measured samples [0 0.3 0.7 1]
% – Histogram edges [0 1/3] [1/3 2/3] [2/3 1];
% A normal histogram function will return:
% H= [2 0 2]
%
% This histogram function makes histogram-blocks between two
% values in the sample vector
% sample value 0 connect with 0.3 : [1.33 0.00 0.00]
% sample value 0.3 connect with 0.7 : [0.11 1.11 0.11]
% sample value 0.7 connect with 1.0 : [0.00 0.00 1.33]
% ———————
% H = [1.44 1.11 1.44]
%
%
%
% Example, Signal:
%
% XN=sin(2*pi*(1/2000)*(1:2000))/2+0.5;
% XS=sin(2*pi*(1/20)*(1:20))/2+0.5;
% figure,
相关资源:CPU风扇控速软件-硬件开发工具类资源-CSDN文库
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!