summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/general
diff options
context:
space:
mode:
authorTom Rondeau2012-01-19 21:55:27 -0500
committerTom Rondeau2012-01-19 21:55:27 -0500
commit748063b203b137fe30d0f2d26614859f4cbc45ea (patch)
tree0eda71a496b248ba3ca38cba5b14682985b7c04e /gnuradio-core/src/lib/general
parentfe88a1ddf623df701e5f3a0c4c8e4fd008570b83 (diff)
parent8720afbfbe40c6e88345c2ddbeabe5d2ae4ff62e (diff)
downloadgnuradio-748063b203b137fe30d0f2d26614859f4cbc45ea.tar.gz
gnuradio-748063b203b137fe30d0f2d26614859f4cbc45ea.tar.bz2
gnuradio-748063b203b137fe30d0f2d26614859f4cbc45ea.zip
Merge branch 'maint'
Diffstat (limited to 'gnuradio-core/src/lib/general')
-rw-r--r--gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc b/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc
index 3293e3ab8..c66015c11 100644
--- a/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc
+++ b/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc
@@ -67,8 +67,17 @@ gr_fft_vcc_fftw::work (int noutput_items,
if (d_window.size()){
gr_complex *dst = d_fft->get_inbuf();
- for (unsigned int i = 0; i < d_fft_size; i++) // apply window
- dst[i] = in[i] * d_window[i];
+ if(!d_forward && d_shift){
+ int offset = (!d_forward && d_shift)?floor(d_fft_size/2):0;
+ int fft_m_offset = d_fft_size - offset;
+ for (unsigned int i = 0; i < offset; i++) // apply window
+ dst[i+fft_m_offset] = in[i] * d_window[i];
+ for (unsigned int i = offset; i < d_fft_size; i++) // apply window
+ dst[i-offset] = in[i] * d_window[i];
+ } else {
+ for (unsigned int i = 0; i < d_fft_size; i++) // apply window
+ dst[i] = in[i] * d_window[i];
+ }
}
else {
if(!d_forward && d_shift) { // apply an ifft shift on the data