POV-Ray : Newsgroups : povray.off-topic : DFT and FFT : Re: DFT and FFT Server Time
6 Sep 2024 09:20:01 EDT (-0400)
  Re: DFT and FFT  
From: triple r
Date: 16 Jan 2009 22:50:01
Message: <web.4971548f92d55383ef2b9ba40@news.povray.org>
Michael Raiford <mra### [at] hotmailcom> wrote:
> Heh, as more come to me. I'm tossing together a little C# app to play
> around with the FFT and be able to examine it in both rectangular and
> polar forms.

Aha, I knew I had that lying around somewhere.  If you just want to play with
the behavior and not implement it yourself, there's always Matlab, or its free
equivalent, Octave.  Here's the simplest low-pass filter:

n=101; tmin=0; tmax=10;
%calculate time & frequency
  tbase = linspace(tmin,tmax,n);
  dt    = (tmax-tmin)/(n-1);
  ni    = floor((n-1)/2);
  fbase = [0:floor(n/2),ni:-1:1] /ni/2.0/dt;
%calculate y and fft(y)
  y = rand(size(tbase));
  Y = fft(y);
%filter
  Y_filt = Y;
  Y_filt(find(fbase>2.0)) = 0;
  y_filt = ifft(Y_filt);
%plot
  figure(1);  plot(tbase,y,tbase,y_filt);
  figure(2);  plot(fbase,abs(Y_filt));

 - Ricky


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.