MCPcopy Index your code
hub / github.com/arrayfire/arrayfire-rust / main

Function main

examples/fft.rs:4–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2use num::Complex;
3
4fn main() {
5 set_device(0);
6 info();
7 let samples = 10;
8 let dims = Dim4::new(&[samples, 1, 1, 1]);
9
10 let values = vec![
11 Complex::new(0.0, 2.0),
12 Complex::new(0.0, 2.0),
13 Complex::new(0.0, 2.0),
14 Complex::new(0.0, 2.0),
15 Complex::new(0.0, 2.0),
16 Complex::new(0.0, 2.0),
17 Complex::new(0.0, 2.0),
18 Complex::new(0.0, 2.0),
19 Complex::new(0.0, 2.0),
20 Complex::new(0.0, 2.0),
21 ];
22
23 let signal = Array::new(&values, dims);
24
25 af_print!("signal", signal);
26
27 // Used length of input signal as norm_factor
28 let output = fft(&signal, 0.1, samples as i64);
29
30 af_print!("Output", output);
31}

Callers

nothing calls this directly

Calls 3

set_deviceFunction · 0.85
infoFunction · 0.85
fftFunction · 0.85

Tested by

no test coverage detected