Capsim Block Documentation
float x; int i; int ii; int j; int jj; int widthImage; int heightImage; image_t img; char title[80]; char filename[100]; FILE* file_F; |
---|
/* * store as state the number of input/output buffers */ if((ibufs = NO_INPUT_BUFFERS()) <= 0) { fprintf(stderr,"hist: no inputs connected\n"); return(2); } if((obufs = NO_OUTPUT_BUFFERS()) > ibufs) { fprintf(stderr,"hist: too many outputs connected\n"); return(3); } binWidth=(stop-start)/((float)numberOfBins); if(numberOfBins>512 || binWidth<0.)return(1); if(control) { bin = (float *) malloc(numberOfBins * sizeof(float)); plotbin = (float *) malloc(numberOfBins * sizeof(float)); xbin = (float *) malloc(numberOfBins * sizeof(float)); if(bin == NULL || plotbin == NULL || xbin ==NULL) { fprintf(stderr,"hist could not allocate memory\n"); return(4); } } for(i=0;i |
---|
for(ii=MIN_AVAIL();ii>0;--ii) { for(i=0; i |
---|
if((totalCount - skip) > 0 || bufferType==IMAGE_BUFFER ) { if(total != npts && bufferType == FLOAT_BUFFER) total = totalCount -skip; for(j=0;j |
---|
/* Capsim (r) Text Mode Kernel (TMK) Star Library (Blocks) Copyright (C) 1989-2017 Silicon DSP Corporation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA http://www.silicondsp.com Silicon DSP Corporation Las Vegas, Nevada */ |
---|
/* hist.s */ /********************************************************************** hist() *********************************************************************** inputs: in, the signal of interest outputs: none parameters: float start, the start of the leftmost bin float stop, the end of the rightmost bin int numberOfBins file file_spec, the name of the output file int npts, how many points to wait before plotting number of samples to skip x axis label y axis label plot style ( line, bar chart) control to turn on and off *********************************************************************** This program computes a histogram of the received data. For a large no. of data points this distribution should approach the probability dist. of the signal . Any samples outside the range are put in the appropriate outer- most bin. -Parameter one is the starting point for the leftmost bin -Parameter two is the ending point for the rightmost bin -Parameter three is the number of bins (less than 2048) -Parameter four is the filename for the output -Parameter five is the number of points to obtain before plotting Programmer: John T. Stonick Date: January 1988 Modified: March 29, 1988 Modified: June 18, 1990 Sasan H. Ardalan */ |
---|