OpenCores
URL https://opencores.org/ocsvn/gng/gng/trunk

Subversion Repositories gng

[/] [gng/] [trunk/] [matlab/] [test_gng.m] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 guangxi.li
% Test Gaussian noise generator
2
 
3
% Copyright (C) 2014, Guangxi Liu <guangxi.liu@opencores.org>
4
%
5
% This source file may be used and distributed without restriction provided
6
% that this copyright statement is not removed from the file and that any
7
% derivative work contains the original copyright notice and the associated
8
% disclaimer.
9
%
10
% This source file is free software; you can redistribute it and/or modify it
11
% under the terms of the GNU Lesser General Public License as published by
12
% the Free Software Foundation; either version 2.1 of the License,
13
% or (at your option) any later version.
14
%
15
% This source is distributed in the hope that it will be useful, but
16
% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17
% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18
% License for more details.
19
%
20
% You should have received a copy of the GNU Lesser General Public License
21
% along with this source; if not, download it from
22
% http://www.opencores.org/lgpl.shtml
23
 
24
 
25
clc;    clear;
26
 
27
tic;
28
 
29 7 guangxi.li
N = 1000000;
30 2 guangxi.li
Seed = 1;
31
 
32
z = ctg_seed(Seed);
33
r = ctg_gen(z, N);
34
x = icdf_gen(r);
35
y = double(x)/2^11;    % standard normal distribution
36
 
37
toc;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.