|
@ -7,12 +7,12 @@ mod fixtures; |
|
|
fn forward() {
|
|
|
fn forward() {
|
|
|
let mut data = fixtures::TIME_DATA.to_vec();
|
|
|
let mut data = fixtures::TIME_DATA.to_vec();
|
|
|
fft::forward(&mut data);
|
|
|
fft::forward(&mut data);
|
|
|
assert::close(&data, &fixtures::FREQUENCY_DATA[..], 1e-13);
|
|
|
|
|
|
|
|
|
assert::close(&data, &fixtures::FREQUENCY_DATA[..], 1e-14);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
#[test]
|
|
|
fn inverse() {
|
|
|
fn inverse() {
|
|
|
let mut data = fixtures::FREQUENCY_DATA.to_vec();
|
|
|
let mut data = fixtures::FREQUENCY_DATA.to_vec();
|
|
|
fft::inverse(&mut data, true);
|
|
|
fft::inverse(&mut data, true);
|
|
|
assert::close(&data, &fixtures::TIME_DATA[..], 1e-13);
|
|
|
|
|
|
|
|
|
assert::close(&data, &fixtures::TIME_DATA[..], 1e-14);
|
|
|
}
|
|
|
}
|