Code covered by the BSD License  

Highlights from
crandn

5.0

5.0 | 1 rating Rate this file 3 Downloads (last 30 days) File Size: 2.48 KB File ID: #21325

crandn

by Stephen Bocquet

 

04 Sep 2008 (Updated 04 Sep 2008)

Generate m sequences of n Gaussian random numbers with a specified autocorrelation function

| Watch this File

File Information
Description

[cg, psg] = crandn(rgau,m)
Generate correlated Gaussian sequences by Fourier synthesis.

Input parameters:
rgau = correlation function - length n/2
m = number of realisations

Output:
cg = m x n matrix containing m sequences of n correlated variates from
       a zero mean, unit variance normal distribution
psg = input power spectrum (Fourier transform of correlation function)

Note: Since this uses the fast Fourier transform, it will be fastest if n is a power of 2.

crandndemo.m is a demonstration. Note that one plot requires the function plotcdfkuiper (File Exchange ID #21280)

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
07 Sep 2010 Pei  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
dsp Stephen Bocquet 22 Oct 2008 10:17:38
correlated Stephen Bocquet 22 Oct 2008 10:17:38
random Stephen Bocquet 22 Oct 2008 10:17:38
numbers Stephen Bocquet 22 Oct 2008 10:17:38
gaussian Stephen Bocquet 22 Oct 2008 10:17:38
process Stephen Bocquet 22 Oct 2008 10:17:38

Contact us at files@mathworks.com