Add SSB demodulator.

This commit is contained in:
Jared Boone 2016-01-29 22:27:18 -08:00
parent 2fd8b1c4d4
commit 220b7b0a6a
2 changed files with 25 additions and 0 deletions

View File

@ -55,6 +55,23 @@ buffer_f32_t AM::execute(
return { dst.p, src.count, src.sampling_rate }; return { dst.p, src.count, src.sampling_rate };
} }
buffer_f32_t SSB::execute(
const buffer_c16_t& src,
const buffer_f32_t& dst
) {
const complex16_t* src_p = src.p;
const auto src_end = &src.p[src.count];
auto dst_p = dst.p;
while(src_p < src_end) {
*(dst_p++) = (src_p++)->real();
*(dst_p++) = (src_p++)->real();
*(dst_p++) = (src_p++)->real();
*(dst_p++) = (src_p++)->real();
}
return { dst.p, src.count, src.sampling_rate };
}
/* /*
static inline float angle_approx_4deg0(const complex32_t t) { static inline float angle_approx_4deg0(const complex32_t t) {
const auto x = static_cast<float>(t.imag()) / static_cast<float>(t.real()); const auto x = static_cast<float>(t.imag()) / static_cast<float>(t.real());

View File

@ -35,6 +35,14 @@ public:
); );
}; };
class SSB {
public:
buffer_f32_t execute(
const buffer_c16_t& src,
const buffer_f32_t& dst
);
};
class FM { class FM {
public: public:
buffer_f32_t execute( buffer_f32_t execute(