mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-16 19:09:46 -04:00
Clean up complex<int16_t> -> complex<float> casting.
This commit is contained in:
parent
85e984ed3b
commit
600a983d5c
3 changed files with 9 additions and 12 deletions
|
@ -42,12 +42,7 @@ void AISProcessor::execute(buffer_c8_t buffer) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for(size_t i=0; i<decimator_out.count; i++) {
|
for(size_t i=0; i<decimator_out.count; i++) {
|
||||||
// TODO: No idea why implicit cast int16_t->float is not allowed.
|
if( mf.execute_once(decimator_out.p[i]) ) {
|
||||||
const std::complex<float> sample {
|
|
||||||
static_cast<float>(decimator_out.p[i].real()),
|
|
||||||
static_cast<float>(decimator_out.p[i].imag())
|
|
||||||
};
|
|
||||||
if( mf.execute_once(sample) ) {
|
|
||||||
clock_recovery(mf.get_output());
|
clock_recovery(mf.get_output());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,12 +42,7 @@ void TPMSProcessor::execute(buffer_c8_t buffer) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for(size_t i=0; i<decimator_out.count; i++) {
|
for(size_t i=0; i<decimator_out.count; i++) {
|
||||||
// TODO: No idea why implicit cast int16_t->float is not allowed.
|
if( mf.execute_once(decimator_out.p[i]) ) {
|
||||||
const std::complex<float> sample {
|
|
||||||
static_cast<float>(decimator_out.p[i].real()),
|
|
||||||
static_cast<float>(decimator_out.p[i].imag())
|
|
||||||
};
|
|
||||||
if( mf.execute_once(sample) ) {
|
|
||||||
clock_recovery(mf.get_output());
|
clock_recovery(mf.get_output());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,13 @@ public:
|
||||||
return _rep;
|
return _rep;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr operator std::complex<float>() const {
|
||||||
|
return {
|
||||||
|
static_cast<float>(_v[0]),
|
||||||
|
static_cast<float>(_v[1])
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
union {
|
union {
|
||||||
int16_t _v[2];
|
int16_t _v[2];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue