1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Attempt to use biquad filter; fix signs.

This commit is contained in:
Thomas Harte
2025-11-12 23:08:35 -05:00
parent c5c6c5ff72
commit cf33e17688
3 changed files with 37 additions and 12 deletions
+29 -1
View File
@@ -81,7 +81,35 @@ void SID::write(const Numeric::SizedInt<5> address, const uint8_t value) {
}
void SID::update_filter() {
// TODO!
using Type = SignalProcessing::BiquadFilter::Type;
Type type = Type::AllPass;
switch(filter_mode_.get()) {
case 0:
filter_ = SignalProcessing::BiquadFilter();
return;
case 1:
case 3: type = Type::LowPass; break;
case 2: type = Type::BandPass; break;
case 5: type = Type::Notch; break;
case 4:
case 6: type = Type::HighPass; break;
case 7: type = Type::AllPass; break;
}
filter_ =
SignalProcessing::BiquadFilter(
type,
1'000'000.0f,
30.0f + float(filter_cutoff_.get()) * 5.8f,
0.707f + float(filter_resonance_.get()) * 0.25f,
6.0f,
true
);
}
uint8_t SID::read(const Numeric::SizedInt<5> address) {