DSPRelated.com
Forums

Plotting log magnitude of FFT of a rectangular pulse

Started by Richard Owlett September 4, 2004
I was trying to reproduce something similar to Figure 3-25b in Rick's 
book (second edition) in Scilab.

My code is

a(1:899)=1;
a(900:1000)=0;
plot2d( [1:1000], abs(fft(a,-1)), logflag="nl")


What could be wrong ;<

( I tried to attach a jpg of the result, but comp.dsp refused it )
Do you mean the mirrored spectrum? Just only use the 1st half (lines 1 
to 500).

Richard Owlett wrote:

> I was trying to reproduce something similar to Figure 3-25b in Rick's > book (second edition) in Scilab. > > My code is > > a(1:899)=1; > a(900:1000)=0; > plot2d( [1:1000], abs(fft(a,-1)), logflag="nl") > > > What could be wrong ;< > > ( I tried to attach a jpg of the result, but comp.dsp refused it )
-- Please change no_spam to a.lodwig when replying via email!
Richard Owlett wrote:

> I was trying to reproduce something similar to Figure 3-25b in Rick's > book (second edition) in Scilab. > > My code is > > a(1:899)=1; > a(900:1000)=0; > plot2d( [1:1000], abs(fft(a,-1)), logflag="nl") > > > What could be wrong ;< > > ( I tried to attach a jpg of the result, but comp.dsp refused it )
From the other thread on this subject: ... Go to http://users.erols.com/jyavins/Owlett.htm ^ -->This must be a capital 'O'!<-- The plots look fine to me. The scalloping you see at the bottom with 1000 points is an artifact of the plotting process. The dots that are connected to make the curve have finite spacing. [The beat between the zero spacing and the dot spacing is also evident in the coarser plot, just not as pronounced.] Not all of the zeros are represented by dots, (In fact, none are, and most aren't close.) ... Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;