FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > DSP

DSP comp.dsp newsgroup, mailing list

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-09-2004, 09:23 PM
Richard Owlett
Guest
 
Posts: n/a
Default Artifacts due to discrete nature of FFT --- How to avoid ?

In another thread, I asked why my plots did not *RESEMBLE* Rick Lyons'
'textbook' examples. I received many informative responses. Some pointed
out "gotchas" that newbies such as myself often miss. Other responses
addressed issues which can trip up gurus. I wish to address some issues
in the 2nd category although I'll complicate issue by being a newbie

I wish to investigate/evaluate/? windowing functions.
I make an underlying assumption that knowing/understanding the FFT of a
time domain windowing function is crucial.

I started with a rectangular window.
{ It's crude but easily reproduced }

Based on some 'a priori' assumptions/presumptions, I chose 90% as a
appropriate duty cycle.

I plotted 2 cases and got widely different results.
[ see http://users.erols.com/jyavins/Owlett.htm ]

the scilab code for first is
a(1:899)=1;
a(900:1000)=0;
plot2d( [1:1000], abs(fft(a,-1)), logflag="nl")

the scilab code for second is
a(1:89)=1;
a(90:100)=0;
plot2d( [1:100], abs(fft(a,-1)), logflag="nl")

Making them more general

a(1:AA)=1;
a((AA+1):BB)=0;
plot2d( [1:BB], abs(fft(a,-1)), logflag="nl")

I suspect that for a "clean" plot AA and BB should be relatively prime.
I suspect AA and BB should *EACH* be prime.

Am I on the right track?



Reply With Quote
  #2 (permalink)  
Old 09-09-2004, 09:49 PM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Artifacts due to discrete nature of FFT --- How to avoid ?

Richard Owlett wrote:

> In another thread, I asked why my plots did not *RESEMBLE* Rick Lyons'
> 'textbook' examples. I received many informative responses. Some pointed
> out "gotchas" that newbies such as myself often miss. Other responses
> addressed issues which can trip up gurus. I wish to address some issues
> in the 2nd category although I'll complicate issue by being a newbie
>
> I wish to investigate/evaluate/? windowing functions.
> I make an underlying assumption that knowing/understanding the FFT of a
> time domain windowing function is crucial.
>
> I started with a rectangular window.
> { It's crude but easily reproduced }
>
> Based on some 'a priori' assumptions/presumptions, I chose 90% as a
> appropriate duty cycle.
>
> I plotted 2 cases and got widely different results.
> [ see http://users.erols.com/jyavins/Owlett.htm ]
>
> the scilab code for first is
> a(1:899)=1;
> a(900:1000)=0;
> plot2d( [1:1000], abs(fft(a,-1)), logflag="nl")
>
> the scilab code for second is
> a(1:89)=1;
> a(90:100)=0;
> plot2d( [1:100], abs(fft(a,-1)), logflag="nl")
>
> Making them more general
>
> a(1:AA)=1;
> a((AA+1):BB)=0;
> plot2d( [1:BB], abs(fft(a,-1)), logflag="nl")
>
> I suspect that for a "clean" plot AA and BB should be relatively prime.
> I suspect AA and BB should *EACH* be prime.
>
> Am I on the right track?


It depends what you mean by "clean". If you can't get useful results
with whatever AA and BB apply to your problem, you need to better
understand the tools.

Much of your initial difficulty arose from using log plots. While zero
is not a reliably obtainable result with quantized floating-point math,
"as small as makes never-no-mind" (AKA smaller than a pixel) is. Since
log plots spread small values apart, no quantity is as small as a pixel
on a log plot. The upshot is that on log plots of calculations that
could theoretically go to zero, the moiré between the pixel distance and
the location of plotted points will be almost inevitably obvious. The
effect appears in linear plots too, but it is usually less pronounced.

Making those spacings relatively prime won't help. Carefully matching
the calculation steps to the pixel distance might.

Jerry

P.S. http://users.erols.com/jyavins/Owlett.htm is updated to show your code.
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Reply With Quote
  #3 (permalink)  
Old 09-10-2004, 12:24 AM
Richard Owlett
Guest
 
Posts: n/a
Default Re: Artifacts due to discrete nature of FFT --- How to avoid ?

Jerry Avins wrote:
>
> Much of your initial difficulty arose from using log plots.


Hmm, you've said that before.
Rick mentioned it
Others observed

It just sunk in ;{
( BTW there is clinical evidence that my skull is denser than average
( now we wait for bad bone head puns )
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Discrete [email protected] FPGA 6 04-03-2006 08:05 PM
Audio Artifacts: WAV vs. WMA Curious DSP 34 06-25-2004 08:47 PM
Re: Audio Artifacts: WAV vs. WMA Curious DSP 18 06-23-2004 07:58 AM
2D discrete hartley transform Mark E. Berres DSP 17 02-13-2004 02:17 PM
which one is the most successful scheme to reduce blocky artifacts in low bit rate JPEG image? walala DSP 12 11-19-2003 03:43 PM


All times are GMT +1. The time now is 02:56 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved