Skip to content

Commit d099647

Browse files
committed
Add more comments to explain r2c fft
1 parent 3e819b4 commit d099647

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/fft.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,11 @@ macro_rules! impl_r2c_fft {
5858
assert!(output_re.len() == output_im.len() && input_re.len() == output_re.len());
5959
let big_n = input_re.len();
6060

61-
// Splitting odd and even
62-
61+
// Split real signal of size `N` into odd (size `N/2`) and even (size `N/2`) via deinterleave
62+
// The even part is now the "real" components and the odd part is now the "imaginary" components
6363
let (mut z_even, mut z_odd): (Vec<_>, Vec<_>) = deinterleave(&input_re);
6464

65-
// let mut planner = <$planner>::new(big_n, Direction::Forward);
66-
67-
// save these for the untanngling step
68-
// let twiddle_re = planner.twiddles_re;
69-
// let twiddle_im = planner.twiddles_im;
7065
let stride = big_n / 2;
71-
let twiddles_iter = Twiddles::<$precision>::new(stride);
72-
7366
let planner = <$planner>::new(big_n / 2, Direction::Forward);
7467

7568
// We only need (N / 2) / 2 twiddle factors for the actual FFT call, so we filter
@@ -133,6 +126,7 @@ macro_rules! impl_r2c_fft {
133126
// Zall = np.concatenate([Zx + W*Zy, Zx - W*Zy])
134127
let (output_re_first_half, output_re_second_half) = output_re.split_at_mut(big_n / 2);
135128
let (output_im_first_half, output_im_second_half) = output_im.split_at_mut(big_n / 2);
129+
let twiddles_iter = Twiddles::<$precision>::new(stride);
136130

137131
z_x_re
138132
.iter()

0 commit comments

Comments
 (0)