- 'a' specifies the amplitude
- 'b' specifies the x-coordinate of the center
- 'c' specifies the width
- 'x' is a vector of x inputs
How can I plot the realizations of a Gaussian signal?
64 views (last 30 days)
I would like to plot the realizations of a simple Gaussian signal with mean 0 and unit variance. Let's call it X(t).
If I use the function randn(), I get a vector of gaussian variables, that is for every ω I get a random variable . But what I want is a function of time, that is, fixed ω, I want to see X(t) on my plot.
How can I get that?
Adam Danz on 19 Mar 2019
Edited: Adam Danz on 14 Jul 2020
"I would like to plot the realizations of a simple Gaussian signal with mean 0 and unit variance. Let's call it X(t)."
The parameterized equation for a gaussian is below where
Note that you could also use gaussmf() if you have the Fuzzy Logic Toolbox.
Also see this answer which includes a vertical offset term and compares the results to gaussmf.
gauss = @(x,a,b,c) a*exp(-(((x-b).^2)/(2*c.^2)));
x = -4:.01:4;
amp = 1;
cnt = 0;
sig = 1;
y = gauss(x, amp, cnt, sig); %same as y = gaussmf(x, [sig, cnt]) * amp;
plot([cnt,cnt], ylim, ':k') %show center