forked from dholm/homebrew-sdr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgr-specest.rb
52 lines (45 loc) · 1.91 KB
/
gr-specest.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class GrSpecest < Formula
desc "Spectral estimation routines for GNU Radio"
homepage "https://github.com/kit-cel/gr-specest"
head "https://github.com/kit-cel/gr-specest.git"
patch :DATA
depends_on "cmake" => :build
depends_on "gcc" => :build
depends_on "swig" => :build
depends_on "openblas"
depends_on "gnuradio"
depends_on "boost"
depends_on "cppunit"
depends_on "fftw"
depends_on "armadillo"
def install
mkdir "build" do
ENV.append "LDFLAGS", "-Wl,-undefined,dynamic_lookup"
# Point Python library to existing path or CMake test will fail.
args = %W[
-DCMAKE_SHARED_LINKER_FLAGS='-Wl,-undefined,dynamic_lookup'
-DPYTHON_LIBRARY='#{HOMEBREW_PREFIX}/lib/libgnuradio-runtime.dylib'
] + std_cmake_args
system "cmake", "..", *args
system "make", "install"
end
end
end
__END__
diff --git i/lib/cyclo_fam_calcspectrum_algo.cc w/lib/cyclo_fam_calcspectrum_algo.cc
index fbb4e6a..c4adab0 100644
--- i/lib/cyclo_fam_calcspectrum_algo.cc
+++ w/lib/cyclo_fam_calcspectrum_algo.cc
@@ -93,10 +93,10 @@ namespace gr {
// Copy input stream to d_complex_demodulates and do the phase shifting
for(int m = 0; m < d_P*d_Np; m++) {
- d_complex_demodulates[p][i].real() = in[m].real()*cos(2*M_PI*i*(p*d_L)/d_Np)+
- in[m].imag()*sin(2*M_PI*i*(p*d_L)/d_Np);
- d_complex_demodulates[p][i].imag() = in[m].imag()*cos(2*M_PI*i*(p*d_L)/d_Np)-
- in[m].real()*sin(2*M_PI*i*(p*d_L)/d_Np);
+ d_complex_demodulates[p][i].real(in[m].real()*cos(2*M_PI*i*(p*d_L)/d_Np)+
+ in[m].imag()*sin(2*M_PI*i*(p*d_L)/d_Np));
+ d_complex_demodulates[p][i].imag(in[m].imag()*cos(2*M_PI*i*(p*d_L)/d_Np)-
+ in[m].real()*sin(2*M_PI*i*(p*d_L)/d_Np));
i++;
if((m+1)%d_Np==0){ // End of vector length Np