-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
167738f
commit 8f0d784
Showing
8 changed files
with
211 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
#include "../processor.h" | ||
|
||
namespace dsp::convert { | ||
class ComplexToReal : public Processor<complex_t, float> { | ||
using base_type = Processor<complex_t, float>; | ||
public: | ||
ComplexToReal() {} | ||
|
||
ComplexToReal(stream<complex_t>* in) { init(in); } | ||
|
||
void init(stream<complex_t>* in) { base_type::init(in); } | ||
|
||
inline static int process(int count, const complex_t* in, float* out) { | ||
volk_32fc_deinterleave_real_32f(out, (lv_32fc_t*)in, count); | ||
return count; | ||
} | ||
|
||
int run() { | ||
int count = base_type::_in->read(); | ||
if (count < 0) { return -1; } | ||
|
||
process(count, base_type::_in->readBuf, base_type::out.writeBuf); | ||
|
||
base_type::_in->flush(); | ||
if (!base_type::out.swap(count)) { return -1; } | ||
return count; | ||
} | ||
|
||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
#include "../processor.h" | ||
|
||
namespace dsp::math { | ||
class Conjugate : public Processor<complex_t, complex_t> { | ||
using base_type = Processor<complex_t, complex_t>; | ||
public: | ||
Conjugate() {} | ||
|
||
Conjugate(stream<complex_t>* in) { base_type::init(in); } | ||
|
||
inline static int process(int count, const complex_t* in, complex_t* out) { | ||
volk_32fc_conjugate_32fc((lv_32fc_t*)out, (lv_32fc_t*)in, count); | ||
return count; | ||
} | ||
|
||
virtual int run() { | ||
int count = base_type::_in->read(); | ||
if (count < 0) { return -1; } | ||
|
||
process(count, base_type::_in->readBuf, base_type::out.writeBuf); | ||
|
||
base_type::_in->flush(); | ||
if (!base_type::out.swap(count)) { return -1; } | ||
return count; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters