Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
gaussian pulse

Subject: gaussian pulse

From: darren

Date: 20 Mar, 2010 18:11:04

Message: 1 of 5

I am trying to generate a gaussian pulse of width 1 and amplitude 1, below is the code I have written, however I get an error saying exp not enough arguments.

p = (1/(1 *sqrt(2*pi)))*exp^-{(1-1)^2/(2*1^2)};
t = -1:1/fs:1;
figure (1);plot (p,t)

Am I doing this correctly, or am I way of base.

Subject: gaussian pulse

From: Sadik

Date: 20 Mar, 2010 18:48:03

Message: 2 of 5

Hi Darren,

Yes, you are way off base. :D

You could start to play with this one instead:

fs = 1000;
t = -1:1/fs:1;
p = (1/(1 *sqrt(2*pi)))*exp(-t.^2/2);
plot(t,p)

Best.

Subject: gaussian pulse

From: darren

Date: 20 Mar, 2010 19:59:04

Message: 3 of 5

"Sadik " <sadik.hava@gmail.com> wrote in message <ho3593$cog$1@fred.mathworks.com>...
> Hi Darren,
>
> Yes, you are way off base. :D
>
> You could start to play with this one instead:
>
> fs = 1000;
> t = -1:1/fs:1;
> p = (1/(1 *sqrt(2*pi)))*exp(-t.^2/2);
> plot(t,p)
>
> Best.

Thanks very much for that help, I would have been tring to manipulate that equation for weeks.

I have changed the settings to give me an amplitude of 1, but I am unable to start the curve at 0. Any ideas?

Subject: gaussian pulse

From: Sadik

Date: 20 Mar, 2010 20:11:03

Message: 4 of 5

You should have t ranging from something to the very left of 0. Something like this:

t = -10:1/fs:10;

If you need, you can change the lower limit of t to get a truncated but still acceptable version.

Subject: gaussian pulse

From: darren

Date: 20 Mar, 2010 21:31:03

Message: 5 of 5

"Sadik " <sadik.hava@gmail.com> wrote in message <ho3a4n$mb7$1@fred.mathworks.com>...
> You should have t ranging from something to the very left of 0. Something like this:
>
> t = -10:1/fs:10;
>
> If you need, you can change the lower limit of t to get a truncated but still acceptable version.

Thanks again, I now have another problem, I have to make the signal represent 1010 using bipolar signalling, I have done triangular, rectangular, but I am unable to make the gaussian signal follow the pos neg pos neg bipolar signal.

Any ideas?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us