Skip to content

Commit

Permalink
Merge pull request #108 from jyrkialakuijala/tabuli
Browse files Browse the repository at this point in the history
more rotators (128->150) improves MSE by a few %
  • Loading branch information
jyrkialakuijala authored Jun 14, 2024
2 parents a3d6cb6 + 9794994 commit 4411d99
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cpp/zimt/cam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CamFilterbank Cam::CreateFilterbank(float sample_rate) const {

int sections = -1;
for (float left_cam = low_threshold_cam;
left_cam + cam_delta < high_threshold_cam; left_cam += cam_delta) {
left_cam + 0.5 * cam_delta < high_threshold_cam; left_cam += cam_delta) {
float left_hz = HzFromCam(left_cam);
float right_hz = HzFromCam(left_cam + cam_delta);
const std::vector<BACoeffs> filter_coeffs = DigitalSOSBandPass(
Expand Down
2 changes: 1 addition & 1 deletion cpp/zimt/cam.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct Cam {
float high_threshold_hz = 20000;
// Frequency resolution at low threshold. Default is 5 since it has
// provided the best correlation scores with tested datasets.
float minimum_bandwidth_hz = 5;
float minimum_bandwidth_hz = 1;
// Order (sharpness and slowness) of channel filters.
int filter_order = 1;
// Attenuation in dB in each filter where the filterbank filters meet.
Expand Down
2 changes: 1 addition & 1 deletion cpp/zimt/fourier_bank.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace tabuli {

float GetRotatorGains(int i) {
static const float kRotatorGains[kNumRotators] = {
static const float kRotatorGains[128] = {
1.050645, 1.948438, 3.050339, 3.967913, 4.818584, 5.303335, 5.560281,
5.490826, 5.156689, 4.547374, 3.691308, 2.666868, 1.539254, 0.656948,
0.345893, 0.327111, 0.985318, 1.223506, 0.447645, 0.830961, 1.075181,
Expand Down
2 changes: 1 addition & 1 deletion cpp/zimt/fourier_bank.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace tabuli {

constexpr int64_t kNumRotators = 128;
constexpr int64_t kNumRotators = 150;

float GetRotatorGains(int i);

Expand Down
1 change: 1 addition & 0 deletions cpp/zimt/zimtohrli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ void Zimtohrli::Spectrogram(
std::vector<float> gains;
for (size_t i = 0; i < cam_filterbank->filter.Size(); ++i) {
freqs.push_back(cam_filterbank->thresholds_hz[{1}][i]);
//freqs.push_back(20.0 * pow(1000.0, 1.0 * i / (cam_filterbank->filter.Size() - 1)));
gains.push_back(1.0);
}

Expand Down
Binary file modified go/goohrli/goohrli.a
Binary file not shown.

0 comments on commit 4411d99

Please sign in to comment.