# Any DSPers using Scilab [ NEWBIE in trouble ; ]

Started by September 4, 2004
```Rick Lyons wrote:
> On Sat, 04 Sep 2004 18:52:34 -0500, Richard Owlett
> <rowlett@atlascomm.net> wrote:
>
>
>>Anyone have Scilab 2.7 or 3.0 up and running under WinXP?
>>
>>I'm trying to plot magnitude of FFT of rectangular pulse/window.
>>
>>My code is
>>
>>a(1:899)=1;
>>a(900:1000)=0;
>>plot2d( [1:1000], abs(fft(a,-1)), logflag="nl")
>>
>>My output does not resemble what Mr. Lyons gives in Figure 3-25c.
>>
>>Multiple sources agree with Rick ,)
>>
>
>
> Hi Richard,
>
>    I don't "speak" Scilab language, but the
> Y-axis in my Figure 3-259c) is linear, not
> logarithmic.
>
> Richard, try this:
>
> 1) Create a time sequence that has 11 ones followed
>     by 33 zeros.
>
> 2) Perform a 44-point DFT on that time-domain sequence.
>
> 3) Compute the magnitudes (absolute values) of your
>     frequency-domains samples.
>
> 4) If you wish, divide the magnitudes by 11 (I did that
>     just to normalize my Figure 3-25(c) so the the peak
>     of the main lobe was equal to unity.)
>
> 5) Plot the freq-domain magnitude-sample sequence.  What
>     see should look an awful lot like my Figure 3-25(c).
>
> [snip ]

& now done that

result as you predicted ;)

Take a gander at
http://users.erols.com/jyavins/Owlett.htm
^ -->This must be a capital 'O'!<--
and see what befuddled me, esp 1st plot ;{

```
```Jerry Avins wrote:

..

> Don't feel too bad. Rick Lyons once fell into the same trap. ...

That may be an undeserved calumny. I am no linger sure of who got caught
in that trap. One of the regulars here, but I can't remember which one.

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;

```
```On Mon, 06 Sep 2004 13:22:01 -0500, Richard Owlett
<rowlett@atlascomm.net> wrote:

>Rick Lyons wrote:
>> On Sat, 04 Sep 2004 18:52:34 -0500, Richard Owlett
>> <rowlett@atlascomm.net> wrote:
>>
>>
>>>Anyone have Scilab 2.7 or 3.0 up and running under WinXP?
>>>
>>>I'm trying to plot magnitude of FFT of rectangular pulse/window.
>>>
>>>My code is
>>>
>>>a(1:899)=1;
>>>a(900:1000)=0;
>>>plot2d( [1:1000], abs(fft(a,-1)), logflag="nl")
>>>
>>>My output does not resemble what Mr. Lyons gives in Figure 3-25c.
>>>
>>>Multiple sources agree with Rick ,)
>>>
>>
>>
>> Hi Richard,
>>
>>    I don't "speak" Scilab language, but the
>> Y-axis in my Figure 3-259c) is linear, not
>> logarithmic.
>>
>
>Not *quite* the trap I fell into ;}
>
>Originally my project was "Investigate various windowing functions".
>That led me to Fig 3-16(b) ( a log magnitude plot )
>I started experimenting and got "strange" results.
>Went back to searching book for figure reference so I could post
>"SEMI"intelligent question. Saw Fig 3-25(c). Missed that it was linear
>scale. The rest ( as they say ) is history ;}
>
>
>Actually I think this all is a recommendation for your book.
>[ Not sure how publisher could convey it in an ad. ]
>
>The point being, an independent student using your book gets enough
>information to know when he's doing something wrong. That I didn't know
>*WHAT* was wrong is irrelevant. I've used toooo many course texts that
>failed this.
>
>
>
>> Richard, try this:
>>
>> [snip detailed test example ]
>
>I'll perform your exact example and some with the same proportions.
>Based on Jerry Avins' response when he posted the plots I got, I suspect
>there are interesting times ahead.

Hi Richard,

Thanks for the kind words.

Your first plot is correct, as far as I can
tell.  Your original time sequence had more
nonzero-valued samples than zero-valued samples.
(Your pulse's "duty cycle" was more than 50%.)

[-Rick-]

```
```On Mon, 06 Sep 2004 21:54:37 -0400, Jerry Avins <jya@ieee.org> wrote:

>Jerry Avins wrote:
>
>   ..
>
>> Don't feel too bad. Rick Lyons once fell into the same trap. ...
>
>That may be an undeserved calumny. I am no linger sure of who got caught
>in that trap. One of the regulars here, but I can't remember which one.
>
>Jerry

Hi Jerry,

calumny???

If I recall correctly, in the first Batman movie Batman
escaped the clutches of the (evil) Joker with some
sort of fancy gadget.  The Joker wasn't upset, ... he
just looked up and said, with a smile, "Where does he
get those wonderful toys?"

When I read your "calumny", I mumbled "Where does he
get those wonderful words?"

To save the other guys trouble, my dictionary says that
"calumny" means: a misrepresentation intended to blacken
another's reputation.

Actually Jer, you were right when you wrote: "Rick Lyons
once fell into the same trap."  That was indeed I.
(I almost typed, "That was indeed me."  Ha ha, I have
as much trouble with English grammar as I do with
DSP theory.)

I think "calumny" perfectly describes our current
presidential race.   :-(

While looking for "calumny", I ran across the word
"calumet".  I always thought calumet was a city, but
it's also the name for the long ornamented ceremonial
smoking pipe used by the American Indians when they wanted
to be hospitable to John Wayne in the ol' cowboy movies.

See Ya',
[-Rick-]

```
```On Mon, 06 Sep 2004 21:54:37 -0400, Jerry Avins <jya@ieee.org> wrote:

(snipped)

Speaking of the words "I" and "me", I often
use the wrong word.  ("I" instead of "me", and
vice versa.)

I should be more careful because "I" and "me"
can mean two *very* different things.  For example,
the two sentences:

"Jerry loves spaghetti more than I."

and

"Jerry loves spaghetti more than me."

are wildly different.

[-Rick-]

```
```Rick Lyons wrote:
...
> While looking for "calumny", I ran across the word
> "calumet".  I always thought calumet was a city ...

Camelot?

```
```Rick Lyons wrote:

...

> To save the other guys trouble, my dictionary says that
> "calumny" means: a misrepresentation intended to blacken
> another's reputation.

So, if "calumny" implies intent, "unintended calumny" is an oxymoron.

> I think "calumny" perfectly describes our current
> presidential race.   :-(

What else is new? :-(

> While looking for "calumny", I ran across the word
> "calumet".  I always thought calumet was a city, but
> it's also the name for the long ornamented ceremonial
> smoking pipe used by the American Indians when they wanted
> to be hospitable to John Wayne in the ol' cowboy movies.

It was also the brand of my Mother's favorite baking powder.

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;

```
```Andor Bariska wrote:

> Rick Lyons wrote:
> ...
>
>> While looking for "calumny", I ran across the word "calumet".  I
>> always thought calumet was a city ...
>
>
> Camelot?

Calumet, Wisconsin.

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;

```
```Jerry Avins wrote:

Andor Bariska wrote:

> Rick Lyons wrote:
> ...
>
>> While looking for "calumny", I ran across the word "calumet".  I
always thought calumet was a city ...
>
>
>
> Camelot?

Calumet, Wisconsin.
Calumet City, Illinois

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;

```
```Rick Lyons wrote:

> On Mon, 06 Sep 2004 13:22:01 -0500, Richard Owlett
> <rowlett@atlascomm.net> wrote:
>
>
>>Rick Lyons wrote:
>>
>>>On Sat, 04 Sep 2004 18:52:34 -0500, Richard Owlett
>>><rowlett@atlascomm.net> wrote:
>>>
>>>
>>>
>>>>Anyone have Scilab 2.7 or 3.0 up and running under WinXP?
>>>>
>>>>I'm trying to plot magnitude of FFT of rectangular pulse/window.
>>>>
>>>>My code is
>>>>
>>>>a(1:899)=1;
>>>>a(900:1000)=0;
>>>>plot2d( [1:1000], abs(fft(a,-1)), logflag="nl")
>>>>
>>>>My output does not resemble what Mr. Lyons gives in Figure 3-25c.
>>>>
>>>>Multiple sources agree with Rick ,)
>>>>
>>>
>>>
>>>Hi Richard,
>>>
>>>   I don't "speak" Scilab language, but the
>>>Y-axis in my Figure 3-259c) is linear, not
>>>logarithmic.
>>>
>>
>>Not *quite* the trap I fell into ;}
>>
>>Originally my project was "Investigate various windowing functions".
>>That led me to Fig 3-16(b) ( a log magnitude plot )
>>I started experimenting and got "strange" results.
>>Went back to searching book for figure reference so I could post
>>"SEMI"intelligent question. Saw Fig 3-25(c). Missed that it was linear
>>scale. The rest ( as they say ) is history ;}
>>
>>
>>Actually I think this all is a recommendation for your book.
>>[ Not sure how publisher could convey it in an ad. ]
>>
>>The point being, an independent student using your book gets enough
>>information to know when he's doing something wrong. That I didn't know
>>*WHAT* was wrong is irrelevant. I've used toooo many course texts that
>>failed this.
>>
>>
>>
>>
>>>Richard, try this:
>>>
>>>[snip detailed test example ]
>>
>>I'll perform your exact example and some with the same proportions.
>>Based on Jerry Avins' response when he posted the plots I got, I suspect
>>there are interesting times ahead.
>
>
> Hi Richard,
>
>    Thanks for the kind words.
>
> Your first plot is correct, as far as I can
> tell.  Your original time sequence had more
> nonzero-valued samples than zero-valued samples.
> (Your pulse's "duty cycle" was more than 50%.)
>
> [-Rick-]
>

I'll ignore issue of "artifacts" introduced by sampling choices.
[ I've done some experiments whose result emulates ancient curse, "May
you live in 'interesting' times ,]

What is the problem with a pulse having > 50% duty cycle?

This is crucial to the "problem" I originally wished to explore.

My 'universe of discourse' is hours of speech encoded at 40 kHz.
This group has succeeded in convincing me that that any sane spectral
analysis depends on appropriately windowing the data. I do not "grok",
but I do 'accept'.

As I am math challenged, I approached problem graphically.

I have been told a 'boxcar' window is worst choice.
There are a number of "standard" windows.
I was setting out to compare them.
Intuitevly my final window might be said to have 100% duty cycle.
[ leading 0's, a function, trailing 0's ]