mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-11 15:29:28 -05:00
Use complex channel filter taps for AM/SSB.
This commit is contained in:
parent
ad4d7a2e8a
commit
f2dff16820
@ -103,7 +103,7 @@ void AnalogAudioModel::configure_am() {
|
|||||||
taps_6k0_decim_0,
|
taps_6k0_decim_0,
|
||||||
taps_6k0_decim_1,
|
taps_6k0_decim_1,
|
||||||
taps_6k0_decim_2,
|
taps_6k0_decim_2,
|
||||||
taps_6k0_channel,
|
taps_2k8_usb_channel,
|
||||||
audio_12k_hpf_300hz_config
|
audio_12k_hpf_300hz_config
|
||||||
};
|
};
|
||||||
shared_memory.baseband_queue.push(message);
|
shared_memory.baseband_queue.push(message);
|
||||||
|
@ -645,18 +645,6 @@ buffer_s16_t FIR64AndDecimateBy2Real::execute(
|
|||||||
return { dst.p, src.count / 2, src.sampling_rate / 2 };
|
return { dst.p, src.count / 2, src.sampling_rate / 2 };
|
||||||
}
|
}
|
||||||
|
|
||||||
void FIRAndDecimateComplex::configure(
|
|
||||||
const int16_t* const taps,
|
|
||||||
const size_t taps_count,
|
|
||||||
const size_t decimation_factor
|
|
||||||
) {
|
|
||||||
samples_ = std::make_unique<samples_t>(taps_count);
|
|
||||||
taps_reversed_ = std::make_unique<taps_t>(taps_count);
|
|
||||||
taps_count_ = taps_count;
|
|
||||||
decimation_factor_ = decimation_factor;
|
|
||||||
std::reverse_copy(&taps[0], &taps[taps_count], &taps_reversed_[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer_c16_t FIRAndDecimateComplex::execute(
|
buffer_c16_t FIRAndDecimateComplex::execute(
|
||||||
const buffer_c16_t& src,
|
const buffer_c16_t& src,
|
||||||
const buffer_c16_t& dst
|
const buffer_c16_t& dst
|
||||||
|
@ -235,11 +235,18 @@ private:
|
|||||||
size_t taps_count_;
|
size_t taps_count_;
|
||||||
size_t decimation_factor_;
|
size_t decimation_factor_;
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
void configure(
|
void configure(
|
||||||
const int16_t* const taps,
|
const T* const taps,
|
||||||
const size_t taps_count,
|
const size_t taps_count,
|
||||||
const size_t decimation_factor
|
const size_t decimation_factor
|
||||||
);
|
) {
|
||||||
|
samples_ = std::make_unique<samples_t>(taps_count);
|
||||||
|
taps_reversed_ = std::make_unique<taps_t>(taps_count);
|
||||||
|
taps_count_ = taps_count;
|
||||||
|
decimation_factor_ = decimation_factor;
|
||||||
|
std::reverse_copy(&taps[0], &taps[taps_count], &taps_reversed_[0]);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class DecimateBy2CIC4Real {
|
class DecimateBy2CIC4Real {
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
class Message {
|
class Message {
|
||||||
public:
|
public:
|
||||||
static constexpr size_t MAX_SIZE = 288;
|
static constexpr size_t MAX_SIZE = 512;
|
||||||
|
|
||||||
enum class ID : uint32_t {
|
enum class ID : uint32_t {
|
||||||
/* Assign consecutive IDs. IDs are used to index array. */
|
/* Assign consecutive IDs. IDs are used to index array. */
|
||||||
@ -377,7 +377,7 @@ public:
|
|||||||
const fir_taps_real<24> decim_0_filter,
|
const fir_taps_real<24> decim_0_filter,
|
||||||
const fir_taps_real<32> decim_1_filter,
|
const fir_taps_real<32> decim_1_filter,
|
||||||
const fir_taps_real<32> decim_2_filter,
|
const fir_taps_real<32> decim_2_filter,
|
||||||
const fir_taps_real<32> channel_filter,
|
const fir_taps_complex<64> channel_filter,
|
||||||
const iir_biquad_config_t audio_hpf_config
|
const iir_biquad_config_t audio_hpf_config
|
||||||
) : Message { ID::AMConfigure },
|
) : Message { ID::AMConfigure },
|
||||||
decim_0_filter(decim_0_filter),
|
decim_0_filter(decim_0_filter),
|
||||||
@ -391,7 +391,7 @@ public:
|
|||||||
const fir_taps_real<24> decim_0_filter;
|
const fir_taps_real<24> decim_0_filter;
|
||||||
const fir_taps_real<32> decim_1_filter;
|
const fir_taps_real<32> decim_1_filter;
|
||||||
const fir_taps_real<32> decim_2_filter;
|
const fir_taps_real<32> decim_2_filter;
|
||||||
const fir_taps_real<32> channel_filter;
|
const fir_taps_complex<64> channel_filter;
|
||||||
const iir_biquad_config_t audio_hpf_config;
|
const iir_biquad_config_t audio_hpf_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user