RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fft.cpp
Go to the documentation of this file.
1 //
2 // File = fft.cpp
3 //
4 
5 #include <fstream>
6 #include <iostream>
7 
8 #include "complex.h"
9 #include "dit_sino.h"
10 #include "fft.h"
11 
12 void
13 ifft(complex* sample_spectrum, complex* time_signal, int num_samps)
14 {
15  int i;
16  for (i = 0; i < num_samps; i++) {
17  time_signal[i] = sample_spectrum[i];
18  }
19  IfftDitSino(time_signal, num_samps);
20  return;
21 }
22 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 void
24 fft(complex* time_signal, complex* sample_spectrum, int num_samps)
25 {
26  int i;
27  for (i = 0; i < num_samps; i++) {
28  sample_spectrum[i] = time_signal[i];
29  }
30  FftDitSino(sample_spectrum, num_samps);
31  return;
32 }
33 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
34 void
35 fft(complex* time_signal, complex* sample_spectrum, int num_samps, int fft_len)
36 {
37  int i;
38  for (i = 0; i < num_samps; i++) {
39  sample_spectrum[i] = time_signal[i];
40  }
41  for (i = num_samps; i < fft_len; i++) {
42  sample_spectrum[i] = complex(0.0, 0.0);
43  }
44  FftDitSino(sample_spectrum, fft_len);
45  return;
46 }
47 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
48 void
49 fft(complex* signal, int num_samps)
50 {
51  FftDitSino(signal, num_samps);
52  return;
53 }
54 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void FftDitSino(complex *array, int fft_size)
Definition: dit_sino.cpp:58
void fft(complex *time_signal, complex *sample_spectrum, int num_samps)
Definition: fft.cpp:24
void IfftDitSino(complex *array, int fft_size)
Definition: dit_sino.cpp:17
void ifft(complex *sample_spectrum, complex *time_signal, int num_samps)
Definition: fft.cpp:13