amplitude spectrum of gaussian wave

Hi all,
I want to obtain an amplitude spectrum of Gaussian wave with 10ns pulse width. The following codes cannot generate the amplitude spectrum properly. What is wrong?
clc;
fs=10000000;
x=0:0.01:10;
y=gaussmf(x,[0.00000001 0.5]);
S=fft(y,512);
w=(0:255)/256*(fs/2);
figure
plot(w,abs([S(1:256)']));
xlabel('Frequency (Hz)');
ylabel('Mag. of Fourier transform');

1 Comment

You didn't tell us what was wrong, and I don't have gaussmf(), so I can't test your code. Does it not have a Gaussian shape? Is the scale wrong? Does it just not plot and barf up a bunch of red error text to the command window? How far does it get? Does it finish, or does it throw an exception on some line, and if so, what line?

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 3 May 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!