N step fft in D language

John Colvin john.loughran.colvin at gmail.com
Sun Sep 15 14:55:17 PDT 2013


On Sunday, 15 September 2013 at 20:58:54 UTC, Kadir Erdem Demir 
wrote:
> On Sunday, 15 September 2013 at 15:39:14 UTC, John Colvin wrote:
>> On Sunday, 15 September 2013 at 15:15:28 UTC, Kadir Erdem 
>> Demir wrote:
>>> I am using fft function from std.numeric
>>>
>>> Complex!double[] resultfft = fft(timeDomainAmplitudeVal);
>>>
>>> The parameter timeDomainAmplitudeVal is audio amplitude data. 
>>> Sample rate 44100 hz and there is 131072(2^16) samples
>>>
>>> I am seeing that resultfft has the same size as 
>>> timeDomainAmplitudeVal(131072) which does not fits my 
>>> project(also makes no sense).
>>
>> That's what the FFT does. See here: 
>> http://stackoverflow.com/questions/4364823/how-to-get-frequency-from-fft-result
>
> I believe I am well aware of the things which are explained in 
> the link. There is a sentence in link which says  : "The first 
> bin in the FFT is DC (0 Hz), the second bin is Fs / N, where Fs 
> is the sample rate and N is the size of the FFT."
>
> My question how can I determine the "N" which is the size of 
> FFT ?
> In fftw library one can define N like :
> fftw_create_plan(N, FFTW_FORWARD, FFTW_ESTIMATE);
> In D do we have a way to do that ?

The only time i've ever come across an fft "size" is as the 
window width for a spectrogram/rolling FFT (such as one might use 
for a real-time fft filter in audio processing). Is that what 
you're looking for?


More information about the Digitalmars-d-learn mailing list