justin = { main feed , music , code , askjf , pubkey };
Ask Justin Frankel
No reasonable question unanswered since 2009!

Suggested topics: programming, music, sleep, coffee, etc.

Note: please do not ask questions about REAPER features, bugs or scheduling, use the forums instead.


Name: Ask: Human (enter yes):
[back to index] | [unreplied] | [replied] | [recent comments] | [all]

Question: Hello Justin I am trying to use the WDL_fft to make a simple spectrum analyzer and I am confused about the use of WDL_fft_permute, I basically scaled the raw samples and passed it to the fft function calculated the magnitude of the output but it doesnt look right, I saw the comment about the WDL_fft_permute and I am wondering what is going on
Asked by fft_test (156.195.142.x) on September 18 2025, 7:41pm
Reply on September 19 2025, 2:44am:
    the order of the output is special, it is not in-order and it is not bit-reverse ordered, it's the order defined by that function. and of course they are complex pairs. so if you do WDL_FFT_COMPLEX arr[1024]; then set ar[0].re to the first sample, ar[0].im to 0, etc, and fill 1024 samples (ideally windowed), then call WDL_fft(arr,1024,0), then ar[WDL_fft_permute(1024,0)] will be the DC vector (only the magnitude of that vector is significant), ar[WDL_fft_permute(1024,1)] will be the lowest frequency bin vector (take sqrt(re*re+im*im) for the magnitude),etc, then ar[WDL_fft_permute(1024,511)] will be the nyquist vector (only the magnitude of that vector will be significant).

Comment:
    Your Name:   -- Site Owner's Name:  (for human-verification)

    Comment:    

    
  
[back to index] | [unreplied] | [replied] | [recent comments] | [all]
Copyright 2025 Justin Frankel. | RSS