Randn
This is a very strange bug in randn(). After every seed-reset, the first call to randn() almost invarably produces a postive number. Most of the time this is a benign defect, but sometimes folks seek to make a random sequence of 1s and 0s using randn>0. If you tried to do this, and reset the seed...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (43): Bug (kind-of) in randn() Download |
The file calculates and plots FM noise sidebands for a carrier. It also does sinusoidal modulation. This simple way of adding noise to a carrier is useful for simulation of PLLs. It turns out, though, that the mean of the randn function is not as close to zero as it could be, and this causes the...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (44): Generate FM noise sidebands on a carrier using randn fn Download |
Fast Algorithm estimating the number of sinusoids in a white Gaussian noise. This algorithm use a sub-space method based on chi-square statistics of eigen values of the Autocorrelation Matrix.Example :clear, close all hiddenN = 512;L_vrai = 4;fe = 2000;F = (0:(fe/2)/(N/2-1):(fe/2));snr = [-10 -10...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (40): Number of sinusoids Estimator Download |
Some curve fitting or smoothing tools can benefit from knowledge of the noise variance to expect on your data. Kalman filters use this information, also some spline fitting tools. So I wrote a function to extract the noise variance from a signal vector. It also works on any specified dimension of...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (47): Estimatenoise Download |
To compute the Euclidean separation (L2 norm) between two sets of points in MATLAB can be slow and/or memory-hungry. In some cases (most particularly, if you are working with 2D, 3D or 4D data), this function will do it 2-4 times faster than the fastest m-code I've seen (due to Germano Gomes) and...
Platforms: Matlab
License: Freeware | Size: 71.68 KB | Download (40): mex_sepsq Download |
histnd Histogram count of ND data with ND bins histmat = histnd(x, y, ..., xedges, yedges, ...) Extract ND histogram data containing the number of events of [x, y, ...] tuples that fall in each bin of the ND-grid defined by xedges, yedges, .... The edges are passed to histc internally and should...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (44): histograms for ND data Download |
EMPRAND generates random numbers from empirical distribution of data. This is useful when you do not know the distribution type (i.e. normal or uniform), but you have the data and you want to generate random numbers form that data.The idea is to first construct cumulative distribution function...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (43): Random Number from Empirical Distribution Download |
vector generalization of matlab standard function randn() with correlations.inputs: Rpp - pXp correlation matrix nSamp - number of samplesoutputs: data matrix of size [p rows X nSamp cols] sample correlation matrix example generate a vector of 1000 pairs which are correlated as[1 -0.3][-0.3...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (43): correlated Gaussian noise Download |
PDFPLOT displays a histogram of the empirical probability density function (PDF) for the data in the input array X using nbins number of bins.If input X is a matrix, then pdfplot(X) parses it to the vector and displays PDF of all values.For complex input X, pdfplot(X) displays PDF of...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (45): PDFPLOT Download |
The white noise is a combination of all frecuencies.The program generate white noise using randn and create a group of filters for the musical notes.The melody is introduced in a matrix
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (44): Melody obtained from white noise Download |
This function will create a matrix of linearly spaced vectors.Example 1: Vector starting and ending pointsx1 = 100*randn(10,1);x2 = 100*randn(10,1);M = linspace2(x1,x2,1e3);imagesc(M)Example 2: Mixing Vectors and Scalarsx1 = 100*randn(10,1);x2 = 0;M = linspace2(x1,x2,1e3);imagesc(M)Suggestion to...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (44): Vectorized linspace Download |
SORT_BACK ( data = sort_back( data, indexes, dimension ) )Sort back data to original order by using the indexes obtained from sorting and the sorted dimension.Supports arrays of any dimension, and cellstrings.Works on arrays of any dimension:y = randn(3,4,2);[y,ind] = sort(y,2);do stuff with...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (42): Sort back data to original order Download |
Two files are included:CALCNBINS, which calculates the "ideal" number of bins to use in a histogram, using three possible methods. (Freedman-Diaconis', Scott's and Sturges' methods.)HISTX is a wrapper for Matlab's own histogram function HIST, that uses CALCNBINS to choose the number of bins if...
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (46): Calculate number of bins for histogram Download |
The result will be displayed in a matrix format.For uniform distributions,the values returned by the MATLAB function rand() are multiplied by (b-a), then added to a.For normal distributions the output of randn() is multiplied by the standard deviation (b), and then added to the desired to the...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (39): randMat for Mathematics Download |
The result will be displayed in a matrix format. For uniform distributions,the values returned by the MATLAB function rand() are multiplied by (b-a), then added to a.For normal distributions the output of randn() is multiplied by the standard deviation (b), and then added to the desired to the...
Platforms: Windows, Mac, *nix, Matlab, BSD Solaris
License: Freeware | Download (56): randMat Download |
LLR_DEMOD LLR Demodulator H = LLR_DEMOD_MEX(CONSTELLATION, MAPPING, METHOD) constructs a LLR demodulator object H for a given constellation, mapping and noise variance. The vectors CONSTELLATION and MAPPING are usually generated by using MATLAB Modem Modulation Modem. and contain the complex or...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (49): Calculation of LLR values with variable noise variance Download |
The gradient function in Matlab allows you to compute the slope of a curve along its entire length. But if your curve is a noisy one, then gradient will also be noisy. In this event one might desire to fit a moderately low order polynomial regression model in a sliding window, then differentiate...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (45): Movingslope Download |
This is a very simple function to find the local maximum in any dimensional array. As simple as it is it still gives nice results.I use the imdilate() function as a maximum operation and then compare the data to the result.The function receives three parameters:the data, a vector defining the...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (47): local maxima minima Download |
FASTRMS Instantaneous root-mean-square (RMS) power via convolution.FASTRMS(X), when X is a vector, is the time-varying RMS power of X, computed using a 5-point rectangular window centered at each point in the signal. The output is the same size as X and contains, for each point in X, an estimate...
Platforms: Matlab
License: Freeware | Size: 10 KB | Download (44): Screenshot Fast root-mean-square (RMS) power Download |
Quantile Regression USAGE: [p,stats]=quantreg(x,y,tau[,order,nboot]); INPUTS: x,y: data that is fitted. (x and y should be columns) Note: that if x is a matrix with several columns then multiple linear regression is used and the "order" argument is not used. tau: quantile used in regression....
Platforms: Matlab
License: Shareware | Cost: $0.00 USD | Size: 10 KB | Download (51): quantreg.m - quantile regression Download |