Just look at the code for the FFT block.

https://github.com/gnuradio/gnuradio/blob/main/gr-fft/lib/fft_v_fftw.cc#L81

Ron

On 8/22/22 03:37, Bartłomiej Sójka wrote:
Hi,
I'm trying to write a block that would compute FFT on the received samples, but 
I'm having trouble with finding how to perform FFT shift after the computation. 
Any help with that?
So far I'm using

d_fft = std::make_unique<fft::fft_complex_fwd>(d_fftsize);

memcpy(d_fft->get_inbuf(), d_fft_processed.data(), 
d_fftsize*sizeof(gr_complex)); //get samples from input and store them in input 
buffer
d_fft->execute(); // compute the fft
memcpy(d_fft_processed.data(), d_fft->get_outbuf(), 
d_fftsize*sizeof(gr_complex)); //get processed samples from output buffer and 
storing them in d_fft_processed

I'll appreciate any help
Bartek


Reply via email to